src/Entity/Factory/EntityDependencyInjector.php
private function buildEntityInjectMethodsForEntity(EntityInterface $entity): void
    {
        $reflection = $entity::getDoctrineStaticMeta()->getReflectionClass();
        $entityFqn  = $this->leadingSlash($reflection->getName());
        if (array_key_exists($entityFqn, $this->entityInjectMethods)) {
            return;
        }
        $this->entityInjectMethods[$entityFqn] = [
            self::TYPE_KEY_INSTANCE => [],
            self::TYPE_KEY_STATIC   => [],
        ];

        $methods = $reflection->getMethods(\ReflectionMethod::IS_PUBLIC);
        foreach ($methods as $method) {
            if (!\ts\stringStartsWith($method->getName(), self::INJECT_DEPENDENCY_METHOD_PREFIX)) {
                continue;
            }
            $typeKey = $method->isStatic() ? self::TYPE_KEY_STATIC : self::TYPE_KEY_INSTANCE;

            $this->entityInjectMethods[$entityFqn][$typeKey][$method->getName()] =
                $this->getDependencyForInjectMethod($method);
        }
    }
private function buildEntityInjectMethodsForEntity(EntityInterface $entity): void
    {
        $reflection = $entity::getDoctrineStaticMeta()->getReflectionClass();
        $entityFqn  = $this->leadingSlash($reflection->getName());
        if (array_key_exists($entityFqn, $this->entityInjectMethods)) {
            return;
        }
        $this->entityInjectMethods[$entityFqn] = [
            self::TYPE_KEY_INSTANCE => [],
            self::TYPE_KEY_STATIC   => [],
        ];

        $methods = $reflection->getMethods(\ReflectionMethod::IS_PUBLIC);
        foreach ($methods as $method) {
            if (!\ts\stringStartsWith($method->getName(), self::INJECT_DEPENDENCY_METHOD_PREFIX)) {
                continue;
            }
            $typeKey = $method->isStatic() ? self::TYPE_KEY_STATIC : self::TYPE_KEY_INSTANCE;

            $this->entityInjectMethods[$entityFqn][$typeKey][$method->getName()] =
                $this->getDependencyForInjectMethod($method);
        }
    }
private function buildEntityInjectMethodsForEntity ( EntityInterface $ entity ) : void { $ reflection = $ entity :: getDoctrineStaticMeta ( ) -> getReflectionClass ( ) ; $ entityFqn = $ this -> leadingSlash ( $ reflection -> getName ( ) ) ; if ( array_key_exists ( $ entityFqn , $ this -> entityInjectMethods ) ) { return ; } $ this -> entityInjectMethods [ $ entityFqn ] = [ self :: TYPE_KEY_INSTANCE => [ ] , self :: TYPE_KEY_STATIC => [ ] , ] ; $ methods = $ reflection -> getMethods ( \ ReflectionMethod :: IS_PUBLIC ) ; foreach ( $ methods as $ method ) { if ( ! \ ts \ stringStartsWith ( $ method -> getName ( ) , self :: INJECT_DEPENDENCY_METHOD_PREFIX ) ) { continue ; } $ typeKey = $ method -> isStatic ( ) ? self :: TYPE_KEY_STATIC : self :: TYPE_KEY_INSTANCE ; $ this -> entityInjectMethods [ $ entityFqn ] [ $ typeKey ] [ $ method -> getName ( ) ] = $ this -> getDependencyForInjectMethod ( $ method ) ; } }
Build the array of entity methods to dependencies ready to be used for injection

@param EntityInterface $entity

@throws \ReflectionException
Build the array of entity methods to dependencies ready to be used for injection