| Conditions | 2 |
| Paths | 2 |
| Total Lines | 28 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 5 | public function __construct(PhpClassProperty $property, $fluent = true) |
|
| 18 | { |
||
| 19 | 5 | $name = $property->getNamedVar()->getName(); |
|
| 20 | 5 | parent::__construct( |
|
| 21 | 5 | 'set' . ucfirst($name), |
|
| 22 | 5 | PhpFlags::VIS_PUBLIC |
|
| 23 | ); |
||
| 24 | |||
| 25 | 5 | $this->skipCodeCoverage = true; |
|
| 26 | $this->outputArgumentsWithDefaults = false; |
||
| 27 | 5 | ||
| 28 | $this->addArgument($property->getNamedVar()); |
||
| 29 | |||
| 30 | 5 | $body = <<<PHP |
|
| 31 | \$this->{$name} = \${$name}; |
||
| 32 | |||
| 33 | PHP; |
||
| 34 | 5 | ||
| 35 | 5 | if ($fluent) { |
|
| 36 | $this->setResult(PhpDocType::thisType()); |
||
| 37 | 5 | $body .= <<<PHP |
|
| 38 | return \$this; |
||
| 39 | |||
| 40 | PHP; |
||
| 41 | |||
| 42 | } |
||
| 43 | 5 | ||
| 44 | $this->setBody($body); |
||
| 45 | 5 | ||
| 47 | } |