src/Container.php
public function addFactory(string $alias, Closure $callback) : void
    {
        $definition = new FactoryDefinition($callback);

        $this->add($alias, $definition);
    }
public function addFactory(string $alias, Closure $callback) : void
    {
        $definition = new FactoryDefinition($callback);

        $this->add($alias, $definition);
    }
Add Factory

Adds a factory definition to the container.

@param string  $alias
@param Closure $callback