Skip to content

Added allowExceptIn, disallowIn

Compare
Choose a tag to compare
@spaze spaze released this 04 Nov 18:51
885582f

You can now disallow methods, functions, constants, namespaces, classes, superglobals only in specified paths (#134)

Done with allowExceptIn, disallowIn (which is just an alias of allowExceptIn), this allows to create an inverse of allowIn setup:

parameters:
    allowInRootDir: %rootDir%/../../..
    disallowedMethodCalls:
        -
            method: 'PotentiallyDangerous\Logger::log()'
            allowExceptIn:
                - path/to/some/dir/*.php

This will disallow PotentiallyDangerous\Logger::log() calls in %rootDir%/../../../path/to/some/dir/*.php.

You don't need to use allowInRootDir, it's here just to show that the path specified by the option is also used in this case too ☺️