ExecutorAwareTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getExecutor() 0 8 2
A setExecutor() 0 6 1
1
<?php
2
/**
3
 * @link    https://github.com/nnx-framework/doctrine-fixture-module
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace Nnx\DoctrineFixtureModule\Executor;
7
8
/**
9
 * Class ExecutorAwareTrait
10
 *
11
 * @package Nnx\DoctrineFixtureModule\Executor
12
 */
13
trait ExecutorAwareTrait
14
{
15
    /**
16
     * Executor для фикстур
17
     *
18
     * @var ExecutorInterface
19
     */
20
    protected $executor;
21
22
    /**
23
     * @inheritdoc
24
     *
25
     * @return ExecutorInterface
26
     *
27
     * @throws Exception\RuntimeException
28
     */
29
    public function getExecutor()
30
    {
31
        if (null === $this->executor) {
32
            $errMsg = 'Fixture executor not found';
33
            throw new Exception\RuntimeException($errMsg);
34
        }
35
        return $this->executor;
36
    }
37
38
    /**
39
     * @inheritdoc
40
     *
41
     * @param ExecutorInterface $executor
42
     *
43
     * @return $this
44
     */
45
    public function setExecutor(ExecutorInterface $executor)
46
    {
47
        $this->executor = $executor;
48
49
        return $this;
50
    }
51
}
52