Completed
Push — master ( dcca99...06202c )
by Tom
03:20 queued 01:33
created

DoctrineORMModule/Service/ObjectRadioFactory.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
namespace DoctrineORMModule\Service;
4
5
use Doctrine\ORM\EntityManager;
6
use DoctrineModule\Form\Element\ObjectRadio;
7
use Interop\Container\ContainerInterface;
8
use Zend\ServiceManager\ServiceLocatorInterface;
9
use Zend\ServiceManager\FactoryInterface;
10
11
/**
12
 * Factory for {@see ObjectRadio}
13
 *
14
 * @license MIT
15
 * @link    http://www.doctrine-project.org/
16
 * @author  Daniel Gimenes <[email protected]>
17
 */
18
class ObjectRadioFactory implements FactoryInterface
0 ignored issues
show
Deprecated Code introduced by
The interface Zend\ServiceManager\FactoryInterface has been deprecated with message: Use Zend\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...
19
{
20
    /**
21
     * {@inheritDoc}
22
     *
23
     * @return ObjectRadio
24
     */
25
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
26
    {
27
        $entityManager = $container->get(EntityManager::class);
28
        $element       = new ObjectRadio;
29
30
        $element->getProxy()->setObjectManager($entityManager);
31
32
        return $element;
33
    }
34
35
    /**
36
     * {@inheritDoc}
37
     */
38
    public function createService(ServiceLocatorInterface $container)
39
    {
40
        return $this($container->getServiceLocator(), ObjectRadio::class);
41
    }
42
}
43