Passed
Push — master ( 2bb448...1a2e13 )
by Caen
03:13
created
packages/framework/src/Framework/Factories/NavigationDataFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         return $this->isInstanceOf(MarkdownPost::class)
95 95
             || $this->searchForHiddenInFrontMatter()
96 96
             || in_array($this->routeKey, Config::getArray('hyde.navigation.exclude', ['404']))
97
-            || ! $this->isInstanceOf(DocumentationPage::class) && $this->pageIsInSubdirectory() && ($this->getSubdirectoryConfiguration() === 'hidden');
97
+            || !$this->isInstanceOf(DocumentationPage::class) && $this->pageIsInSubdirectory() && ($this->getSubdirectoryConfiguration() === 'hidden');
98 98
     }
99 99
 
100 100
     protected function makePriority(): int
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 
196 196
     protected function invert(?bool $value): ?bool
197 197
     {
198
-        return $value === null ? null : ! $value;
198
+        return $value === null ? null : !$value;
199 199
     }
200 200
 
201 201
     protected function offset(?int $value, int $offset): ?int
Please login to merge, or discard this patch.
packages/realtime-compiler/tests/RealtimeCompilerTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@  discard block
 block discarded – undo
11 11
 
12 12
 define('BASE_PATH', realpath(__DIR__.'/../../../'));
13 13
 
14
-if (BASE_PATH === false || ! file_exists(BASE_PATH.'/hyde')) {
14
+if (BASE_PATH === false || !file_exists(BASE_PATH.'/hyde')) {
15 15
     throw new InvalidArgumentException('This test suite must be run from the root of the hydephp/develop monorepo.');
16 16
 }
17 17
 
18 18
 ob_start();
19 19
 
20
-test('handle routes index page', function () {
20
+test('handle routes index page', function() {
21 21
     putenv('SERVER_DASHBOARD=false');
22 22
     mockRoute('');
23 23
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     Filesystem::unlink('_site/index.html');
37 37
 });
38 38
 
39
-test('handle routes custom pages', function () {
39
+test('handle routes custom pages', function() {
40 40
     mockRoute('foo');
41 41
 
42 42
     Filesystem::put('_pages/foo.md', '# Hello World!');
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     Filesystem::unlink('_site/foo.html');
55 55
 });
56 56
 
57
-test('handle routes pages with .html extension', function () {
57
+test('handle routes pages with .html extension', function() {
58 58
     mockRoute('foo.html');
59 59
 
60 60
     Filesystem::put('_pages/foo.md', '# Hello World!');
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     Filesystem::unlink('_site/foo.html');
73 73
 });
74 74
 
75
-test('handle routes static assets', function () {
75
+test('handle routes static assets', function() {
76 76
     mockRoute('media/app.css');
77 77
 
78 78
     $kernel = new HttpKernel();
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
     expect($response->body)->toContain('/*! HydeFront v2.0.0');
86 86
 });
87 87
 
88
-test('handle throws route not found exception for missing route', function () {
88
+test('handle throws route not found exception for missing route', function() {
89 89
     mockRoute('missing');
90 90
 
91 91
     $kernel = new HttpKernel();
92 92
     $kernel->handle(new Request());
93 93
 })->throws(RouteNotFoundException::class, "Route not found: 'missing'");
94 94
 
95
-test('handle sends 404 error response for missing asset', function () {
95
+test('handle sends 404 error response for missing asset', function() {
96 96
     mockRoute('missing.css');
97 97
 
98 98
     $kernel = new HttpKernel();
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 //    Filesystem::unlink('_site/foo.html');
124 124
 //})->skip('Underlying framework does not buffer headers (yet)');
125 125
 
126
-test('trailing slashes are normalized from route', function () {
126
+test('trailing slashes are normalized from route', function() {
127 127
     mockRoute('foo/');
128 128
 
129 129
     Filesystem::put('_pages/foo.md', '# Hello World!');
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     Filesystem::unlink('_site/foo.html');
142 142
 });
143 143
 
144
-test('docs uri path is rerouted to docs/index', function () {
144
+test('docs uri path is rerouted to docs/index', function() {
145 145
     mockRoute('docs');
146 146
 
147 147
     Filesystem::put('_docs/index.md', '# Hello World!');
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     Filesystem::unlink('_site/docs/index.html');
160 160
 });
161 161
 
162
-test('docs/search renders search page', function () {
162
+test('docs/search renders search page', function() {
163 163
     mockRoute('docs/search');
164 164
 
165 165
     $kernel = new HttpKernel();
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
     Filesystem::unlink('_site/docs/search.html');
175 175
 });
176 176
 
177
-test('ping route returns ping response', function () {
177
+test('ping route returns ping response', function() {
178 178
     mockRoute('ping');
179 179
 
180 180
     $kernel = new HttpKernel();
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         ->and($response->statusMessage)->toBe('OK');
186 186
 });
187 187
 
188
-test('exception handling', function () {
188
+test('exception handling', function() {
189 189
     $exception = new Exception('foo');
190 190
     $response = ExceptionHandler::handle($exception);
191 191
 
Please login to merge, or discard this patch.
framework/src/Framework/Features/Navigation/DocumentationSidebar.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     /** @return $this */
20 20
     public function generate(): static
21 21
     {
22
-        Routes::getRoutes(DocumentationPage::class)->each(function (Route $route): void {
22
+        Routes::getRoutes(DocumentationPage::class)->each(function(Route $route): void {
23 23
             $this->items->put($route->getRouteKey(), NavItem::fromRoute($route));
24 24
         });
25 25
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     /** @return array<string> */
35 35
     public function getGroups(): array
36 36
     {
37
-        return $this->items->map(function (NavItem $item): string {
37
+        return $this->items->map(function(NavItem $item): string {
38 38
             return $item->getGroup();
39 39
         })->unique()->toArray();
40 40
     }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     /** @return Collection<\Hyde\Framework\Features\Navigation\NavItem> */
43 43
     public function getItemsInGroup(?string $group): Collection
44 44
     {
45
-        return $this->items->filter(function (NavItem $item) use ($group): bool {
45
+        return $this->items->filter(function(NavItem $item) use ($group) : bool {
46 46
             return ($item->getGroup() === $group) || ($item->getGroup() === Str::slug($group));
47 47
         })->sortBy('navigation.priority')->values();
48 48
     }
Please login to merge, or discard this patch.
packages/framework/src/Facades/Config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 
44 44
     protected static function validated(mixed $value, string $type, string $key): mixed
45 45
     {
46
-        if (! ("is_$type")($value)) {
46
+        if (!("is_$type")($value)) {
47 47
             throw new TypeError(sprintf('%s(): Config value %s must be of type %s, %s given', __METHOD__, $key, $type, gettype($value)));
48 48
         }
49 49
 
Please login to merge, or discard this patch.
packages/framework/src/Foundation/Internal/LoadConfiguration.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     /** Get all the configuration files for the application. */
15 15
     protected function getConfigurationFiles(Application $app): array
16 16
     {
17
-        return tap(parent::getConfigurationFiles($app), function (array &$files) use ($app): void {
17
+        return tap(parent::getConfigurationFiles($app), function(array &$files) use ($app): void {
18 18
             // Inject our custom config file which is stored in `app/config.php`.
19 19
             $files['app'] = $app->basePath().DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'config.php';
20 20
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         // If we're running in a Phar and no project config directory exists,
63 63
         // we need to adjust the path to use the bundled static Phar config file.
64 64
 
65
-        if (\Phar::running() && (! is_dir($files['app']))) {
65
+        if (\Phar::running() && (!is_dir($files['app']))) {
66 66
             $files['app'] = dirname(__DIR__, 6).DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php';
67 67
         }
68 68
     }
Please login to merge, or discard this patch.
packages/framework/src/Foundation/Kernel/Filesystem.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@
 block discarded – undo
140 140
      */
141 141
     public function vendorPath(string $path = '', string $package = 'framework'): string
142 142
     {
143
-        if (PharSupport::running() && ! PharSupport::hasVendorDirectory()) {
143
+        if (PharSupport::running() && !PharSupport::hasVendorDirectory()) {
144 144
             return PharSupport::vendorPath($path, $package);
145 145
         }
146 146
 
Please login to merge, or discard this patch.
packages/framework/src/Framework/Actions/CreatesNewPageSourceFile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
 
126 126
     protected function validateType(string $pageClass): void
127 127
     {
128
-        if (! in_array($pageClass, [MarkdownPage::class, BladePage::class, DocumentationPage::class])) {
128
+        if (!in_array($pageClass, [MarkdownPage::class, BladePage::class, DocumentationPage::class])) {
129 129
             throw new UnsupportedPageTypeException('The page type must be either "markdown", "blade", or "documentation"');
130 130
         }
131 131
     }
Please login to merge, or discard this patch.
packages/framework/src/Framework/Concerns/InteractsWithDirectories.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
      */
19 19
     protected static function needsDirectory(string $directory): void
20 20
     {
21
-        if (! Filesystem::exists($directory)) {
21
+        if (!Filesystem::exists($directory)) {
22 22
             Filesystem::makeDirectory($directory, recursive: true);
23 23
         }
24 24
     }
Please login to merge, or discard this patch.
packages/framework/src/helpers.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 namespace {
6 6
     use Hyde\Foundation\HydeKernel;
7 7
 
8
-    if (! function_exists('hyde')) {
8
+    if (!function_exists('hyde')) {
9 9
         /**
10 10
          * Get the available HydeKernel instance.
11 11
          */
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
         }
16 16
     }
17 17
 
18
-    if (! function_exists('unslash')) {
18
+    if (!function_exists('unslash')) {
19 19
         /**
20 20
          * Remove trailing slashes from the start and end of a string.
21 21
          */
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     use Illuminate\Contracts\Support\Arrayable;
33 33
     use Symfony\Component\Yaml\Yaml;
34 34
 
35
-    if (! function_exists('\Hyde\hyde')) {
35
+    if (!function_exists('\Hyde\hyde')) {
36 36
         /**
37 37
          * Get the available HydeKernel instance.
38 38
          */
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         }
43 43
     }
44 44
 
45
-    if (! function_exists('\Hyde\unslash')) {
45
+    if (!function_exists('\Hyde\unslash')) {
46 46
         /**
47 47
          * Remove trailing slashes from the start and end of a string.
48 48
          */
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         }
53 53
     }
54 54
 
55
-    if (! function_exists('\Hyde\unixsum')) {
55
+    if (!function_exists('\Hyde\unixsum')) {
56 56
         /**
57 57
          * A EOL agnostic wrapper for calculating MD5 checksums.
58 58
          *
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         }
65 65
     }
66 66
 
67
-    if (! function_exists('\Hyde\unixsum_file')) {
67
+    if (!function_exists('\Hyde\unixsum_file')) {
68 68
         /**
69 69
          * Shorthand for {@see unixsum()} but loads a file.
70 70
          */
@@ -74,63 +74,63 @@  discard block
 block discarded – undo
74 74
         }
75 75
     }
76 76
 
77
-    if (! function_exists('\Hyde\make_title')) {
77
+    if (!function_exists('\Hyde\make_title')) {
78 78
         function make_title(string $value): string
79 79
         {
80 80
             return hyde()->makeTitle($value);
81 81
         }
82 82
     }
83 83
 
84
-    if (! function_exists('\Hyde\normalize_newlines')) {
84
+    if (!function_exists('\Hyde\normalize_newlines')) {
85 85
         function normalize_newlines(string $string): string
86 86
         {
87 87
             return hyde()->normalizeNewlines($string);
88 88
         }
89 89
     }
90 90
 
91
-    if (! function_exists('\Hyde\strip_newlines')) {
91
+    if (!function_exists('\Hyde\strip_newlines')) {
92 92
         function strip_newlines(string $string): string
93 93
         {
94 94
             return hyde()->stripNewlines($string);
95 95
         }
96 96
     }
97 97
 
98
-    if (! function_exists('\Hyde\trim_slashes')) {
98
+    if (!function_exists('\Hyde\trim_slashes')) {
99 99
         function trim_slashes(string $string): string
100 100
         {
101 101
             return hyde()->trimSlashes($string);
102 102
         }
103 103
     }
104 104
 
105
-    if (! function_exists('\Hyde\evaluate_arrayable')) {
105
+    if (!function_exists('\Hyde\evaluate_arrayable')) {
106 106
         function evaluate_arrayable(array|Arrayable $array): array
107 107
         {
108 108
             return $array instanceof Arrayable ? $array->toArray() : $array;
109 109
         }
110 110
     }
111 111
 
112
-    if (! function_exists('\Hyde\yaml_encode')) {
112
+    if (!function_exists('\Hyde\yaml_encode')) {
113 113
         function yaml_encode(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string
114 114
         {
115 115
             return Yaml::dump($input instanceof Arrayable ? $input->toArray() : $input, $inline, $indent, $flags);
116 116
         }
117 117
     }
118 118
 
119
-    if (! function_exists('\Hyde\yaml_decode')) {
119
+    if (!function_exists('\Hyde\yaml_decode')) {
120 120
         function yaml_decode(string $input, int $flags = 0): mixed
121 121
         {
122 122
             return Yaml::parse($input, $flags);
123 123
         }
124 124
     }
125 125
 
126
-    if (! function_exists('\Hyde\path_join')) {
126
+    if (!function_exists('\Hyde\path_join')) {
127 127
         function path_join(string $directory, string ...$paths): string
128 128
         {
129 129
             return implode('/', array_merge([$directory], $paths));
130 130
         }
131 131
     }
132 132
 
133
-    if (! function_exists('\Hyde\normalize_slashes')) {
133
+    if (!function_exists('\Hyde\normalize_slashes')) {
134 134
         function normalize_slashes(string $string): string
135 135
         {
136 136
             return str_replace('\\', '/', $string);
Please login to merge, or discard this patch.