Completed
Push — feature/service-wrapper-for-sw... ( 555800...5fd474 )
by Samuel
09:29
created

DocumentManager   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 31
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 4 1
A getDocumentManager() 0 4 1
1
<?php
2
/**
3
 * helper to access document manager in commands
4
 */
5
6
namespace Graviton\MigrationBundle\Command\Helper;
7
8
use Symfony\Component\Console\Helper\HelperInterface;
9
use Symfony\Component\Console\Helper\Helper;
10
use Doctrine\ODM\MongoDB\DocumentManager as DoctrineDocumentManager;
11
12
/**
13
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
14
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
15
 * @link     http://swisscom.ch
16
 */
17
class DocumentManager extends Helper implements HelperInterface
18
{
19
    /**
20
     * @var DoctrineDocumentManager
21
     */
22
    private $documentManager;
23
24
    /**
25
     * @param DoctrineDocumentManager $documentManager document manager for console apps
26
     */
27
    public function __construct(DoctrineDocumentManager $documentManager)
28
    {
29
        $this->documentManager = $documentManager;
30
    }
31
32
    /**
33
     * @return string
34
     */
35
    public function getName()
36
    {
37
        return 'dm';
38
    }
39
40
    /**
41
     * @return DoctrineDocumentManager
42
     */
43
    public function getDocumentManager()
44
    {
45
        return $this->documentManager;
46
    }
47
}
48