Kahlan\Jit\Interceptor::allowed PHP Method

allowed() public method

Checks if a class is allowed to be patched.
public allowed ( string $class ) : boolean
$class string The name of the class to check.
return boolean Returns `true` if the class is allowed to be patched, `false` otherwise.
    public function allowed($class)
    {
        foreach ($this->_exclude as $namespace) {
            if (strpos($class, $namespace) === 0) {
                return false;
            }
        }
        if ($this->_include === ['*']) {
            return true;
        }
        foreach ($this->_include as $namespace) {
            if (strpos($class, $namespace) === 0) {
                return true;
            }
        }
        return false;
    }