|
3 | 3 | namespace Hyde\Framework;
|
4 | 4 |
|
5 | 5 | use Composer\InstalledVersions;
|
| 6 | +use Hyde\Framework\Concerns\JsonSerializesArrayable; |
6 | 7 | use Hyde\Framework\Contracts\HydeKernelContract;
|
7 | 8 | use Hyde\Framework\Contracts\RouteContract;
|
8 | 9 | use Hyde\Framework\Foundation\Filesystem;
|
9 | 10 | use Hyde\Framework\Foundation\Hyperlinks;
|
10 | 11 | use Hyde\Framework\Helpers\Features;
|
| 12 | +use Illuminate\Contracts\Support\Arrayable; |
11 | 13 | use Illuminate\Support\Facades\View;
|
12 | 14 | use Illuminate\Support\Str;
|
13 | 15 | use Illuminate\Support\Traits\Macroable;
|
|
23 | 25 | *
|
24 | 26 | * @link https://hydephp.com/
|
25 | 27 | */
|
26 |
| -class HydeKernel implements HydeKernelContract |
| 28 | +class HydeKernel implements HydeKernelContract, Arrayable, \JsonSerializable |
27 | 29 | {
|
28 | 30 | use Macroable;
|
| 31 | + use JsonSerializesArrayable; |
29 | 32 |
|
30 | 33 | protected string $basePath;
|
31 | 34 | protected Filesystem $filesystem;
|
@@ -207,4 +210,15 @@ public function pathToRelative(string $path): string
|
207 | 210 | {
|
208 | 211 | return $this->filesystem->pathToRelative($path);
|
209 | 212 | }
|
| 213 | + |
| 214 | + /** @inheritDoc */ |
| 215 | + public function toArray() |
| 216 | + { |
| 217 | + return [ |
| 218 | + 'basePath' => $this->basePath, |
| 219 | + 'features' => $this->features(), |
| 220 | + 'pages' => $this->pages(), |
| 221 | + 'routes' => $this->routes(), |
| 222 | + ]; |
| 223 | + } |
210 | 224 | }
|
0 commit comments