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

Allow superglobal when allowed in a trait #107

Closed spaze closed 2 years ago

spaze commented 2 years ago

IsAllowedFileHelper now does the matching, it doesn't just concatenate some strings anymore.

First I wanted to also iterate say DisallowedCalls::allowedIn in the method but there are some other conditions that will influence the return value sometimes too, like exactly in DisallowedCalls: https://github.com/spaze/phpstan-disallowed-calls/blob/a16e9219f02c3b70099fe640abbb39b0452aa8d4/src/DisallowedHelper.php#L49-L54

Plus now the trait-related code is actually tested.

Fix #106