Skip to content

New definedIn & exclude directives to limit selection

Compare
Choose a tag to compare
@spaze spaze released this 28 May 21:52
· 101 commits to main since this release
cae3e66

Can exclude some attributes, calls, namespaces (#197, #199)

Handy when you disallow items with wildcards but there's this one thing you'd like to leave out.

parameters:
    disallowedFunctionCalls:
        -
            function: 'pcntl_*()'
            exclude:
                - 'pcntl_foo*()'

exclude can be a string or an array/list of strings. Currently works for attributes, function & method calls, namespaces.

Add definedIn?:string|list<string> config option (#198, #200)

To further specify/limit files where the function or method should be defined to be disallowed.

parameters:
    disallowedFunctionCalls:
        -
            function: '*'
            definedIn:
                - 'vendor/foo/bar'
    disallowedMethodCalls:
        -
            method: '*'
            definedIn:
                - 'vendor/foo/bar'

definedIn can also be string or a list/array of strings. Currently works for function and method calls only. You may also need to set filesRootDir, see the README.

Internal changes

  • Internal naming cleanup (#195)
  • Require symfony/polyfill-php80 for dev/tests because some tests use str_starts_with() (#196)