ObjectManagerArgvInputProviderTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 20
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getEntityManagerArgvInput() 0 9 2
A setDefaultEntityManagerArgvInput() 0 3 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