public function wakeByInterfaces(array $directories, $interfaceNames)
    {
        $classCollection = $this->awake($directories);
        $classes         = array();

        foreach ($classCollection as $className) {
            $reflectionClass = new ReflectionClass($className);
            $interfaces      = $reflectionClass->getInterfaces();

            if (is_array($interfaces) === true && isset($interfaces[$interfaceNames]) === true) {
                $class           = str_replace('\\', '', strrchr($className, '\\'));
                $classes[$class] = $className;
            }
        }

        return $classes;
    }
public function wakeByInterfaces(array $directories, $interfaceNames)
    {
        $classCollection = $this->awake($directories);
        $classes         = array();

        foreach ($classCollection as $className) {
            $reflectionClass = new ReflectionClass($className);
            $interfaces      = $reflectionClass->getInterfaces();

            if (is_array($interfaces) === true && isset($interfaces[$interfaceNames]) === true) {
                $class           = str_replace('\\', '', strrchr($className, '\\'));
                $classes[$class] = $className;
            }
        }

        return $classes;
    }
public function wakeByInterfaces ( array $ directories , $ interfaceNames ) { $ classCollection = $ this -> awake ( $ directories ) ; $ classes = array ( ) ; foreach ( $ classCollection as $ className ) { $ reflectionClass = new ReflectionClass ( $ className ) ; $ interfaces = $ reflectionClass -> getInterfaces ( ) ; if ( is_array ( $ interfaces ) === true && isset ( $ interfaces [ $ interfaceNames ] ) === true ) { $ class = str_replace ( '\\' , '' , strrchr ( $ className , '\\' ) ) ; $ classes [ $ class ] = $ className ; } } return $ classes ; }
Awake classes by interface
@param  string[] $directories    Target directory
@param  string   $interfaceNames Interface name
@return array
Awake classes by interface