src/ClassLocator.php
protected function isTargeted(\ReflectionClass $class, \ReflectionClass $target = null): bool
    {
        if (empty($target)) {
            return true;
        }

        if (!$target->isTrait()) {
            //Target is interface or class
            return $class->isSubclassOf($target) || $class->getName() == $target->getName();
        }

        //Checking using traits
        return in_array($target->getName(), $this->fetchTraits($class->getName()));
    }
protected function isTargeted(\ReflectionClass $class, \ReflectionClass $target = null): bool
    {
        if (empty($target)) {
            return true;
        }

        if (!$target->isTrait()) {
            //Target is interface or class
            return $class->isSubclassOf($target) || $class->getName() == $target->getName();
        }

        //Checking using traits
        return in_array($target->getName(), $this->fetchTraits($class->getName()));
    }
protected function isTargeted ( \ ReflectionClass $ class , \ ReflectionClass $ target = null ) : bool { if ( empty ( $ target ) ) { return true ; } if ( ! $ target -> isTrait ( ) ) { //Target is interface or class return $ class -> isSubclassOf ( $ target ) || $ class -> getName ( ) == $ target -> getName ( ) ; } //Checking using traits return in_array ( $ target -> getName ( ) , $ this -> fetchTraits ( $ class -> getName ( ) ) ) ; }
Check if given class targeted by locator.

@param \ReflectionClass      $class
@param \ReflectionClass|null $target
@return bool
Check if given class targeted by locator .