Sylius: Error into Component/User/Model/User.php ?

Created on 20 Mar 2020  路  4Comments  路  Source: Sylius/Sylius

Sylius version affected: 1.7.0

Description
Hi everyone,
Today I tried to upgrade my Sylius version to 1.7.0 (from 1.6.4)
Everything was fine until I got this issue at the end of symfony cache:clear command :

"Attempted to call an undefined method named "getType" of class "phpDocument or\Reflection\DocBlock\Tags\InvalidTag"

After digging, I found that this error was generated by this bundle :

symfony/property-info (v4.4.5)

After digging again, I found this line in Sylius Core :
https://github.com/Sylius/Sylius/blob/90fd5eb6b92e172f43703e8f5c3d2a76f4da2e3b/src/Sylius/Component/User/Model/User.php#L101

And after removed it, no more error message ...

What do you think ?

Thank you guys.

Steps to reproduce

Help Wanted Potential Bug

Most helpful comment

I'd do my best to have this patch version released by Monday 馃帀

All 4 comments

Hey guys,
We're having the same thing while upgrading to sylius 1.7.0 too.

At first we had other bugs related to other Iterable comments that we resolved by upgrading concerned packages (symfony/property-info, phpdocumentor/type-resolver and phpdocumentor/reflection-docblock).

Then we're facing this exact problem, but it seems to me it's more a problem of the regular @var of the $oauthAccounts property which uses the pseudo-type array-key which is "un-resolvable" for symfony/property-info (as it understands this one as a relative class identifier).

https://github.com/Sylius/Sylius/blob/a884a8e86023dff0b3049374faa985309a839e98/src/Sylius/Component/User/Model/User.php#L98-L99

But, and that's what I call anticipation, the problem is already solved in master thanks to this commit : https://github.com/Sylius/Sylius/commit/90fd5eb6b92e172f43703e8f5c3d2a76f4da2e3b

Here the array-key type is used in a @psalm-var annotation instead of a classic one. Juste tried to run our whole test suite using this commit of sylius/sylius and the problem was gone.

Can you confirm this @pchauvelin?

I'd do my best to have this patch version released by Monday 馃帀

All's good for me
Thanks @pamil !

I came across this issue as well in a non-Sylius project. This is a related issue:
https://github.com/symfony/symfony/issues/36049

Was this page helpful?
0 / 5 - 0 ratings