Completed
Push — master ( 255f7a...c09052 )
by Lukas Kahwe
9s
created

DoctrineMongoDb::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Liip\MonitorBundle\Check;
4
5
use Doctrine\Bundle\MongoDBBundle\ManagerRegistry;
6
use ZendDiagnostics\Check\AbstractCheck;
7
use ZendDiagnostics\Result\Success;
8
9
class DoctrineMongoDb extends AbstractCheck
10
{
11
    protected $manager;
12
    protected $connectionName;
13
14
    public function __construct(ManagerRegistry $registry, $connectionName = null)
15
    {
16
        $this->manager = $registry;
17
        $this->connectionName = $connectionName;
18
    }
19
20
    public function check()
21
    {
22
        $connection = $this->manager->getConnection();
23
        $connection->connect();
24
25
        return new Success();
26
    }
27
}
28