| Conditions | 2 |
| Paths | 2 |
| Total Lines | 25 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 16 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 4 | public function make(): GenerateableInterface |
|
| 22 | { |
||
| 23 | 4 | $moduleName = $this->getModuleName(); |
|
| 24 | 4 | $className = $this->getClassName(); |
|
| 25 | 4 | $type = str_replace('Handler', '', $className); |
|
| 26 | 4 | $parameter = lcfirst($type); |
|
| 27 | |||
| 28 | 4 | if (!$className) { |
|
| 29 | 1 | throw new ClassNameIsNullException('Não foi informado a nome para a Command. Utilize o método setClassName para innforma o nome da classe!'); |
|
| 30 | } |
||
| 31 | |||
| 32 | $this |
||
| 33 | 3 | ->setQualifiedName("Saci\\{$moduleName}\\UseCase\\{$className}") |
|
| 34 | 3 | ->setMethod( |
|
| 35 | 3 | PhpMethod::create('__construct') |
|
| 36 | ) |
||
| 37 | 3 | ->setMethod( |
|
| 38 | 3 | PhpMethod::create('handle') |
|
| 39 | 3 | ->addParameter( |
|
| 40 | 3 | PhpParameter::create($parameter) |
|
| 41 | 3 | ->setType($type) |
|
| 42 | ) |
||
| 43 | ); |
||
| 44 | |||
| 45 | 3 | return $this; |
|
| 46 | } |
||
| 47 | } |