| Total Complexity | 6 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 70.59% |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class Command |
||
| 16 | { |
||
| 17 | /** @var string */ |
||
| 18 | private $name; |
||
| 19 | /** |
||
| 20 | * @var Module |
||
| 21 | */ |
||
| 22 | private $module; |
||
| 23 | |||
| 24 | 5 | public function __construct(string $name, Module $module) |
|
| 25 | { |
||
| 26 | 5 | $this->name = $name; |
|
| 27 | 5 | $this->module = $module; |
|
| 28 | 5 | } |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $name |
||
| 32 | * @param Module $module |
||
| 33 | * @return Command |
||
| 34 | */ |
||
| 35 | public static function create(string $name, Module $module): Command |
||
| 36 | { |
||
| 37 | $command = new self($name, $module); |
||
| 38 | SymfonyEventAdapter::getInstance()->publish( |
||
| 39 | new CommandWasCreated($command) |
||
| 40 | ); |
||
| 41 | return $command; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return string |
||
| 46 | */ |
||
| 47 | 3 | public function getName(): string |
|
| 48 | { |
||
| 49 | 3 | return $this->name; |
|
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | 1 | public function getDiretorio(): string |
|
| 56 | { |
||
| 57 | 1 | return $this->module->getDiretorio(); |
|
| 58 | } |
||
| 59 | |||
| 60 | 1 | public function getClassNameCommand() |
|
| 63 | } |
||
| 64 | |||
| 65 | 1 | public function getClassNameCommandHandler() |
|
| 68 | } |
||
| 69 | } |