original_string: protected function createServiceFactory(
          $requestedName, ReflectionClass $reflection, ContainerInterface $container
      ) {
          /** @var array $mappings */
          $mappings = $this->getServiceMapping($container, $requestedName);
  
          if ($reflection->implementsInterface(Factory\FactoryInterface::class)) {
              $factory = $reflection->newInstance($mappings['namespace'], $mappings['service'], $this->namespace);
          } else {
              $factory = $reflection->newInstance();
          }
  
          $this->lookupCache[$requestedName]['factoryInstance'] = $factory;
  
          if ($factory instanceof Factory\FactoryInterface) {
              /** @var Factory\FactoryInterface $factory */
              $factory->setContainer($container);
          }
  
          return $factory($container, $requestedName);
      }
code: protected function createServiceFactory(
          $requestedName, ReflectionClass $reflection, ContainerInterface $container
      ) {
          /** @var array $mappings */
          $mappings = $this->getServiceMapping($container, $requestedName);
  
          if ($reflection->implementsInterface(Factory\FactoryInterface::class)) {
              $factory = $reflection->newInstance($mappings['namespace'], $mappings['service'], $this->namespace);
          } else {
              $factory = $reflection->newInstance();
          }
  
          $this->lookupCache[$requestedName]['factoryInstance'] = $factory;
  
          if ($factory instanceof Factory\FactoryInterface) {
              /** @var Factory\FactoryInterface $factory */
              $factory->setContainer($container);
          }
  
          return $factory($container, $requestedName);
      }
code_tokens: protected function createServiceFactory ( $ requestedName , ReflectionClass $ reflection , ContainerInterface $ container ) { /** @var array $mappings */ $ mappings = $ this -> getServiceMapping ( $ container , $ requestedName ) ; if ( $ reflection -> implementsInterface ( Factory \ FactoryInterface :: class ) ) { $ factory = $ reflection -> newInstance ( $ mappings [ 'namespace' ] , $ mappings [ 'service' ] , $ this -> namespace ) ; } else { $ factory = $ reflection -> newInstance ( ) ; } $ this -> lookupCache [ $ requestedName ] [ 'factoryInstance' ] = $ factory ; if ( $ factory instanceof Factory \ FactoryInterface ) { /** @var Factory\FactoryInterface $factory */ $ factory -> setContainer ( $ container ) ; } return $ factory ( $ container , $ requestedName ) ; }
docstring: Initiate service factory from the ReflectionClass.
  
  @param string             $requestedName
  @param ReflectionClass    $reflection
  @param ContainerInterface $container
  
  @return mixed
  @throws \ReflectionException
  @throws \Psr\Container\ContainerExceptionInterface
  @throws \Psr\Container\NotFoundExceptionInterface
  @throws \Xloit\Std\Exception\RuntimeException
docstring_tokens: Initiate service factory from the ReflectionClass .