In my Symfony application I have a User
entity which is serialized. In the unserialize()
method, I did this:
public function unserialize($serialized)
{
[
$this->id,
$this->email,
$this->password,
$this->enabled
] = unserialize($serialized);
}
But PhpStorm underlines in red unserialize($serialized)
with the following message:
Please specify classes allowed for unserialization in 2nd argument.
I don't know what I'm supposed to use as a second argument. After some research, I saw that we could put this:
unserialize($serializeObj, ["allowed_classes" => true]);
But I also found this:
unserialize(
$serializedData,
['allowed_classes' => ['Class1', 'Class2']]
);
I'm a little confused, I don't know what I should put in my case so that PhpStorm doesn't complain about this.