Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • damiencal

    (@damiencal)

    Getting same here but i’m using php7.4. The plugin updated by itself, which imo should not occur if the requirements are set in the plugin info.

    It looks like you are getting a deprecated error when using the offsetSet() method of the FacebookAds\Object\ServerSide\AdsPixelSettings class in PHP. This error is occurring because the return type of the offsetSet() method is not compatible with the ArrayAccess interface, which it is implementing.

    To fix this error, you will need to either change the return type of the offsetSet() method to void, or use the #[\ReturnTypeWillChange] attribute to temporarily suppress the notice.

    Here’s an example of how you could modify the offsetSet() method to fix this error:

    public function offsetSet($offset, $value): void
    {
        if (is_null($offset)) {
            $this->data[] = $value;
        } else {
            $this->data[$offset] = $value;
        }
    }

    Alternatively, you can use the #[\ReturnTypeWillChange] attribute to suppress the notice:

    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->data[] = $value;
        } else {
            $this->data[$offset] = $value;
        }
    }

    Keep in mind that using the #[\ReturnTypeWillChange] attribute is only a temporary solution and should be used only if you are unable to change the return type of the offsetSet() method to void.

Viewing 2 replies - 1 through 2 (of 2 total)