DocumentManagerHelper::getDocumentManager()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\ODM\MongoDB\Tools\Console\Helper;
6
7
use Doctrine\ODM\MongoDB\DocumentManager;
8
use Symfony\Component\Console\Helper\Helper;
9
10
/**
11
 * Symfony console component helper for accessing a DocumentManager instance.
12
 */
13
class DocumentManagerHelper extends Helper
14
{
15
    /** @var DocumentManager */
16
    protected $dm;
17
18
    public function __construct(DocumentManager $dm)
19
    {
20
        $this->dm = $dm;
21
    }
22
23
    public function getDocumentManager() : DocumentManager
24
    {
25
        return $this->dm;
26
    }
27
28
    /**
29
     * Get the canonical name of this helper.
30
     *
31
     * @see \Symfony\Component\Console\Helper\HelperInterface::getName()
32
     */
33
    public function getName() : string
34
    {
35
        return 'documentManager';
36
    }
37
}
38