Completed
Push — master ( e0017c...6b1304 )
by Tom
14s queued 11s
created

DoctrineModule/Service/CliControllerFactory.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineModule\Service;
6
7
use DoctrineModule\Controller\CliController;
8
use Interop\Container\ContainerInterface;
9
use Interop\Container\Exception\ContainerException;
10
use Laminas\ServiceManager\Exception\ServiceNotCreatedException;
11
use Laminas\ServiceManager\Exception\ServiceNotFoundException;
12
use Laminas\ServiceManager\FactoryInterface;
13
use Laminas\ServiceManager\ServiceLocatorInterface;
14
15
/**
16
 * Factory responsible of instantiating an {@see \DoctrineModule\Controller\CliController}
17
 *
18
 * @link    http://www.doctrine-project.org/
19
 */
20
class CliControllerFactory implements FactoryInterface
0 ignored issues
show
Deprecated Code introduced by
The interface Laminas\ServiceManager\FactoryInterface has been deprecated with message: Use Laminas\ServiceManager\Factory\FactoryInterface instead.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
21
{
22
    /**
23
     * Create an object
24
     *
25
     * {@inheritDoc}
26
     *
27
     * @throws ServiceNotFoundException if unable to resolve the service.
28
     * @throws ServiceNotCreatedException if an exception is raised when creating a service.
29
     * @throws ContainerException if any other error occurs.
30
     */
31
    public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null) : object
32
    {
33
        $application = $container->get('doctrine.cli');
34
35
        return new CliController($application);
36
    }
37
38
    /**
39
     * {@inheritDoc}
40
     *
41
     * @return CliController
42
     */
43
    public function createService(ServiceLocatorInterface $container)
44
    {
45
        return $this($container->getServiceLocator(), CliController::class);
46
    }
47
}
48