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

Allow package to be installed with phpstan 0.12.x #16

Closed
hostep opened this issue Dec 22, 2019 · 4 comments · Fixed by #18
Closed

Allow package to be installed with phpstan 0.12.x #16

hostep opened this issue Dec 22, 2019 · 4 comments · Fixed by #18

Comments

@hostep
Copy link
Contributor

hostep commented Dec 22, 2019

Currently, the version constraint "phpstan/phpstan": "^0.11.6" blocks me to upgrade phpstan to 0.12.3 in one of my projects.

Would it be possible to test this package with phpstan 0.12.x and if everything is working, declare it as compatible with 0.12.x?

Suggestion would be to change the version constraint to:
"phpstan/phpstan": "^0.11.6 || ^0.12.0"

Thanks!

@hostep
Copy link
Contributor Author

hostep commented Dec 22, 2019

Hmm, it is probably not as easy as I would have guessed due to some backwards incompatible changes which got introduced in version 0.12.0 of phpstan, here are some errors I ran into while messing around a bit:

PHP Fatal error:  Class bitExpert\PHPStan\Magento\Reflection\MagicMethodReflection contains 7 abstract methods and must therefore be declared abstract or implement the remaining methods (PHPStan\Reflection\MethodReflection::isDeprecated, PHPStan\Reflection\MethodReflection::getDeprecatedDescription, PHPStan\Reflection\MethodReflection::isFinal, ...) in vendor/bitexpert/phpstan-magento/src/bitExpert/PHPStan/Magento/Reflection/MagicMethodReflection.php on line 20

PHP Fatal error:  Class bitExpert\PHPStan\Magento\Reflection\MagicMethodReflection contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (PHPStan\Reflection\ClassMemberReflection::getDocComment) in vendor/bitexpert/phpstan-magento/src/bitExpert/PHPStan/Magento/Reflection/MagicMethodReflection.php on line 22

PHP Fatal error:  Class bitExpert\PHPStan\Magento\Reflection\MagicMethodParameterReflection contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (PHPStan\Reflection\ParameterReflection::getDefaultValue) in vendor/bitexpert/phpstan-magento/src/bitExpert/PHPStan/Magento/Reflection/MagicMethodParameterReflection.php on line 20

Good to know:

  • phpstan is now being delivered as a .phar file via composer since 0.12.0 (which makes it hard to find its source code in a local project)
  • the source code of phpstan is moved to https://github.com/phpstan/phpstan-src/

@shochdoerfer
Copy link
Member

@hostep thanks for opening this issue. Sure we can upgrade the package to support the latest version of PHPStan. Would you be able to contribute a MR for this?

Looks like we better start versioning this package to support multiple versions for PHPStan...

@hostep
Copy link
Contributor Author

hostep commented Dec 26, 2019

Hi @shochdoerfer

I could look into creating a MR, but might take me a while, bit busy with a lot of things at the moment.

It might be possible to introduce a fix in a backwards compatible fashion though, but further investigation is needed.

@hostep
Copy link
Contributor Author

hostep commented Apr 6, 2020

Awesome, thanks a lot @shochdoerfer!

Looks like it works perfectly after quickly testing it out over here.

Great job!

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 a pull request may close this issue.

2 participants