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

[Bug] Cannot run ./vendor/bin/ecs in 1.8 #525

Open
co-codr opened this issue Mar 4, 2021 · 2 comments
Open

[Bug] Cannot run ./vendor/bin/ecs in 1.8 #525

co-codr opened this issue Mar 4, 2021 · 2 comments

Comments

@co-codr
Copy link

co-codr commented Mar 4, 2021

Sylius-Standard version: 1.8.9
PHP: 7.3 or 7.4

How to reproduce:

Clone https://github.com/Sylius/Sylius-Standard
Checkout branch 1.8
Run composer install
Run ./vendor/bin/ecs

Error in console:

[ERROR] in_array() expects parameter 2 to be array, null given

Possible fixes:

  • Upgrade to symplify/easy-coding-standard:v^9.0

The problem is in vendor/symplify/easy-coding-standard/src/Yaml/CheckerServiceParametersShifter.php constructor where serviceKeywords comes NULL instead of empty array.
After further investigation found out that in symfony/dependency-injection:4.4.19 the serviceKeywords has changed from a property to a constant in this commit.

A patch fix can be to change lines 72-73 in vendor/symplify/easy-coding-standard/src/Yaml/CheckerServiceParametersShifter.php to:

    $serviceKeywordsProperty = (new ReflectionClass(YamlFileLoader::class))
            ->getConstant('SERVICE_KEYWORDS');

I will try to push a fix to symplify/easy-coding-standard repo as well deprecated-packages/symplify#3017.
I think same issue might occur in 1.9 as well.

@co-codr
Copy link
Author

co-codr commented Apr 8, 2021

Did not agree creating a 8.x branch in simplify, so the only solution is to upgrade to symplify/easy-coding-standard:v^9.0

@Zales0123
Copy link
Member

Thank you for the investigation! 🎉 As far as I see, it would also require upgrading sylius-labs/coding-standard to ^4.0. Do you think you would be able to open a PR?

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

No branches or pull requests

2 participants