Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing static property as non static #1156

Closed
AlexeyKosov opened this issue Jan 17, 2020 · 5 comments
Closed

Accessing static property as non static #1156

AlexeyKosov opened this issue Jan 17, 2020 · 5 comments

Comments

@AlexeyKosov
Copy link

AlexeyKosov commented Jan 17, 2020

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no

I use the serializer v3.4.0 with Symfony 5 and just ran into the issue:

Notice: Accessing static property Symfony\Component\Cache\Adapter\PhpArrayAdapter::$valuesCache as non static

ErrorException in /vendor/jms/serializer/src/Accessor/DefaultAccessorStrategy.php (line 86)

                    $this->readAccessors[$metadata->class] = \Closure::bind(static function ($o, $name) {
-->                     return $o->$name;
                    }, null, $metadata->class);

Stack trace:

/vendor/jms/serializer/src/Accessor/DefaultAccessorStrategy.php :: JMS\Serializer\Accessor{closure} (line 91)

return $this->readAccessors[$metadata->class]($object, $metadata->name);

/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php -> getValue (line 234)

$v = $this->accessor->getValue($data, $propertyMetadata, $this->context);

/vendor/jms/serializer/src/JsonSerializationVisitor.php -> accept (line 136)

$v = $this->navigator->accept($v, $metadata->type);

/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php -> visitProperty (line 241)

$this->visitor->visitProperty($propertyMetadata, $v);

/vendor/jms/serializer/src/JsonSerializationVisitor.php -> accept (line 136)

$v = $this->navigator->accept($v, $metadata->type);

/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php -> visitProperty (line 241)

 $this->visitor->visitProperty($propertyMetadata, $v);

/vendor/jms/serializer/src/JsonSerializationVisitor.php -> accept (line 136)

$v = $this->navigator->accept($v, $metadata->type);

/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php -> visitProperty (line 241)

$this->visitor->visitProperty($propertyMetadata, $v);

/vendor/jms/serializer/src/JsonSerializationVisitor.php -> accept (line 93)

$v = $this->navigator->accept($v, $elType);

/vendor/jms/serializer/src/GraphNavigator/SerializationGraphNavigator.php -> visitArray (line 159)

return $this->visitor->visitArray((array) $data, $type);

...

@AlexeyKosov
Copy link
Author

Looks like the serializer stumbled upon some huge backtrace of an exception and could not cope with it, so probably it's not an issue.

xepozz added a commit to xepozz/serializer that referenced this issue Jul 3, 2020
@xepozz
Copy link
Contributor

xepozz commented Jul 3, 2020

I have the same error in Symfony 4.4.10
image

xepozz added a commit to xepozz/serializer that referenced this issue Jul 3, 2020
@xepozz xepozz mentioned this issue Jul 3, 2020
xepozz added a commit to xepozz/serializer that referenced this issue Jul 6, 2020
xepozz added a commit to xepozz/serializer that referenced this issue Jul 6, 2020
@goetas
Copy link
Collaborator

goetas commented Jul 12, 2020

solved in #1237

@goetas goetas closed this as completed Jul 12, 2020
@xepozz
Copy link
Contributor

xepozz commented Jul 16, 2020

@goetas can you please release this functionality and update jms/serializer-bundle?
I really need this bugfix...

@xepozz
Copy link
Contributor

xepozz commented Aug 5, 2020

@goetas ?

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

No branches or pull requests

3 participants