Completed
Pull Request — master (#471)
by Timothy
15:13
created

CheckConnectionFactory::createService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace DoctrineORMModule\Diagnostics;
4
5
use Doctrine\DBAL\Connection;
6
use Zend\ServiceManager\FactoryInterface;
7
use Zend\ServiceManager\ServiceLocatorInterface;
8
9
class CheckConnectionFactory implements FactoryInterface
10
{
11
    /**
12
     * Create service
13
     *
14
     * @param ServiceLocatorInterface $serviceLocator
15
     * @return CheckConnection
16
     * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
17
     */
18 1
    public function createService(ServiceLocatorInterface $serviceLocator)
19
    {
20
        /** @var Connection $connection */
21 1
        $connection = $serviceLocator->get('doctrine.connection.orm_default');
22
        
23 1
        return new CheckConnection($connection);
24
    }
25
}
26