spaze / phpstan-disallowed-calls

PHPStan rules to detect disallowed method & function calls, constant, namespace, attribute & superglobal usages
MIT License
255 stars 17 forks source link

Child constructor should be disallowed when parent constructor is disallowed #146

Closed spaze closed 1 year ago

spaze commented 1 year ago

Given code like this (this is a code from a test actually):

$sub = new Inheritance\Sub();

and configuration (from a test as well, so no neon syntax) like:

'method' => 'Inheritance\Base::__construct()',

the call is not reported.

The call is reported if I change the configuration to

'method' => 'Inheritance\Sub::__construct()',
spaze commented 1 year ago

The fix for this has been released in 2.11.2.