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

Check `allowedIn` trait files, if the call is in a trait #103

Closed spaze closed 2 years ago

spaze commented 2 years ago

If the call is in a trait, check if the call is allowed in the trait file, not in the calling class file.

Unfortunately, can't write a test for it as $scope->getTraitReflection() returns null in tests.

Fix #99