Passed
Push — master ( 5e1fb1...714656 )
by Caen
13:58 queued 15s
created
packages/realtime-compiler/src/Http/LiveEditController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,11 +46,11 @@
 block discarded – undo
46 46
 
47 47
         $page = Hyde::pages()->getPage($pagePath);
48 48
 
49
-        if (! $page instanceof BaseMarkdownPage) {
49
+        if (!$page instanceof BaseMarkdownPage) {
50 50
             $this->abort(400, 'Page is not a markdown page');
51 51
         }
52 52
 
53
-        if (! $force && hash('sha256', $page->markdown()->body()) !== $currentContentHash) {
53
+        if (!$force && hash('sha256', $page->markdown()->body()) !== $currentContentHash) {
54 54
             $this->abort(409, 'Content has changed in another window');
55 55
         }
56 56
 
Please login to merge, or discard this patch.
packages/framework/src/Foundation/Internal/LoadConfiguration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     /** Get all the configuration files for the application. */
20 20
     protected function getConfigurationFiles(Application $app): array
21 21
     {
22
-        return (array) tap(parent::getConfigurationFiles($app), function (array &$files) use ($app): void {
22
+        return (array) tap(parent::getConfigurationFiles($app), function(array &$files) use ($app): void {
23 23
             // Inject our custom config file which is stored in `app/config.php`.
24 24
             $files['app'] ??= $app->basePath().DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'config.php';
25 25
         });
Please login to merge, or discard this patch.
packages/framework/src/Console/Commands/ServeCommand.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     protected function getEnvironmentVariables(): array
82 82
     {
83 83
         return Arr::whereNotNull([
84
-            'HYDE_SERVER_REQUEST_OUTPUT' => ! $this->option('no-ansi'),
84
+            'HYDE_SERVER_REQUEST_OUTPUT' => !$this->option('no-ansi'),
85 85
             'HYDE_SERVER_SAVE_PREVIEW' => $this->parseEnvironmentOption('save-preview'),
86 86
             'HYDE_SERVER_DASHBOARD' => $this->parseEnvironmentOption('dashboard'),
87 87
             'HYDE_PRETTY_URLS' => $this->parseEnvironmentOption('pretty-urls'),
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
     protected function configureOutput(): void
93 93
     {
94
-        if (! $this->useBasicOutput()) {
94
+        if (!$this->useBasicOutput()) {
95 95
             $this->console = new ConsoleOutput($this->output->isVerbose());
96 96
         }
97 97
     }
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
 
106 106
     protected function getOutputHandler(): Closure
107 107
     {
108
-        return $this->useBasicOutput() ? function (string $type, string $line): void {
108
+        return $this->useBasicOutput() ? function(string $type, string $line): void {
109 109
             $this->output->write($line);
110 110
         } : $this->console->getFormatter();
111 111
     }
112 112
 
113 113
     protected function useBasicOutput(): bool
114 114
     {
115
-        return $this->option('no-ansi') || ! class_exists(ConsoleOutput::class);
115
+        return $this->option('no-ansi') || !class_exists(ConsoleOutput::class);
116 116
     }
117 117
 
118 118
     protected function parseEnvironmentOption(string $name): ?string
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
         $process = $command ? Process::command(sprintf('%s http://%s:%d', $command, $this->getHostSelection(), $this->getPortSelection()))->run() : null;
155 155
 
156
-        if (! $process || $process->failed()) {
156
+        if (!$process || $process->failed()) {
157 157
             $this->warn('Unable to open the site preview in the browser on your system:');
158 158
             $this->line(sprintf('  %s', str_replace("\n", "\n  ", $process ? $process->errorOutput() : "Missing suitable 'open' binary.")));
159 159
             $this->newLine();
Please login to merge, or discard this patch.
src/Markdown/Contracts/FrontMatter/SubSchemas/NavigationSchema.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
 {
15 15
     public const NAVIGATION_SCHEMA = [
16 16
         'label' => 'string', // The text to display
17
-        'priority' => 'int',  // Order is also supported
18
-        'hidden' => 'bool',  // Visible is also supported (but obviously invert the value)
17
+        'priority' => 'int', // Order is also supported
18
+        'hidden' => 'bool', // Visible is also supported (but obviously invert the value)
19 19
         'group' => 'string', // Category is also supported
20 20
     ];
21 21
 }
Please login to merge, or discard this patch.
packages/framework/src/Support/Includes.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $path = static::path($filename);
55 55
 
56
-        if (! file_exists($path)) {
56
+        if (!file_exists($path)) {
57 57
             return $default;
58 58
         }
59 59
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     {
72 72
         $path = static::path(basename($filename, '.html').'.html');
73 73
 
74
-        if (! file_exists($path)) {
74
+        if (!file_exists($path)) {
75 75
             return $default === null ? null : $default;
76 76
         }
77 77
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     {
90 90
         $path = static::path(basename($filename, '.md').'.md');
91 91
 
92
-        if (! file_exists($path)) {
92
+        if (!file_exists($path)) {
93 93
             return $default === null ? null : Markdown::render($default);
94 94
         }
95 95
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     {
108 108
         $path = static::path(basename($filename, '.blade.php').'.blade.php');
109 109
 
110
-        if (! file_exists($path)) {
110
+        if (!file_exists($path)) {
111 111
             return $default === null ? null : Blade::render($default);
112 112
         }
113 113
 
Please login to merge, or discard this patch.
packages/framework/src/helpers.php 1 patch
Spacing   +18 added lines, -18 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
          */
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     if (defined('HYDE_COMPATIBILITY_MODE') && HYDE_COMPATIBILITY_MODE === true) {
29 29
         // Don't declare these functions when running in compatibility mode.
30 30
     } else {
31
-        if (! function_exists('asset')) {
31
+        if (!function_exists('asset')) {
32 32
             /**
33 33
              * Get a relative link or URL to an asset in the media directory.
34 34
              */
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
             }
39 39
         }
40 40
 
41
-        if (! function_exists('route')) {
41
+        if (!function_exists('route')) {
42 42
             /**
43 43
              * Get a page route by its key.
44 44
              */
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             }
49 49
         }
50 50
 
51
-        if (! function_exists('url')) {
51
+        if (!function_exists('url')) {
52 52
             /**
53 53
              * Get a qualified URL to the supplied path if a base URL is set.
54 54
              */
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     use function trim;
74 74
     use function md5;
75 75
 
76
-    if (! function_exists('\Hyde\hyde')) {
76
+    if (!function_exists('\Hyde\hyde')) {
77 77
         /**
78 78
          * Get the available HydeKernel instance.
79 79
          */
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         }
84 84
     }
85 85
 
86
-    if (! function_exists('\Hyde\unslash')) {
86
+    if (!function_exists('\Hyde\unslash')) {
87 87
         /**
88 88
          * Remove trailing slashes from the start and end of a string.
89 89
          */
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         }
94 94
     }
95 95
 
96
-    if (! function_exists('\Hyde\unixsum')) {
96
+    if (!function_exists('\Hyde\unixsum')) {
97 97
         /**
98 98
          * A EOL agnostic wrapper for calculating MD5 checksums.
99 99
          *
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         }
106 106
     }
107 107
 
108
-    if (! function_exists('\Hyde\unixsum_file')) {
108
+    if (!function_exists('\Hyde\unixsum_file')) {
109 109
         /**
110 110
          * Shorthand for {@see unixsum()} but loads a file.
111 111
          */
@@ -115,63 +115,63 @@  discard block
 block discarded – undo
115 115
         }
116 116
     }
117 117
 
118
-    if (! function_exists('\Hyde\make_title')) {
118
+    if (!function_exists('\Hyde\make_title')) {
119 119
         function make_title(string $value): string
120 120
         {
121 121
             return hyde()->makeTitle($value);
122 122
         }
123 123
     }
124 124
 
125
-    if (! function_exists('\Hyde\normalize_newlines')) {
125
+    if (!function_exists('\Hyde\normalize_newlines')) {
126 126
         function normalize_newlines(string $string): string
127 127
         {
128 128
             return hyde()->normalizeNewlines($string);
129 129
         }
130 130
     }
131 131
 
132
-    if (! function_exists('\Hyde\strip_newlines')) {
132
+    if (!function_exists('\Hyde\strip_newlines')) {
133 133
         function strip_newlines(string $string): string
134 134
         {
135 135
             return hyde()->stripNewlines($string);
136 136
         }
137 137
     }
138 138
 
139
-    if (! function_exists('\Hyde\trim_slashes')) {
139
+    if (!function_exists('\Hyde\trim_slashes')) {
140 140
         function trim_slashes(string $string): string
141 141
         {
142 142
             return hyde()->trimSlashes($string);
143 143
         }
144 144
     }
145 145
 
146
-    if (! function_exists('\Hyde\evaluate_arrayable')) {
146
+    if (!function_exists('\Hyde\evaluate_arrayable')) {
147 147
         function evaluate_arrayable(array|Arrayable $array): array
148 148
         {
149 149
             return $array instanceof Arrayable ? $array->toArray() : $array;
150 150
         }
151 151
     }
152 152
 
153
-    if (! function_exists('\Hyde\yaml_encode')) {
153
+    if (!function_exists('\Hyde\yaml_encode')) {
154 154
         function yaml_encode(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string
155 155
         {
156 156
             return Yaml::dump($input instanceof Arrayable ? $input->toArray() : $input, $inline, $indent, $flags);
157 157
         }
158 158
     }
159 159
 
160
-    if (! function_exists('\Hyde\yaml_decode')) {
160
+    if (!function_exists('\Hyde\yaml_decode')) {
161 161
         function yaml_decode(string $input, int $flags = 0): mixed
162 162
         {
163 163
             return Yaml::parse($input, $flags);
164 164
         }
165 165
     }
166 166
 
167
-    if (! function_exists('\Hyde\path_join')) {
167
+    if (!function_exists('\Hyde\path_join')) {
168 168
         function path_join(string $directory, string ...$paths): string
169 169
         {
170 170
             return implode('/', array_merge([$directory], $paths));
171 171
         }
172 172
     }
173 173
 
174
-    if (! function_exists('\Hyde\normalize_slashes')) {
174
+    if (!function_exists('\Hyde\normalize_slashes')) {
175 175
         function normalize_slashes(string $string): string
176 176
         {
177 177
             return str_replace('\\', '/', $string);
Please login to merge, or discard this patch.
packages/testing/src/Support/HtmlTesting/TestableHtmlDocument.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     {
67 67
         $element = $this->query($selector);
68 68
 
69
-        if (! $element) {
69
+        if (!$element) {
70 70
             PHPUnit::fail("No element matching the selector '$selector' was found in the HTML.");
71 71
         }
72 72
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     {
83 83
         $matchingNodes = collect();
84 84
 
85
-        $traverse = function (TestableHtmlElement $node) use (&$traverse, $class, &$matchingNodes): void {
85
+        $traverse = function(TestableHtmlElement $node) use (&$traverse, $class, &$matchingNodes): void {
86 86
             if (in_array($class, $node->classes, true)) {
87 87
                 $matchingNodes->push($node);
88 88
             }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         $nodes = new Collection();
155 155
         $dom = new DOMDocument();
156 156
 
157
-        $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD | LIBXML_NOERROR | LIBXML_NOWARNING | LIBXML_NONET | LIBXML_NOXMLDECL | LIBXML_COMPACT | LIBXML_PARSEHUGE);
157
+        $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD|LIBXML_NOERROR|LIBXML_NOWARNING|LIBXML_NONET|LIBXML_NOXMLDECL|LIBXML_COMPACT|LIBXML_PARSEHUGE);
158 158
 
159 159
         // Initiate recursive parsing from the root element
160 160
         foreach ($dom->childNodes as $childNode) {
Please login to merge, or discard this patch.
packages/testing/src/Support/HtmlTesting/DumpsDocumentState.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
         $structure = '';
39 39
 
40
-        $this->nodes->each(function (TestableHtmlElement $node) use (&$structure): void {
40
+        $this->nodes->each(function(TestableHtmlElement $node) use (&$structure): void {
41 41
             $structure .= $this->createStructureMapEntry($node, 0);
42 42
         });
43 43
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     {
49 49
         $text = '';
50 50
 
51
-        $this->nodes->each(function (TestableHtmlElement $node) use (&$text): void {
51
+        $this->nodes->each(function(TestableHtmlElement $node) use (&$text): void {
52 52
             $text .= $this->createTextMapEntry($node);
53 53
         });
54 54
 
@@ -89,17 +89,17 @@  discard block
 block discarded – undo
89 89
 
90 90
     protected function createStructureMapEntry(TestableHtmlElement $node, int $level): string
91 91
     {
92
-        return sprintf("\n%s%s%s", str_repeat('    ', $level), $node->tag, $node->nodes->map(function (TestableHtmlElement $node) use ($level): string {
92
+        return sprintf("\n%s%s%s", str_repeat('    ', $level), $node->tag, $node->nodes->map(function(TestableHtmlElement $node) use ($level): string {
93 93
             return $this->createStructureMapEntry($node, $level + 1);
94 94
         })->implode(''));
95 95
     }
96 96
 
97 97
     protected function createTextMapEntry(TestableHtmlElement $node, bool $addNewline = true): string
98 98
     {
99
-        $childEntries = $node->nodes->map(function (TestableHtmlElement $node): string {
99
+        $childEntries = $node->nodes->map(function(TestableHtmlElement $node): string {
100 100
             $isInline = in_array($node->tag, ['a', 'abbr', 'acronym', 'b', 'bdo', 'big', 'br', 'button', 'cite', 'code', 'dfn', 'em', 'i', 'img', 'input', 'kbd', 'label', 'map', 'object', 'q', 'samp', 'script', 'select', 'small', 'span', 'strong', 'sub', 'sup', 'textarea', 'time', 'tt', 'var']);
101 101
 
102
-            return $this->createTextMapEntry($node, ! $isInline);
102
+            return $this->createTextMapEntry($node, !$isInline);
103 103
         })->implode('');
104 104
 
105 105
         return sprintf('%s%s%s', $addNewline ? "\n" : ' ', $node->text, $childEntries);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
         $html .= '<h2>Abstract Syntax Tree Node Inspection</h2>';
113 113
         $openAllButton = '<script>function openAll() {document.querySelectorAll(\'details\').forEach((el) => el.open = true);}</script><a href="javascript:openAll();" onclick="this.remove();">Open all</a>';
114
-        $html .= sprintf("\n<details open><summary><strong>Document</strong> <small>$openAllButton</small></summary>\n<ul>%s</ul></details>\n", $this->nodes->map(function (TestableHtmlElement $node): string {
114
+        $html .= sprintf("\n<details open><summary><strong>Document</strong> <small>$openAllButton</small></summary>\n<ul>%s</ul></details>\n", $this->nodes->map(function(TestableHtmlElement $node): string {
115 115
             return $this->createDumpNodeMapEntry($node);
116 116
         })->implode(''));
117 117
 
@@ -130,20 +130,20 @@  discard block
 block discarded – undo
130 130
     {
131 131
         $data = $node->toArray();
132 132
 
133
-        $list = sprintf("\n    <ul class=\"node\">\n%s  </ul>\n", implode('', array_map(function (string|iterable $value, string $key): string {
133
+        $list = sprintf("\n    <ul class=\"node\">\n%s  </ul>\n", implode('', array_map(function(string|iterable $value, string $key): string {
134 134
             if ($value instanceof Collection) {
135 135
                 if ($value->isEmpty()) {
136 136
                     return sprintf("      <li><strong>%s</strong>: <span>None</span></li>\n", ucfirst($key));
137 137
                 }
138 138
 
139
-                return sprintf("      <li><strong>%s</strong>: <ul>%s</ul></li>\n", ucfirst($key), $value->map(function (TestableHtmlElement $node): string {
139
+                return sprintf("      <li><strong>%s</strong>: <ul>%s</ul></li>\n", ucfirst($key), $value->map(function(TestableHtmlElement $node): string {
140 140
                     return $this->createDumpNodeMapEntry($node);
141 141
                 })->implode(''));
142 142
             }
143 143
 
144 144
             if (is_array($value)) {
145
-                if (! is_numeric(array_key_first($value))) {
146
-                    $value = array_map(function (string $value, string $key): string {
145
+                if (!is_numeric(array_key_first($value))) {
146
+                    $value = array_map(function(string $value, string $key): string {
147 147
                         return sprintf('%s: %s', $key, str_contains($value, ' ') ? sprintf('"%s"', $value) : $value);
148 148
                     }, $value, array_keys($value));
149 149
                 }
Please login to merge, or discard this patch.