| Total Complexity | 2 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | trait UnaryOpFactoryTrait |
||
| 12 | { |
||
| 13 | /** @var class-string<C> */ |
||
|
|
|||
| 14 | protected string $class; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param class-string<C> $class |
||
| 18 | */ |
||
| 19 | public function __construct(string $class) |
||
| 20 | { |
||
| 21 | $this->class = $class; |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param T $child |
||
| 26 | * @return C |
||
| 27 | */ |
||
| 28 | public function create($child) { return new $this->class($child); } |
||
| 29 | } |
||
| 30 |