| Total Complexity | 7 | 
| Total Lines | 54 | 
| Duplicated Lines | 0 % | 
| Coverage | 100% | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 11 | final class Argument  | 
            ||
| 12 | { | 
            ||
| 13 | private $definition;  | 
            ||
| 14 | |||
| 15 | 9 | public function __construct(Definition $argument)  | 
            |
| 18 | 9 | }  | 
            |
| 19 | |||
| 20 | 8 | public function __toString(): string  | 
            |
| 21 |     { | 
            ||
| 22 | 8 | $method = new MethodName($this->definition->name());  | 
            |
| 23 | $code = <<<PHP  | 
            ||
| 24 | 8 | public function $method()  | 
            |
| 25 |     { | 
            ||
| 26 | 8 |         if (\$this->arguments->contains('{$this->definition->name()}')) { | 
            |
| 27 | 8 |             return \$this->arguments->get('{$this->definition->name()}'); | 
            |
| 28 | }  | 
            ||
| 29 | |||
| 30 | 8 |         {$this->buildDefault()} | 
            |
| 31 | 8 |         {$this->buildOptional()} | 
            |
| 32 | }  | 
            ||
| 33 | PHP;  | 
            ||
| 34 | |||
| 35 | 8 | return $code;  | 
            |
| 36 | }  | 
            ||
| 37 | |||
| 38 | 8 | private function buildDefault(): string  | 
            |
| 47 | );  | 
            ||
| 48 | }  | 
            ||
| 49 | |||
| 50 | 8 | private function buildOptional(): string  | 
            |
| 65 | }  | 
            ||
| 66 | }  | 
            ||
| 67 |