Completed
Pull Request — master (#4)
by Timothy
14:57
created

CheckOrmInfoFactory::createService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 11
Ratio 100 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 11
loc 11
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 5
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Abacaphiliac\DoctrineORMDiagnosticsModule\CheckOrm;
4
5
use Abacaphiliac\DoctrineORMDiagnosticsModule\CheckCommand;
6
use Doctrine\ORM\Tools\Console\Command\InfoCommand;
7
use DoctrineModule\Component\Console\Input\RequestInput;
8
use DoctrineModule\Component\Console\Output\PropertyOutput;
9
use Zend\Console\Request;
10
use Zend\ServiceManager\FactoryInterface;
11
use Zend\ServiceManager\ServiceLocatorInterface;
12
13 View Code Duplication
class CheckOrmInfoFactory implements FactoryInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
{
15
    /**
16
     * Create service
17
     *
18
     * @param ServiceLocatorInterface $serviceLocator
19
     * @return CheckCommand
20
     * @throws \Zend\Console\Exception\RuntimeException
21
     * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
22
     */
23 1
    public function createService(ServiceLocatorInterface $serviceLocator)
24
    {
25
        /** @var InfoCommand $command */
26 1
        $command = $serviceLocator->get('doctrine.orm_cmd.info');
27
28 1
        $input = new RequestInput(new Request(array()));
29
30 1
        $output = new PropertyOutput();
31
32 1
        return new CheckCommand($command, $input, $output);
33
    }
34
}
35