| Total Complexity | 3 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 8 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | class SourceFile extends ProjectFile |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * The associated page class string. |
||
| 19 | * |
||
| 20 | * @var class-string<\Hyde\Pages\Concerns\HydePage> |
||
|
|
|||
| 21 | */ |
||
| 22 | public readonly string $model; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param class-string<\Hyde\Pages\Concerns\HydePage> $pageClass |
||
| 26 | */ |
||
| 27 | public function __construct(string $path, string $pageClass = HydePage::class) |
||
| 28 | { |
||
| 29 | parent::__construct($path); |
||
| 30 | $this->model = $pageClass; |
||
| 31 | } |
||
| 32 | |||
| 33 | public function toArray(): array |
||
| 34 | { |
||
| 35 | return array_merge(parent::toArray(), [ |
||
| 36 | 'model' => $this->model, |
||
| 37 | ]); |
||
| 38 | } |
||
| 39 | |||
| 40 | public function withoutDirectoryPrefix(): string |
||
| 44 | } |
||
| 45 | } |
||
| 46 |