AbstractCommand::getWorkflowService()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
namespace Kaliop\eZWorkflowEngineBundle\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\eZWorkflowEngineBundle\Core\WorkflowServiceFacade
14
     */
15
    private $workflowService;
16
17
    /**
18
     * @return \Kaliop\eZWorkflowEngineBundle\Core\WorkflowServiceFacade
19
     */
20
    public function getWorkflowService()
21
    {
22
        if (!$this->workflowService) {
23
            $this->workflowService = $this->getContainer()->get('ez_workflowengine_bundle.workflow_service');
24
        }
25
26
        return $this->workflowService;
27
    }
28
}
29