@param string[] $classes
@param string   $interface

@return iterable
963375
protected static function selectClassImplements(array $classes, string $interface): iterable
    {
        foreach ($classes as $className) {
            if (static::classImplements($className, $interface) === true) {
                yield $className;
            }
        }
    }
636476
private static void collectInterfaces(Set<Class<?>> interfaces, Class<?> anInterface) {
        interfaces.add(anInterface);
        for (Class<?> superInterface : anInterface.getInterfaces()) {
            collectInterfaces(interfaces, superInterface);
        }
    }
838091
public function load(array $initClasses)
    {
        foreach ($initClasses as $initClass) {
            \Parable\DI\Container::create($initClass);
        }
        return $this;
    }
86856
private static void getAllInterfaces(Class<?> cls, Collection<Class<?>> interfacesFound) {
        while (cls != null) {
            Class<?>[] interfaces = cls.getInterfaces();

            for (int i = 0; i < interfaces.length; i++) {
                interfacesFound.add(interfaces[i]);
                getAllInterfaces(interfaces[i], interfacesFound);
            }

            cls = cls.getSuperclass();
         }
     }
1264348
protected static function classImplements(string $class, string $interface): bool
    {
        assert(class_exists($class));
        assert(interface_exists($interface));

        $implements = array_key_exists($interface, class_implements($class));

        return $implements;
    }
11120
public function getSubAdminClasses(array $classes)
    {
        $classCollection = [];

        foreach ($classes as $key => $class) {
            if ($this->usableClass($key)) {
                $classCollection[] = [$key => $this->getSubAdminClasses($class)];
                continue;
            }

            if ($this->usableClass($class)) {
                $classCollection[] = $class;
                continue;
            }
        }

        return $classCollection;
    }
225503
protected function createInterface($interface)
    {
        if($this->repositoryNameExists($interface) === true) {
            return $this->error('Interface already exists');
        }

        $this->createInterfaceDirectory();

        $this->createBaseInterfaceFile();

        $this->createInterfaceFile($interface);
    }
735180
private function getInterface($class) {
        $interfaceName = $class;
        $interfaces = class_implements($class);
        if (!empty($interfaces)) {
            if (count($interfaces) == 1) {
                $interfaceName = array_shift($interfaces);
            } elseif ($key = array_search($class . 'Interface', $interfaces)) {
                $interfaceName = $interfaces[$key];
            }
        }

        return $interfaceName;
    }
214354
private static void getInterfaceMethods(Class<?> cls,
                                            Map<Signature, Method> sigs) {
        Class<?>[] intfs = cls.getInterfaces();
        for (int i=0; i < intfs.length; i++) {
            Class<?> intf = intfs[i];
            boolean done = getInternalPublicMethods(intf, sigs);
            if (!done) {
                getInterfaceMethods(intf, sigs);
            }
        }
    }
594816
protected function getMethodDefinitions($interface)
    {
        $definitions = [];

        try {
            $reflection = new ReflectionClass($interface);

            if (! $reflection->isInterface()) {
                throw new InvalidArgumentException("{$interface} must be an interface.");
            }

            foreach ($reflection->getMethods() as $method) {
                $definition = 'public function ';

                $definition .= $method->getName();
                $definition .= $this->renderMethodParameters($method);
                $definition .= $this->renderMethodReturnType($method);
                $definition .= $this->renderMethodBody($method);

                $definitions[] = $definition;
            }
        } catch (Throwable $e) {
           Log::channel('homer')->warning("Reflect {$interface} failed.", [
               'exception' => $e,
           ]);

            throw $e;
        }

        return implode("\n\n", $definitions);
    }
892573
public function getImplements($class)
    {
        $interfaces = [];
        $classId = $this->getClassId($class);
        if (isset($classId)) {
            if (isset($this->implements[$classId])) {
                foreach ($this->implements[$classId] as $interfaceId) {
                    $interfaces[$this->interfaces[$interfaceId]] = 1;
                }
            }
            foreach ($this->getAncestors($class) as $parent) {
                foreach ($this->getImplements($parent) as $interface) {
                    $interfaces[$interface] = 1;
                }
            }
        }
        return array_keys($interfaces);
    }
1043330
protected function createInstance($classes, $properties) {
        $first = array_shift($classes);
        $instance = $first->createInstanceWithProperties($properties);
        foreach ($classes as $class) {
            $instance = $this->getResource('');
            $instance->setType($class);
        }
        return $instance;
    }
897191
static function classLikeGetFirstLevelInterfaces(ClassLikeReflectionInterface $classLikeReflection) {
    if ($classLikeReflection->isInterface()) {
      return array($classLikeReflection->getName() => $classLikeReflection);
    }
    $interfaces = $classLikeReflection->getOwnInterfaces();
    if (NULL !== $parentClass = $classLikeReflection->getParentClass()) {
      $interfaces += self::classLikeGetFirstLevelInterfaces($parentClass);
    }
    return $interfaces;
  }
1009071
public ClassDoc[] interfaces() {
        ListBuffer<ClassDocImpl> ret = new ListBuffer<ClassDocImpl>();
        for (ClassDocImpl c : getClasses(true)) {
            if (c.isInterface()) {
                ret.append(c);
            }
        }
        return ret.toArray(new ClassDocImpl[ret.length()]);
    }
882288
public static Class[] getAllInterfaces(Object instance) {
        Assert.notNull(instance, "Instance must not be null");
        return getAllInterfacesForClass(instance.getClass());
    }
964987
protected function writeObjectInterfaces($object, $interfaces)
    {
        foreach ($interfaces as $interfaceName) {
            try {
                $interface   = $this->reflector->getClass($interfaceName);
                $longName    = $interface->getName();

                $this->writeObjectElement($interface);

            } catch (\Exception $e) {
                // interface is undeclared in data source
                $parts       = explode('\\', $interfaceName);
                $shortName   = array_pop($parts);
                $longName    = $interfaceName;
                $ns          = implode($this->namespaceSeparator, $parts);

                if (!isset($this->objects[$ns])) {
                    $this->objects[$ns] = array();
                }

                if (!array_key_exists($shortName, $this->objects[$ns])) {
                    $this->pushObject($ns, $shortName, $longName, 'interface');
                }
            }

            $this->pushEdge(
                array($object->getName(), $longName),
                array('arrowhead' => 'empty', 'style' => 'dashed')
            );
        }
    }
427410
private function doDetectByInterfaces($className)
    {
        $interfaces = $this->getOrderedInterfaces($className);
        foreach ($interfaces as $interface) {
            $candidate = $this->doDetectByRoutes($interface);
            if ($candidate) {
                return $candidate;
            }
        }

        return;
    }