Skip to content

Fix offset exists check in DataBag#347

Open
TheMilek wants to merge 1 commit intoSylius:mainfrom
TheMilek:fix-offset-exists-check-in-DataBag
Open

Fix offset exists check in DataBag#347
TheMilek wants to merge 1 commit intoSylius:mainfrom
TheMilek:fix-offset-exists-check-in-DataBag

Conversation

@TheMilek
Copy link
Member

@TheMilek TheMilek commented Feb 11, 2026

isset() returns false even if the key exists, but is set to null. To prevent throwing errors when the key is set to null, maybe we should check only if the key exists 🤔 https://www.php.net/manual/en/function.isset.php

unset($this->container[$offset]);
}

public function __isset(string $name): bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed privately, this is not cool, cause it changes the default behaviour of the native php method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants