protected function resolveObjectRealInterfaceExtensions(ClassAwareDefinitionInterface $definition): void
    {
        $class = $definition->getClass();

        if (class_exists($class)) {
            $refClass = new \ReflectionClass($definition->getClass());
            if ($interfaces = $refClass->getInterfaceNames()) {
                foreach ($interfaces as $interface) {
                    $bundleNamespace = ClassUtils::relatedBundleNamespace($interface);
                    if (preg_match('/(\w+)Interface?$/', $interface, $matches)) {
                        $extensionClass = ClassUtils::applyNamingConvention($bundleNamespace, 'Extension', null, $matches[1].'Extension');
                        if (class_exists($extensionClass)) {
                            if ($definition instanceof HasExtensionsInterface) {
                                $definition->addExtension($extensionClass);
                            }
                        }
                    }
                }
            }
        }
    }
protected function resolveObjectRealInterfaceExtensions(ClassAwareDefinitionInterface $definition): void
    {
        $class = $definition->getClass();

        if (class_exists($class)) {
            $refClass = new \ReflectionClass($definition->getClass());
            if ($interfaces = $refClass->getInterfaceNames()) {
                foreach ($interfaces as $interface) {
                    $bundleNamespace = ClassUtils::relatedBundleNamespace($interface);
                    if (preg_match('/(\w+)Interface?$/', $interface, $matches)) {
                        $extensionClass = ClassUtils::applyNamingConvention($bundleNamespace, 'Extension', null, $matches[1].'Extension');
                        if (class_exists($extensionClass)) {
                            if ($definition instanceof HasExtensionsInterface) {
                                $definition->addExtension($extensionClass);
                            }
                        }
                    }
                }
            }
        }
    }
protected function resolveObjectRealInterfaceExtensions ( ClassAwareDefinitionInterface $ definition ) : void { $ class = $ definition -> getClass ( ) ; if ( class_exists ( $ class ) ) { $ refClass = new \ ReflectionClass ( $ definition -> getClass ( ) ) ; if ( $ interfaces = $ refClass -> getInterfaceNames ( ) ) { foreach ( $ interfaces as $ interface ) { $ bundleNamespace = ClassUtils :: relatedBundleNamespace ( $ interface ) ; if ( preg_match ( '/(\w+)Interface?$/' , $ interface , $ matches ) ) { $ extensionClass = ClassUtils :: applyNamingConvention ( $ bundleNamespace , 'Extension' , null , $ matches [ 1 ] . 'Extension' ) ; if ( class_exists ( $ extensionClass ) ) { if ( $ definition instanceof HasExtensionsInterface ) { $ definition -> addExtension ( $ extensionClass ) ; } } } } } } }
Using naming convention resolve all extensions for given object
based on implemented interfaces.

This method use PHP real interfaces instead of registered interface types.

@param ClassAwareDefinitionInterface $definition

@throws \ReflectionException
Using naming convention resolve all extensions for given object based on implemented interfaces .