Completed
Push — master ( 1ee05e...99144a )
by Gaetano
05:13
created

AbstractCommand::getMigrationService()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
ccs 3
cts 4
cp 0.75
rs 10
cc 2
nc 2
nop 0
crap 2.0625
1
<?php
2
3
namespace Kaliop\eZMigrationBundle\Command;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
7
/**
8
 * Base command class that all migration commands extend from.
9
 */
10
abstract class AbstractCommand extends ContainerAwareCommand
11
{
12
    /**
13
     * @var \Kaliop\eZMigrationBundle\Core\MigrationService
14
     */
15
    private $migrationService;
16
17
    /**
18
     * @return \Kaliop\eZMigrationBundle\Core\MigrationService
19
     */
20 76
    public function getMigrationService()
21
    {
22 76
        if (!$this->migrationService) {
23 76
            $this->migrationService = $this->getContainer()->get('ez_migration_bundle.migration_service');
24
        }
25
26
        return $this->migrationService;
27
    }
28
}
29