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

PHP 7.2 compatibility vol.2 #10

Merged
merged 2 commits into from
Aug 6, 2017
Merged

PHP 7.2 compatibility vol.2 #10

merged 2 commits into from
Aug 6, 2017

Conversation

xificurk
Copy link
Contributor

Regarding PHP 7.2 compatibility, it turns out #9 is not enough. Although the existing tests passed, you run into a problem when you actually execute the code of DoNotExtendNetteObjectRule or NetteObjectClassReflectionExtension, because $reflection->isSubclassOf() triggers the autoloading and it dies on PHP 7.2.
This PR solves the problem by:

  • Adding tests for both classes, so the code is actually executed during travis build.
  • Rewriting the code so that it avoids triggering autoloading of Nette\Object.
  • There is a small BC break - DoNotExtendNetteObjectRule now checks only the direct parent of a class. But I consider this a bugfix - PHPStan should report problems with project code only, not problems with classes from 3rd party libs that are used and extended in the project.

@ondrejmirtes
Copy link
Member

Thanks a lot, awesome PR! :)

BTW: I think that PHPStan triggers autoloading of classes in more cases than it should, I'll try to address this.

@ondrejmirtes ondrejmirtes merged commit a070114 into phpstan:master Aug 6, 2017
@xificurk xificurk deleted the php72-compatibility-vol2 branch August 9, 2017 19:27
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 this pull request may close these issues.

None yet

2 participants