100.00% covered (success)
@@ -103,7 +103,7 @@
- path |
+ path |
100.00% covered (success)
@@ -125,7 +125,7 @@
|
- get |
+ get |
100.00% covered (success)
@@ -147,7 +147,7 @@
|
- markdown |
+ markdown |
100.00% covered (success)
@@ -169,7 +169,7 @@
|
- blade |
+ blade |
100.00% covered (success)
@@ -190,28 +190,6 @@
|
|
-
- needsDirectory |
-
-
- 100.00% covered (success)
-
-
- |
- 100.00% |
- 2 / 2 |
-
-
- 100.00% covered (success)
-
-
- |
- 100.00% |
- 1 / 1 |
- 2 |
- |
-
-
@@ -227,11 +205,11 @@
7 | use Hyde\Hyde; |
8 | use Hyde\Markdown\Models\Markdown; |
9 | use Illuminate\Support\Facades\Blade; |
-
10 | |
-
11 | use function basename; |
-
12 | use function file_exists; |
-
13 | use function file_get_contents; |
-
14 | use function mkdir; |
+
10 | use Hyde\Framework\Concerns\InteractsWithDirectories; |
+
11 | |
+
12 | use function basename; |
+
13 | use function file_exists; |
+
14 | use function file_get_contents; |
15 | |
16 | |
17 | |
@@ -240,87 +218,82 @@
20 | |
21 | class Includes |
22 | { |
-
23 | |
-
24 | |
-
25 | |
-
26 | protected static string $includesDirectory = 'resources/includes'; |
-
27 | |
-
28 | |
-
29 | |
-
30 | |
-
31 | |
-
32 | |
-
33 | |
-
34 | public static function path(?string $filename = null): string |
-
35 | { |
-
36 | static::needsDirectory(static::$includesDirectory); |
-
37 | |
-
38 | return $filename === null |
-
39 | ? Hyde::path(static::$includesDirectory) |
-
40 | : Hyde::path(static::$includesDirectory.'/'.$filename); |
-
41 | } |
-
42 | |
-
43 | |
-
44 | |
-
45 | |
-
46 | |
-
47 | |
-
48 | |
-
49 | |
-
50 | public static function get(string $filename, ?string $default = null): ?string |
-
51 | { |
-
52 | $path = static::path($filename); |
-
53 | |
-
54 | if (! file_exists($path)) { |
-
55 | return $default; |
-
56 | } |
-
57 | |
-
58 | return file_get_contents($path); |
-
59 | } |
-
60 | |
-
61 | |
-
62 | |
-
63 | |
-
64 | |
-
65 | |
-
66 | |
-
67 | |
-
68 | public static function markdown(string $filename, ?string $default = null): ?string |
-
69 | { |
-
70 | $path = static::path(basename($filename, '.md').'.md'); |
-
71 | |
-
72 | if (! file_exists($path)) { |
-
73 | return $default === null ? null : Markdown::render($default); |
-
74 | } |
-
75 | |
-
76 | return Markdown::render(file_get_contents($path)); |
-
77 | } |
-
78 | |
-
79 | |
-
80 | |
-
81 | |
-
82 | |
-
83 | |
-
84 | |
-
85 | |
-
86 | public static function blade(string $filename, ?string $default = null): ?string |
-
87 | { |
-
88 | $path = static::path(basename($filename, '.blade.php').'.blade.php'); |
-
89 | |
-
90 | if (! file_exists($path)) { |
-
91 | return $default === null ? null : Blade::render($default); |
-
92 | } |
-
93 | |
-
94 | return Blade::render(file_get_contents($path)); |
-
95 | } |
-
96 | |
-
97 | protected static function needsDirectory(string $directory): void |
-
98 | { |
-
99 | if (! file_exists($directory)) { |
-
100 | mkdir($directory, recursive: true); |
-
101 | } |
-
102 | } |
-
103 | } |
+
23 | use InteractsWithDirectories; |
+
24 | |
+
25 | |
+
26 | |
+
27 | |
+
28 | protected static string $includesDirectory = 'resources/includes'; |
+
29 | |
+
30 | |
+
31 | |
+
32 | |
+
33 | |
+
34 | |
+
35 | |
+
36 | public static function path(?string $filename = null): string |
+
37 | { |
+
38 | static::needsDirectory(static::$includesDirectory); |
+
39 | |
+
40 | return $filename === null |
+
41 | ? Hyde::path(static::$includesDirectory) |
+
42 | : Hyde::path(static::$includesDirectory.'/'.$filename); |
+
43 | } |
+
44 | |
+
45 | |
+
46 | |
+
47 | |
+
48 | |
+
49 | |
+
50 | |
+
51 | |
+
52 | public static function get(string $filename, ?string $default = null): ?string |
+
53 | { |
+
54 | $path = static::path($filename); |
+
55 | |
+
56 | if (! file_exists($path)) { |
+
57 | return $default; |
+
58 | } |
+
59 | |
+
60 | return file_get_contents($path); |
+
61 | } |
+
62 | |
+
63 | |
+
64 | |
+
65 | |
+
66 | |
+
67 | |
+
68 | |
+
69 | |
+
70 | public static function markdown(string $filename, ?string $default = null): ?string |
+
71 | { |
+
72 | $path = static::path(basename($filename, '.md').'.md'); |
+
73 | |
+
74 | if (! file_exists($path)) { |
+
75 | return $default === null ? null : Markdown::render($default); |
+
76 | } |
+
77 | |
+
78 | return Markdown::render(file_get_contents($path)); |
+
79 | } |
+
80 | |
+
81 | |
+
82 | |
+
83 | |
+
84 | |
+
85 | |
+
86 | |
+
87 | |
+
88 | public static function blade(string $filename, ?string $default = null): ?string |
+
89 | { |
+
90 | $path = static::path(basename($filename, '.blade.php').'.blade.php'); |
+
91 | |
+
92 | if (! file_exists($path)) { |
+
93 | return $default === null ? null : Blade::render($default); |
+
94 | } |
+
95 | |
+
96 | return Blade::render(file_get_contents($path)); |
+
97 | } |
+
98 | } |
@@ -331,7 +304,7 @@
Legend
Covered by small (and larger) testsCovered by medium (and large) testsCovered by large tests (and tests of unknown size)Not coveredNot coverable
- Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 14:23:29 UTC 2024.
+ Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 15:20:42 UTC 2024.
diff --git a/master/coverage/framework/src/Support/Models/DateString.php.html b/master/coverage/framework/src/Support/Models/DateString.php.html
index a248f42c6cd..1b04ddfa773 100644
--- a/master/coverage/framework/src/Support/Models/DateString.php.html
+++ b/master/coverage/framework/src/Support/Models/DateString.php.html
@@ -212,7 +212,7 @@
Legend
Covered by small (and larger) testsCovered by medium (and large) testsCovered by large tests (and tests of unknown size)Not coveredNot coverable
- Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 14:23:29 UTC 2024.
+ Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 15:20:42 UTC 2024.
diff --git a/master/coverage/framework/src/Support/Models/Redirect.php.html b/master/coverage/framework/src/Support/Models/Redirect.php.html
index c88999d86e9..50afca47813 100644
--- a/master/coverage/framework/src/Support/Models/Redirect.php.html
+++ b/master/coverage/framework/src/Support/Models/Redirect.php.html
@@ -312,7 +312,7 @@
Legend
Covered by small (and larger) testsCovered by medium (and large) testsCovered by large tests (and tests of unknown size)Not coveredNot coverable
- Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 14:23:29 UTC 2024.
+ Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 15:20:42 UTC 2024.
diff --git a/master/coverage/framework/src/Support/Models/RenderData.php.html b/master/coverage/framework/src/Support/Models/RenderData.php.html
index 5c69cd2bac8..f1b9b140a17 100644
--- a/master/coverage/framework/src/Support/Models/RenderData.php.html
+++ b/master/coverage/framework/src/Support/Models/RenderData.php.html
@@ -379,7 +379,7 @@
Legend
Covered by small (and larger) testsCovered by medium (and large) testsCovered by large tests (and tests of unknown size)Not coveredNot coverable
- Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 14:23:29 UTC 2024.
+ Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 15:20:42 UTC 2024.
diff --git a/master/coverage/framework/src/Support/Models/Route.php.html b/master/coverage/framework/src/Support/Models/Route.php.html
index aeb39728b51..2cc757ae393 100644
--- a/master/coverage/framework/src/Support/Models/Route.php.html
+++ b/master/coverage/framework/src/Support/Models/Route.php.html
@@ -467,7 +467,7 @@
Legend
Covered by small (and larger) testsCovered by medium (and large) testsCovered by large tests (and tests of unknown size)Not coveredNot coverable
- Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 14:23:29 UTC 2024.
+ Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 15:20:42 UTC 2024.
diff --git a/master/coverage/framework/src/Support/Models/RouteKey.php.html b/master/coverage/framework/src/Support/Models/RouteKey.php.html
index e0eccada946..7b9d3bdd1e8 100644
--- a/master/coverage/framework/src/Support/Models/RouteKey.php.html
+++ b/master/coverage/framework/src/Support/Models/RouteKey.php.html
@@ -281,7 +281,7 @@
Legend
Covered by small (and larger) testsCovered by medium (and large) testsCovered by large tests (and tests of unknown size)Not coveredNot coverable
- Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 14:23:29 UTC 2024.
+ Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 15:20:42 UTC 2024.
diff --git a/master/coverage/framework/src/Support/Models/RouteList.php.html b/master/coverage/framework/src/Support/Models/RouteList.php.html
index c86986a7a68..b8918ac8703 100644
--- a/master/coverage/framework/src/Support/Models/RouteList.php.html
+++ b/master/coverage/framework/src/Support/Models/RouteList.php.html
@@ -283,7 +283,7 @@
Legend
Covered by small (and larger) testsCovered by medium (and large) testsCovered by large tests (and tests of unknown size)Not coveredNot coverable
- Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 14:23:29 UTC 2024.
+ Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 15:20:42 UTC 2024.
diff --git a/master/coverage/framework/src/Support/Models/RouteListItem.php.html b/master/coverage/framework/src/Support/Models/RouteListItem.php.html
index a13afbea916..b7927d2e830 100644
--- a/master/coverage/framework/src/Support/Models/RouteListItem.php.html
+++ b/master/coverage/framework/src/Support/Models/RouteListItem.php.html
@@ -335,7 +335,7 @@
Legend
Covered by small (and larger) testsCovered by medium (and large) testsCovered by large tests (and tests of unknown size)Not coveredNot coverable
- Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 14:23:29 UTC 2024.
+ Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 15:20:42 UTC 2024.
diff --git a/master/coverage/framework/src/Support/Models/ValidationResult.php.html b/master/coverage/framework/src/Support/Models/ValidationResult.php.html
index 740f4efc3d6..b006cf444a2 100644
--- a/master/coverage/framework/src/Support/Models/ValidationResult.php.html
+++ b/master/coverage/framework/src/Support/Models/ValidationResult.php.html
@@ -678,7 +678,7 @@
Legend
Covered by small (and larger) testsCovered by medium (and large) testsCovered by large tests (and tests of unknown size)Not coveredNot coverable
- Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 14:23:29 UTC 2024.
+ Generated by php-code-coverage 10.1.7 using PHP 8.1.27 and PHPUnit 10.4.2 at Mon Feb 12 15:20:42 UTC 2024.
diff --git a/master/coverage/framework/src/Support/Models/dashboard.html b/master/coverage/framework/src/Support/Models/dashboard.html
index 0cb862f925c..879a8c67f6c 100644
--- a/master/coverage/framework/src/Support/Models/dashboard.html
+++ b/master/coverage/framework/src/Support/Models/dashboard.html
@@ -139,7 +139,7 @@ Project Risks
diff --git a/master/coverage/framework/src/Support/Models/index.html b/master/coverage/framework/src/Support/Models/index.html
index a9c84be1317..356788d7555 100644
--- a/master/coverage/framework/src/Support/Models/index.html
+++ b/master/coverage/framework/src/Support/Models/index.html
@@ -310,7 +310,7 @@