setDefaultEntityManagerArgvInput()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
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
trait ObjectManagerArgvInputProviderTrait
10
{
11
    private string $parameterOption = '--object-manager';
12
13
    private string $defaultEntityManagerArgvInput = 'orm_default';
14
15
    public function getEntityManagerArgvInput(): string
16
    {
17
        $arguments = new ArgvInput();
18
19
        if ($arguments->hasParameterOption($this->parameterOption)) {
20
            return $arguments->getParameterOption($this->parameterOption);
21
        }
22
23
        return $this->defaultEntityManagerArgvInput;
24
    }
25
26
    public function setDefaultEntityManagerArgvInput(string $defaultEntityManagerArgvInput): void
27
    {
28
        $this->defaultEntityManagerArgvInput = $defaultEntityManagerArgvInput;
29
    }
30
}
31