Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| Actor | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
| system | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Cosray; |
| 6 | |
| 7 | use ValueError; |
| 8 | |
| 9 | final readonly class Actor |
| 10 | { |
| 11 | public function __construct( |
| 12 | public int $id, |
| 13 | ) { |
| 14 | if ($id < 1) { |
| 15 | throw new ValueError('A content actor id must be positive'); |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | public static function system(): self |
| 20 | { |
| 21 | return new self(1); |
| 22 | } |
| 23 | } |