create array of factories

@return array<*,\Closure>

@access protected
12105
protected function getFactories()
    {
        $escaper = $this->escaper;
        $input   = (new AuraFactory())->newInputInstance();

        $factories = [
            'escape' => function () use ($escaper) {
                return $escaper;
            },
            'input' => function () use ($input) {
                return $input;
            }
        ];

        foreach ($this->helpers as $name => $class) {
            $factories[$name] = function () use ($class, $escaper) {
                return new $class($escaper);
            };
        }

        return $factories;
    }
253432
private function createCacheFactories()
    {
        if (null !== $this->cacheFactories) {
            return $this->cacheFactories;
        }

        // load bundled cache factories
        $tempContainer = new ContainerBuilder();
        $loader = new Loader\XmlFileLoader($tempContainer, new FileLocator(__DIR__.'/../Resources/config'));

        $loader->load('cache_factories.xml');

        $cacheFactories = array();
        foreach ($tempContainer->findTaggedServiceIds('tbbc_cache.cache_factory') as $id => $factories) {
            foreach ($factories as $factory) {
                if (!isset($factory['cache_type'])) {
                    throw new \InvalidArgumentException(sprintf(
                        'Service "%s" must define a "cache_type" attribute for "tbbc_cache.cache_factory" tag',
                        $id
                    ));
                }

                $factoryService = $tempContainer->get($id);
                $cacheFactories[str_replace('-', '_', strtolower($factory['cache_type']))] = $factoryService;
            }
        }

        return $this->cacheFactories = $cacheFactories;
    }
428828
public static function factory($config = array())
    {
        $defaults = array();

        $required = array(
            'base_url',
            'login',
            'password'
        );

        $config = Collection::fromConfig($config, $defaults, $required);

        $client = new self($config['base_url'], $config);

        return $client;
    }
661698
public static function factory()
    {
        if ( self::$factory === false )
        {
            $instance = self::instance();

            $ini = eZINI::instance();
            if (!isset($GLOBALS['eZTemplateDebugInternalsEnabled']) && $ini->variable( 'TemplateSettings', 'Debug' ) == 'enabled' )
                eZTemplate::setIsDebugEnabled( true );

            $instance->setAutoloadPathList(
                array_unique(
                    array_merge(
                        $ini->variable( 'TemplateSettings', 'AutoloadPathList' ),
                        eZExtension::expandedPathList(
                            $ini->variable( 'TemplateSettings', 'ExtensionAutoloadPath' ),
                            'autoloads/'
                        )
                    )
                )
            );
            $instance->autoload();

            $instance->registerResource( eZTemplateDesignResource::instance() );
            self::$factory = true;
        }
        return self::instance();
    }
162174
public function getFunctions()
    {
        $result = [];
        foreach ($this->extension->getFunctions() as $function) {
            $callable = $function->getCallable();
            $name = $function->getName();

            $result[] = new \Twig_SimpleFunction(
                $name,
                function() use ($callable, $name) {
                    return $this->memoizeCache->memoizeById($name, func_get_args(), $callable, $this->lifeTime);
                }
            );
        }

        return $result;
    }
127103
public function createContainer(): Factory
    {
        // First set all the directories
        Core::$appDir = $this->parameters['appDir'];
        Core::$wwwDir = $this->parameters['wwwDir'];
        Core::$tempDir = $this->parameters['tempDir'];
        Core::$logDir = $this->parameters['logDir'];

        // Then set debug mode
        if ($this->parameters['debugMode'])
        {
            define('ENVIRONMENT', 'DEVELOPMENT');
        }
        else
        {
            define('ENVIRONMENT', 'PRODUCTION');
        }

        // And enable Tracy Debugger 
        if (class_exists('Tracy\Debugger', true))
        {
            Debugger::enable(!$this->parameters['debugMode'], realpath($this->parameters['logDir']));
            if (isset($this->parameters['debugEmail']))
            {
                Debugger::$email = $this->parameters['debugEmail'];
            }
            Logger::$useTracy = true;
        }

        // Then load the framework
        Core::init();

        return Factory::getInstance();
    }
832762
public function makeSchema(): array
    {
        return [
            Filter::SH_MAP       => $this->buildMap($this->entity),
            Filter::SH_VALIDATES => $this->entity->getProperty('validates', true) ?? [],
            Filter::SH_SECURED   => $this->entity->getSecured(),
            Filter::SH_FILLABLE  => $this->entity->getFillable(),
            Filter::SH_MUTATORS  => $this->entity->getMutators(),
        ];
    }
570979
protected function getFactory($class) {
		if (isset($this->factories[$class])) {
			return $this->factories[$class];
		}

		$factory = new $class($this);
		$this->factories[$class] = $factory;
		return $factory;
	}
952816
public function produce()
    {
        $cacheFactory = null;
        foreach($this->cacheFactories as $factory)
        {
            if(false === $factory instanceof CacheFactoryInterface) {
                throw new \InvalidArgumentException("Array of Cache Factories must contain valid CacheFactory objects.");
            }
            
            if($this->type == $factory->getType()) {
                $cacheFactory = $factory;
                break;
            }
        }
        
        if(null === $cacheFactory)
        {
            throw ConfigException::cacheFactoryNotFound($this->type);
        }
            
        $cache = $cacheFactory->newInstance($this->app);
        
        if(false === $cache instanceof CacheInterface) {
            throw new \InvalidArgumentException("Cache factory must produce a valid CacheInterface object.");
        }
        
        return $cache;
    }
355947
public function factory($collection)
    {
        if ($collection instanceof Collection) {
            $collectionName = $collection->getName();
        } else {
            $collectionName = $collection;
        }

        if (!isset($this->collections[$collectionName])) {
            if (!($collection instanceof Collection)) {
                $collection = Norm::createCollection(array(
                    'name' => $collection,
                    'connection' => $this,
                ));

                $this->applyHook('norm.after.factory', $collection);
            }

            $this->collections[$collectionName] = $collection;
        }

        return $this->collections[$collectionName];
    }
939812
public function generateClassReflector($factory) {
		$reflector = new ReflectionClass($factory);
		$constructor = $reflector->getConstructor();

		$dependencies = is_null($constructor) ? [] : $constructor->getParameters();

		return [$reflector, $dependencies];
	}
361668
public static function factory($options = array())
    {
        $path = isset($options['path'])? $options['path'] : '_res';
        $defaults = isset($options['defaults'])? $options['defaults'] : array();

        return new self($path, $defaults);
    }
1068154
public function toArray()
    {
        $array = [];

        foreach ($this->items as $key => $value) {
            if ($value instanceof ExportableInterface) {
                $array[$key] = $value->toArray();
            } else {
                $array[$key] = $value;
            }
        }

        return $array;
    }
132221
public static function factory() {
    $className = get_called_class();
    $args = func_get_args();
    $reflector = new \ReflectionClass($className);
    $entity = $reflector->newInstanceArgs($args);
    // Use hook functionality when available.
    if (class_exists('\SciActive\Hook')) {
      \SciActive\Hook::hookObject($entity, $className.'->', false);
    }
    return $entity;
  }
505205
public function getAuthFactory(): ?Factory
    {
        if (!$this->hasAuthFactory()) {
            $this->setAuthFactory($this->getDefaultAuthFactory());
        }
        return $this->authFactory;
    }
109959
public function setFactory(array $factories)
    {
        foreach ($factories as $name => $factory) {
            $this->addFactory($name, $factory);
        }

        return $this;
    }
171172
public function each($data = [], Closure $callback)
    {
        $factory = $this->getFactory();
        $results = array();
        foreach ($data as $item) {
            $callback($factory, $item);
            $results[] = $factory->getResults();
        }

        return $results;
    }