Passed
Push — master ( 1d8f1f...cf6496 )
by Caen
03:40
created
packages/testing/src/UsesRealBladeInUnitTests.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
         $resolver = new EngineResolver();
22 22
         $filesystem = new Filesystem();
23 23
 
24
-        $resolver->register('blade', function () use ($filesystem) {
24
+        $resolver->register('blade', function() use ($filesystem) {
25 25
             return new CompilerEngine(
26 26
                 new BladeCompiler($filesystem, sys_get_temp_dir())
27 27
             );
Please login to merge, or discard this patch.
packages/framework/src/Console/Helpers/ConsoleHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 
30 30
     public static function mockWindowsOs(bool $isWindowsOs): void
31 31
     {
32
-        static::$enableLaravelPrompts = ! $isWindowsOs;
32
+        static::$enableLaravelPrompts = !$isWindowsOs;
33 33
     }
34 34
 
35 35
     public static function canUseLaravelPrompts(InputInterface $input): bool
Please login to merge, or discard this patch.
packages/framework/src/Console/Helpers/InteractivePublishCommandHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     /** @return array<string, string> */
29 29
     public function getFileChoices(): array
30 30
     {
31
-        return Arr::mapWithKeys($this->publishableFilesMap, /** @return array<string, string> */ function (string $target, string $source): array {
31
+        return Arr::mapWithKeys($this->publishableFilesMap, /** @return array<string, string> */ function(string $target, string $source): array {
32 32
             return [$source => $this->pathRelativeToDirectory($source, $this->getBaseDirectory())];
33 33
         });
34 34
     }
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
     /** Find the most specific common parent directory path for the files, trimming as much as possible whilst keeping specificity and uniqueness. */
47 47
     public function getBaseDirectory(): string
48 48
     {
49
-        $partsMap = collect($this->publishableFilesMap)->map(function (string $file): array {
49
+        $partsMap = collect($this->publishableFilesMap)->map(function(string $file): array {
50 50
             return explode('/', $file);
51 51
         });
52 52
 
53
-        $commonParts = $partsMap->reduce(function (array $carry, array $parts): array {
53
+        $commonParts = $partsMap->reduce(function(array $carry, array $parts): array {
54 54
             return array_intersect($carry, $parts);
55 55
         }, $partsMap->first());
56 56
 
Please login to merge, or discard this patch.
packages/framework/src/Console/Commands/PublishViewsCommand.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
             $this->infoComment(sprintf('Selected group [%s]', $selected));
47 47
         }
48 48
 
49
-        if (! in_array($selected, $allowed = array_merge(['all'], array_keys($this->options)), true)) {
49
+        if (!in_array($selected, $allowed = array_merge(['all'], array_keys($this->options)), true)) {
50 50
             $this->error("Invalid selection: '$selected'");
51 51
             $this->infoComment('Allowed values are: ['.implode(', ', $allowed).']');
52 52
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         }
55 55
 
56 56
         $files = $selected === 'all'
57
-            ? collect($this->options)->flatMap(fn (ViewPublishGroup $option): array => $option->publishableFilesMap())->all()
57
+            ? collect($this->options)->flatMap(fn (ViewPublishGroup $option) : array => $option->publishableFilesMap())->all()
58 58
             : $this->options[$selected]->publishableFilesMap();
59 59
 
60 60
         $publisher = $this->publishSelectedFiles($files, $selected === 'all');
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
     protected function promptForGroup(): string
68 68
     {
69
-        SelectPrompt::fallbackUsing(function (SelectPrompt $prompt): string {
69
+        SelectPrompt::fallbackUsing(function(SelectPrompt $prompt): string {
70 70
             return $this->choice($prompt->label, $prompt->options, $prompt->default);
71 71
         });
72 72
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      */
96 96
     protected static function mapToKeys(array $groups): array
97 97
     {
98
-        return collect($groups)->mapWithKeys(function (ViewPublishGroup $group): array {
98
+        return collect($groups)->mapWithKeys(function(ViewPublishGroup $group): array {
99 99
             return [Str::after($group->group, 'hyde-') => $group];
100 100
         })->all();
101 101
     }
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     {
106 106
         $publisher = new InteractivePublishCommandHelper($files);
107 107
 
108
-        if (! $isPublishingAll && ConsoleHelper::canUseLaravelPrompts($this->input)) {
108
+        if (!$isPublishingAll && ConsoleHelper::canUseLaravelPrompts($this->input)) {
109 109
             $publisher->only($this->promptUserForWhichFilesToPublish($publisher->getFileChoices()));
110 110
         }
111 111
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
     protected static function supportTogglingAll(MultiSelectPrompt $prompt): Closure
133 133
     {
134
-        return function (string $key) use ($prompt): void {
134
+        return function(string $key) use ($prompt): void {
135 135
             static $isToggled = false;
136 136
 
137 137
             if ($prompt->isHighlighted('all')) {
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                         $isToggled = true;
147 147
                     }
148 148
                 } elseif ($key === Key::ENTER) {
149
-                    if (! $isToggled) {
149
+                    if (!$isToggled) {
150 150
                         $prompt->emit('key', Key::CTRL_A);
151 151
                     }
152 152
 
Please login to merge, or discard this patch.
packages/framework/src/Console/Commands/ServeCommand.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     protected function getEnvironmentVariables(): array
97 97
     {
98 98
         return Arr::whereNotNull([
99
-            'HYDE_SERVER_REQUEST_OUTPUT' => ! $this->option('no-ansi'),
99
+            'HYDE_SERVER_REQUEST_OUTPUT' => !$this->option('no-ansi'),
100 100
             'HYDE_SERVER_SAVE_PREVIEW' => $this->parseEnvironmentOption('save-preview'),
101 101
             'HYDE_SERVER_DASHBOARD' => $this->parseEnvironmentOption('dashboard'),
102 102
             'HYDE_PRETTY_URLS' => $this->parseEnvironmentOption('pretty-urls'),
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
     protected function configureOutput(): void
108 108
     {
109
-        if (! $this->useBasicOutput()) {
109
+        if (!$this->useBasicOutput()) {
110 110
             $this->console = new ConsoleOutput($this->output->isVerbose());
111 111
         }
112 112
     }
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
 
121 121
     protected function getOutputHandler(): Closure
122 122
     {
123
-        return $this->useBasicOutput() ? function (string $type, string $line): void {
123
+        return $this->useBasicOutput() ? function(string $type, string $line): void {
124 124
             $this->output->write($line);
125 125
         } : $this->console->getFormatter();
126 126
     }
127 127
 
128 128
     protected function useBasicOutput(): bool
129 129
     {
130
-        return $this->option('no-ansi') || ! class_exists(ConsoleOutput::class);
130
+        return $this->option('no-ansi') || !class_exists(ConsoleOutput::class);
131 131
     }
132 132
 
133 133
     protected function parseEnvironmentOption(string $name): ?string
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
         $process = $binary ? Process::command($command)->run() : null;
168 168
 
169
-        if (! $process || $process->failed()) {
169
+        if (!$process || $process->failed()) {
170 170
             $this->warn('Unable to open the site preview in the browser on your system:');
171 171
             $this->line(sprintf('  %s', str_replace("\n", "\n  ", $process ? $process->errorOutput() : "Missing suitable 'open' binary.")));
172 172
             $this->newLine();
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 
186 186
     protected function runViteProcess(): void
187 187
     {
188
-        if (! $this->isPortAvailable(5173)) {
188
+        if (!$this->isPortAvailable(5173)) {
189 189
             throw new InvalidArgumentException(
190 190
                 'Unable to start Vite server: Port 5173 is already in use. '.
191 191
                 'Please stop any other Vite processes and try again.'
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         while ($this->server->running()) {
203 203
             $this->handleViteOutput();
204 204
 
205
-            Sleep::for(100)->milliseconds();
205
+            Sleep::for (100)->milliseconds();
206 206
         }
207 207
     }
208 208
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -202,7 +202,9 @@
 block discarded – undo
202 202
         while ($this->server->running()) {
203 203
             $this->handleViteOutput();
204 204
 
205
-            Sleep::for(100)->milliseconds();
205
+            Sleep::for(100) {
206
+                ->milliseconds();
207
+            }
206 208
         }
207 209
     }
208 210
 
Please login to merge, or discard this patch.
packages/framework/src/Enums/Feature.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     /** Translates a case name into the corresponding Enum case, if any. If there is no matching case defined, it will return null. */
32 32
     public static function fromName(string $name): ?self
33 33
     {
34
-        if (! defined("self::$name")) {
34
+        if (!defined("self::$name")) {
35 35
             return null;
36 36
         }
37 37
 
Please login to merge, or discard this patch.
packages/framework/src/Facades/HydeFront.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     /** This method is used to inject the project's Tailwind CSS configuration into the Play CDN integration so it can match the styles. */
42 42
     public static function injectTailwindConfig(): string
43 43
     {
44
-        if (! file_exists(Hyde::path('tailwind.config.js'))) {
44
+        if (!file_exists(Hyde::path('tailwind.config.js'))) {
45 45
             return '';
46 46
         }
47 47
 
Please login to merge, or discard this patch.
packages/framework/src/helpers.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
     use Hyde\Foundation\HydeKernel;
7 7
     use Hyde\Support\Filesystem\MediaFile;
8 8
 
9
-    if (! function_exists('hyde')) {
9
+    if (!function_exists('hyde')) {
10 10
         /**
11 11
          * Get the available HydeKernel instance.
12 12
          */
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     if (defined('HYDE_COMPATIBILITY_MODE') && HYDE_COMPATIBILITY_MODE === true) {
20 20
         // Don't declare these functions when running in compatibility mode.
21 21
     } else {
22
-        if (! function_exists('asset')) {
22
+        if (!function_exists('asset')) {
23 23
             /**
24 24
              * Gets a MediaAsset instance for the given file stored in the `_site/media` folder.
25 25
              * The returned value can be cast into a string in Blade views to resole the URL.
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             }
36 36
         }
37 37
 
38
-        if (! function_exists('route')) {
38
+        if (!function_exists('route')) {
39 39
             /**
40 40
              * Get a page route instance by its key. Casting it to a string will return a relative link to the page.
41 41
              */
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             }
46 46
         }
47 47
 
48
-        if (! function_exists('url')) {
48
+        if (!function_exists('url')) {
49 49
             /**
50 50
              * Get a qualified URL to the supplied path if a base URL is set.
51 51
              */
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     use function trim;
71 71
     use function md5;
72 72
 
73
-    if (! function_exists('\Hyde\hyde')) {
73
+    if (!function_exists('\Hyde\hyde')) {
74 74
         /**
75 75
          * Get the available HydeKernel instance.
76 76
          */
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         }
81 81
     }
82 82
 
83
-    if (! function_exists('\Hyde\unslash')) {
83
+    if (!function_exists('\Hyde\unslash')) {
84 84
         /**
85 85
          * Remove trailing slashes from the start and end of a string.
86 86
          */
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         }
91 91
     }
92 92
 
93
-    if (! function_exists('\Hyde\unixsum')) {
93
+    if (!function_exists('\Hyde\unixsum')) {
94 94
         /**
95 95
          * A EOL agnostic wrapper for calculating MD5 checksums.
96 96
          *
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         }
103 103
     }
104 104
 
105
-    if (! function_exists('\Hyde\unixsum_file')) {
105
+    if (!function_exists('\Hyde\unixsum_file')) {
106 106
         /**
107 107
          * Shorthand for {@see unixsum()} but loads a file.
108 108
          */
@@ -112,63 +112,63 @@  discard block
 block discarded – undo
112 112
         }
113 113
     }
114 114
 
115
-    if (! function_exists('\Hyde\make_title')) {
115
+    if (!function_exists('\Hyde\make_title')) {
116 116
         function make_title(string $value): string
117 117
         {
118 118
             return hyde()->makeTitle($value);
119 119
         }
120 120
     }
121 121
 
122
-    if (! function_exists('\Hyde\normalize_newlines')) {
122
+    if (!function_exists('\Hyde\normalize_newlines')) {
123 123
         function normalize_newlines(string $string): string
124 124
         {
125 125
             return hyde()->normalizeNewlines($string);
126 126
         }
127 127
     }
128 128
 
129
-    if (! function_exists('\Hyde\strip_newlines')) {
129
+    if (!function_exists('\Hyde\strip_newlines')) {
130 130
         function strip_newlines(string $string): string
131 131
         {
132 132
             return hyde()->stripNewlines($string);
133 133
         }
134 134
     }
135 135
 
136
-    if (! function_exists('\Hyde\trim_slashes')) {
136
+    if (!function_exists('\Hyde\trim_slashes')) {
137 137
         function trim_slashes(string $string): string
138 138
         {
139 139
             return hyde()->trimSlashes($string);
140 140
         }
141 141
     }
142 142
 
143
-    if (! function_exists('\Hyde\evaluate_arrayable')) {
143
+    if (!function_exists('\Hyde\evaluate_arrayable')) {
144 144
         function evaluate_arrayable(array|Arrayable $array): array
145 145
         {
146 146
             return $array instanceof Arrayable ? $array->toArray() : $array;
147 147
         }
148 148
     }
149 149
 
150
-    if (! function_exists('\Hyde\yaml_encode')) {
150
+    if (!function_exists('\Hyde\yaml_encode')) {
151 151
         function yaml_encode(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string
152 152
         {
153 153
             return Yaml::dump($input instanceof Arrayable ? $input->toArray() : $input, $inline, $indent, $flags);
154 154
         }
155 155
     }
156 156
 
157
-    if (! function_exists('\Hyde\yaml_decode')) {
157
+    if (!function_exists('\Hyde\yaml_decode')) {
158 158
         function yaml_decode(string $input, int $flags = 0): mixed
159 159
         {
160 160
             return Yaml::parse($input, $flags);
161 161
         }
162 162
     }
163 163
 
164
-    if (! function_exists('\Hyde\path_join')) {
164
+    if (!function_exists('\Hyde\path_join')) {
165 165
         function path_join(string $directory, string ...$paths): string
166 166
         {
167 167
             return implode('/', array_merge([$directory], $paths));
168 168
         }
169 169
     }
170 170
 
171
-    if (! function_exists('\Hyde\normalize_slashes')) {
171
+    if (!function_exists('\Hyde\normalize_slashes')) {
172 172
         function normalize_slashes(string $string): string
173 173
         {
174 174
             return str_replace('\\', '/', $string);
Please login to merge, or discard this patch.
packages/framework/src/Foundation/Kernel/Hyperlinks.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     {
109 109
         $value = Config::getNullableString('hyde.url');
110 110
 
111
-        return ! blank($value) && $value !== 'http://localhost';
111
+        return !blank($value) && $value !== 'http://localhost';
112 112
     }
113 113
 
114 114
     /**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
         // Since v1.7.0, we return the relative path even if the base URL is not set,
135 135
         // as this is more likely to be the desired behavior the user's expecting.
136
-        if (! blank($path)) {
136
+        if (!blank($path)) {
137 137
             return $path;
138 138
         }
139 139
 
Please login to merge, or discard this patch.