src/Container.php
public function bindFactory(string $name, $factory) 
    {
        $this->setServiceResolverType($name, static::RESOLVE_FACTORY);
        $this->resolverFactories[$name] = $factory;
    }
public function bindFactory(string $name, $factory) 
    {
        $this->setServiceResolverType($name, static::RESOLVE_FACTORY);
        $this->resolverFactories[$name] = $factory;
    }
Binds an unshared factory instance to the service container.

@param string                            $name The service name.
@param ServiceFactoryInterface|Closure   $factory The service factory instance or closure.
@return void