| Total Complexity | 6 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | final class Example implements ExampleInterface |
||
| 12 | { |
||
| 13 | /** @var bool */ |
||
| 14 | private $active = true; |
||
| 15 | |||
| 16 | /** @var NameInterface */ |
||
| 17 | private $name; |
||
| 18 | |||
| 19 | /** @var CodeBlock */ |
||
| 20 | private $code; |
||
| 21 | |||
| 22 | /** @var ExpectationInterface[] */ |
||
| 23 | private $expectations; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param ExpectationInterface[] $expectations |
||
| 27 | */ |
||
| 28 | public function __construct(NameInterface $name, CodeBlock $code, array $expectations = []) |
||
| 29 | { |
||
| 30 | $this->name = $name; |
||
| 31 | $this->code = $code; |
||
| 32 | $this->expectations = $expectations; |
||
| 33 | } |
||
| 34 | |||
| 35 | public function getName(): NameInterface |
||
| 36 | { |
||
| 37 | return $this->name; |
||
| 38 | } |
||
| 39 | |||
| 40 | public function isActive(): bool |
||
| 41 | { |
||
| 42 | return $this->active; |
||
| 43 | } |
||
| 44 | |||
| 45 | public function withActive(bool $active): ExampleInterface |
||
| 46 | { |
||
| 47 | $new = clone $this; |
||
| 48 | $new->active = $active; |
||
| 49 | return $new; |
||
| 50 | } |
||
| 51 | |||
| 52 | public function getCodeBlock(): CodeBlock |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return ExpectationInterface[] |
||
| 59 | */ |
||
| 60 | public function getExpectations(): array |
||
| 63 | } |
||
| 64 | } |
||
| 65 |