Lines
50.00%
1 / 2
Functions and Methods
50.00%
1 / 2
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| GeneratedFile | 50.00% | 1 / 2 | 50.00% | 1 / 2 | 2.50 | 0.00% | 0 / 1 | |||
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| forClass | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Codegen\Output; | |
| 6 | ||
| 7 | final readonly class GeneratedFile | |
| 8 | { | |
| 9 | public function __construct( | |
| 10 | public string $path, | |
| 11 | public string $contents, | |
| 12 | ) {} | |
| 13 | ||
| 14 | public static function forClass(string $shortName, string $contents): self | |
| 15 | { | |
| 16 | return new self($shortName . '.php', $contents); | |
| 17 | } | |
| 18 | } |