@param class-string $interface

@return array<class-string, string[]>
435397
final protected function FilterMethods(string $interface, array $methods) : array
    {
        /**
        * @var array<class-string, string[]>
        */
        $filteredMethods = $this->FilterNonZeroArray(array_map(
            [$this, 'FilterArrayOfInterfacesOrClasses'],
            array_filter(
                array_filter($methods, 'is_string', ARRAY_FILTER_USE_KEY),
                $this->MakeMethodFilter($interface),
                ARRAY_FILTER_USE_KEY
            )
        ));

        return $filteredMethods;
    }
1113505
private static function getModifiers($class, $method)
    {
        $reflectionClass = new \ReflectionClass($class);
        /**
         * @var \ReflectionClass $reflectionInterfaces
         */
        $reflectionInterfaces = $reflectionClass->getInterfaces();

        $isInterfaceMethod = 0;
        foreach ($reflectionInterfaces as $reflectionInterface) {
            if ($reflectionInterface->hasMethod($method)) {
                $isInterfaceMethod = 1;
            }
        }

        $topMostClass = self::getTopMostClass($reflectionClass);

        $isAbstractMethod = 0;
        if ($topMostClass->isAbstract() && $topMostClass->hasMethod($method)) {
            $isAbstractMethod = 2;
        }

        $reflectionMethod = new \ReflectionMethod($class, $method);
        $visibility = $reflectionMethod->getModifiers();

        if ($isAbstractMethod | $isInterfaceMethod) {
            $visibility = $visibility | Constants::ABSTRACT_ONLY;
        }

        return $visibility;
    }
266282
public function getExtraPropertiesFor($interface) {
        if(!$this->isInterfaceAvailable($interface)) {
            throw new InvalidArgumentException('Unknown interface: ' . $interface);
        }

        $interfaceRelation = self::relation[$interface];
        if(!isset($interfaceRelation['extraProperties'])) {
            throw new InvalidArgumentException('Interface: ' . $interface . ' does not support extra properties.');
        }

        return $interfaceRelation['extraProperties'];
    }
303607
protected function getInterfaceNamesFromIntroductions(array $interfaceIntroductions): array
    {
        $interfaceNames = [];
        foreach ($interfaceIntroductions as $introduction) {
            $interfaceNames[] = '\\' . $introduction->getInterfaceName();
        }
        return $interfaceNames;
    }
190244
public static void getAllInterfaces(Class<?> classObject, ArrayList<Type> interfaces) {
        Type[] superInterfaces = classObject.getGenericInterfaces();
        interfaces.addAll((Arrays.asList(superInterfaces)));

        // for cases where the extended class is defined with a Generic.
        Type tgs = classObject.getGenericSuperclass();
        if (tgs != null) {
            if ((tgs) instanceof ParameterizedType) {
                interfaces.add(tgs);
            }
        }

        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "updated interfaces to: " + interfaces);
        }

        Class<?> superClass = classObject.getSuperclass();
        if (superClass != null) {
            getAllInterfaces(superClass, interfaces);
        }
    }
237782
public JClass []getInterfaces()
  {
    lazyLoad();
    
    JClass []interfaces = new JClass[_interfaces.size()];

    for (int i = 0; i < _interfaces.size(); i++) {
      String name = _interfaces.get(i);
      name = name.replace('/', '.');
      
      interfaces[i] = getClassLoader().forName(name);
    }
    
    return interfaces;
  }
930444
private function getPropertyTypes(ObjectInterface $object, $index)
    {
        $objectClass = get_class($object);

        if (!array_key_exists($objectClass, $this->reflectionCache) || !array_key_exists($index,
                $this->reflectionCache[$objectClass])) {

            $propertyTypes = $this->PropertyInfoExtractor->getTypes($objectClass, $index);

            $this->reflectionCache[$objectClass][$index] = $propertyTypes;
        } else {
            $propertyTypes = $this->reflectionCache[$objectClass][$index];
        }

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

        $this->createInterfaceDirectory();

        $this->createBaseInterfaceFile();

        $this->createInterfaceFile($interface);
    }
293185
protected function getInterfaceMethods()
    {
        $methods = array();

        foreach ($this->interfaces as $interface) {
            $ref = new \ReflectionClass($interface);
            $methods = array_merge($methods, $ref->getMethods());
        }

        return $methods;
    }
60964
public function addInterface(string $interface) : bool
    {
        $retval = false;

        if (!array_search($interface, $this->interface_list)) {
            $this->interface_list[] = $interface;
            $retval = true;
        }

        return $retval;
    }
620698
public function getImplementorMap($interface, $baseClass = null)
    {
        // Create Map Array:
        
        $map = [];
        
        // Define Base Class (if none given):
        
        if (!$baseClass) {
            $baseClass = SiteTree::class;
        }
        
        // Obtain Implementors:
        
        if ($implementors = ClassInfo::implementorsOf($interface)) {
            
            // Filter Implementors:
            
            $records = $baseClass::get()->filter([
                'ClassName' => $implementors
            ])->sort('ClassName');
            
            // Define Map Array:
            
            foreach ($records as $record) {
                $map[$record->ID] = sprintf(
                    '%s (%s)',
                    $record->hasMethod('NestedTitle') ? $record->NestedTitle(5, ' > ') : $record->Title,
                    $record->i18n_singular_name()
                );
            }
            
        }
        
        // Answer Map Array:
        
        return $map;
    }
1058868
public function getServiceInstanceByInterface($interface)
    {
        foreach ($this->getServiceInstances() as $info) {
            if (!isset($info['instance'])) {
                continue;
            }
            $instance = $info['instance'];

            if ($instance instanceof $interface) {
                return $instance;
            }
        }

        return false;
    }
646322
public static function getSubTypeList($type) {
        if (empty(self::$_subTypes[$type])) {
            throw new InvalidArgumentException(sprintf('Sub-type %s does not exist', $type));
        }

        $types = array();

        foreach (self::$_subTypes[$type] as $ext) {
            $types[$ext] = self::getTypeFromExt($ext);
        }

        return $types;
    }
1311734
private function getProviders($identifier)
    {
        if (isset($this->interfaceProviders[$identifier])) {
            return $this->interfaceProviders[$identifier];
        } elseif (isset($this->classProviders[$identifier])) {
            return $this->classProviders[$identifier];
        } else {
            return [];
        }
    }
1337541
public function getTypesBySpecification(SpecificationInterface $spec)
    {
        $types = [];

        foreach ($this as $type) {
            /** @var TypeInterface $type */
            if ($spec->isSatisfiedBy($type)) {
                $types[] = $type;
            }
        }

        return $types;
    }
271859
function &interfaces()
    {
        $interfaces = NULL;
        foreach ($this->_classes as $name => $interface) {
            if ($interface->isInterface()) {
                $interfaces[$name] =& $this->_classes[$name];
            }
        }

        return $interfaces;
    }
584862
private function getOptions(MethodInterface $method)
    {
        if ($method->getMethod() == $method::GET) {
            return [
                'query' => $method->getAttributes(),
            ];
        }

        return [
            'headers' => [
                'Content-Type' => 'application/json',
            ],
            'body' => json_encode(
                $this->prepareAttributes($method->getAttributes()),
                JSON_FORCE_OBJECT
            )
        ];
    }