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.
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
orNetteObjectClassReflectionExtension
, because$reflection->isSubclassOf()
triggers the autoloading and it dies on PHP 7.2. This PR solves the problem by:Nette\Object
.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.