Passed
Push — master ( 79bf3c...52a24b )
by Alex
01:04 queued 13s
created

getEntityManagerArgvInput()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 9
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arp\LaminasDoctrine\Factory\Service\EntityManager;
6
7
use Symfony\Component\Console\Input\ArgvInput;
8
9
/**
10
 * @author  Alex Patterson <[email protected]>
11
 * @package Arp\LaminasDoctrine\Factory\Service
12
 */
13
trait ObjectManagerArgvInputProviderTrait
14
{
15
    /**
16
     * @var string
17
     */
18
    private string $parameterOption = '--object-manager';
19
20
    /**
21
     * @var string
22
     */
23
    private string $defaultEntityManagerArgvInput = '';
24
25
    /**
26
     * @return string
27
     */
28
    public function getEntityManagerArgvInput(): string
29
    {
30
        $arguments = new ArgvInput();
31
32
        if ($arguments->hasParameterOption($this->parameterOption)) {
33
            return $arguments->getParameterOption($this->parameterOption);
34
        }
35
36
        return $this->defaultEntityManagerArgvInput;
37
    }
38
39
    /**
40
     * @param string $defaultEntityManagerArgvInput
41
     */
42
    public function setDefaultEntityManagerArgvInput(string $defaultEntityManagerArgvInput): void
43
    {
44
        $this->defaultEntityManagerArgvInput = $defaultEntityManagerArgvInput;
45
    }
46
}
47