Passed
Push — master ( a70593...19b461 )
by Caen
03:48
created
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
          */
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     use function trim;
40 40
     use function md5;
41 41
 
42
-    if (! function_exists('\Hyde\hyde')) {
42
+    if (!function_exists('\Hyde\hyde')) {
43 43
         /**
44 44
          * Get the available HydeKernel instance.
45 45
          */
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         }
50 50
     }
51 51
 
52
-    if (! function_exists('\Hyde\unslash')) {
52
+    if (!function_exists('\Hyde\unslash')) {
53 53
         /**
54 54
          * Remove trailing slashes from the start and end of a string.
55 55
          */
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         }
60 60
     }
61 61
 
62
-    if (! function_exists('\Hyde\unixsum')) {
62
+    if (!function_exists('\Hyde\unixsum')) {
63 63
         /**
64 64
          * A EOL agnostic wrapper for calculating MD5 checksums.
65 65
          *
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         }
72 72
     }
73 73
 
74
-    if (! function_exists('\Hyde\unixsum_file')) {
74
+    if (!function_exists('\Hyde\unixsum_file')) {
75 75
         /**
76 76
          * Shorthand for {@see unixsum()} but loads a file.
77 77
          */
@@ -81,63 +81,63 @@  discard block
 block discarded – undo
81 81
         }
82 82
     }
83 83
 
84
-    if (! function_exists('\Hyde\make_title')) {
84
+    if (!function_exists('\Hyde\make_title')) {
85 85
         function make_title(string $value): string
86 86
         {
87 87
             return hyde()->makeTitle($value);
88 88
         }
89 89
     }
90 90
 
91
-    if (! function_exists('\Hyde\normalize_newlines')) {
91
+    if (!function_exists('\Hyde\normalize_newlines')) {
92 92
         function normalize_newlines(string $string): string
93 93
         {
94 94
             return hyde()->normalizeNewlines($string);
95 95
         }
96 96
     }
97 97
 
98
-    if (! function_exists('\Hyde\strip_newlines')) {
98
+    if (!function_exists('\Hyde\strip_newlines')) {
99 99
         function strip_newlines(string $string): string
100 100
         {
101 101
             return hyde()->stripNewlines($string);
102 102
         }
103 103
     }
104 104
 
105
-    if (! function_exists('\Hyde\trim_slashes')) {
105
+    if (!function_exists('\Hyde\trim_slashes')) {
106 106
         function trim_slashes(string $string): string
107 107
         {
108 108
             return hyde()->trimSlashes($string);
109 109
         }
110 110
     }
111 111
 
112
-    if (! function_exists('\Hyde\evaluate_arrayable')) {
112
+    if (!function_exists('\Hyde\evaluate_arrayable')) {
113 113
         function evaluate_arrayable(array|Arrayable $array): array
114 114
         {
115 115
             return $array instanceof Arrayable ? $array->toArray() : $array;
116 116
         }
117 117
     }
118 118
 
119
-    if (! function_exists('\Hyde\yaml_encode')) {
119
+    if (!function_exists('\Hyde\yaml_encode')) {
120 120
         function yaml_encode(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string
121 121
         {
122 122
             return Yaml::dump($input instanceof Arrayable ? $input->toArray() : $input, $inline, $indent, $flags);
123 123
         }
124 124
     }
125 125
 
126
-    if (! function_exists('\Hyde\yaml_decode')) {
126
+    if (!function_exists('\Hyde\yaml_decode')) {
127 127
         function yaml_decode(string $input, int $flags = 0): mixed
128 128
         {
129 129
             return Yaml::parse($input, $flags);
130 130
         }
131 131
     }
132 132
 
133
-    if (! function_exists('\Hyde\path_join')) {
133
+    if (!function_exists('\Hyde\path_join')) {
134 134
         function path_join(string $directory, string ...$paths): string
135 135
         {
136 136
             return implode('/', array_merge([$directory], $paths));
137 137
         }
138 138
     }
139 139
 
140
-    if (! function_exists('\Hyde\normalize_slashes')) {
140
+    if (!function_exists('\Hyde\normalize_slashes')) {
141 141
         function normalize_slashes(string $string): string
142 142
         {
143 143
             return str_replace('\\', '/', $string);
Please login to merge, or discard this patch.
packages/framework/src/Framework/Features/Blogging/Models/PostAuthor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
     /** @return \Illuminate\Support\Collection<string, \Hyde\Framework\Features\Blogging\Models\PostAuthor> */
76 76
     public static function all(): Collection
77 77
     {
78
-        return (new Collection(Config::getArray('hyde.authors', [])))->mapWithKeys(function (self $author): array {
78
+        return (new Collection(Config::getArray('hyde.authors', [])))->mapWithKeys(function(self $author): array {
79 79
             return [strtolower($author->username) => $author];
80 80
         });
81 81
     }
Please login to merge, or discard this patch.
packages/framework/src/Framework/Features/Metadata/GlobalMetadataBag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
         // Reject any metadata from the global metadata bag that is already present in the page metadata bag.
53 53
 
54 54
         foreach (['links', 'metadata', 'properties', 'generics'] as $type) {
55
-            $global->$type = array_filter((array) $global->$type, fn (Element $element): bool => ! in_array($element->uniqueKey(),
55
+            $global->$type = array_filter((array) $global->$type, fn (Element $element): bool => !in_array($element->uniqueKey(),
56 56
                 array_map(fn (Element $element): string => $element->uniqueKey(), (array) $page->metadata->$type)
57 57
             ));
58 58
         }
Please login to merge, or discard this patch.
framework/src/Framework/Concerns/Internal/ForwardsIlluminateFilesystem.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     /** @param  string[]  $parameterNames */
89 89
     protected static function qualifyArguments(array $parameterNames, array $arguments): Collection
90 90
     {
91
-        return collect($arguments)->mapWithKeys(function (string|array|int|bool $argumentValue, int|string $key) use ($parameterNames): string|array|int|bool {
91
+        return collect($arguments)->mapWithKeys(function(string|array|int|bool $argumentValue, int|string $key) use ($parameterNames): string|array|int|bool {
92 92
             $argumentsToQualify = [
93 93
                 'path', 'paths', 'file', 'target', 'directory', 'destination', 'firstFile', 'secondFile',
94 94
                 'pattern', 'link', 'from', 'to',
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     protected static function qualifyPathArgument(array|string $path): string|array
111 111
     {
112 112
         return is_array($path)
113
-            ? array_map(fn (string $path): string => self::qualifyPathArgument($path), $path)
113
+            ? array_map(fn (string $path) : string => self::qualifyPathArgument($path), $path)
114 114
             : self::absolutePath($path);
115 115
     }
116 116
 }
Please login to merge, or discard this patch.
packages/framework/src/Foundation/ConsoleKernel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
         // the default LoadConfiguration bootstrapper class with our implementation.
29 29
         // We do this by swapping out the LoadConfiguration class with our own.
30 30
 
31
-        return array_values((array) tap(array_combine($bootstrappers, $bootstrappers), function (array &$array): void {
31
+        return array_values((array) tap(array_combine($bootstrappers, $bootstrappers), function(array &$array): void {
32 32
             $array[\LaravelZero\Framework\Bootstrap\LoadConfiguration::class] = \Hyde\Foundation\Internal\LoadConfiguration::class;
33 33
         }));
34 34
     }
Please login to merge, or discard this patch.
packages/framework/src/Framework/Services/AssetService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
 
68 68
     public function injectTailwindConfig(): string
69 69
     {
70
-        if (! file_exists(Hyde::path('tailwind.config.js'))) {
70
+        if (!file_exists(Hyde::path('tailwind.config.js'))) {
71 71
             return '';
72 72
         }
73 73
 
Please login to merge, or discard this patch.
packages/publications/src/Models/PublicationType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -233,14 +233,14 @@
 block discarded – undo
233 233
 
234 234
     protected function parseFieldData(array $fields): Collection
235 235
     {
236
-        return Collection::make($fields)->map(function (array $data): PublicationFieldDefinition {
236
+        return Collection::make($fields)->map(function(array $data): PublicationFieldDefinition {
237 237
             return new PublicationFieldDefinition(...$data);
238 238
         });
239 239
     }
240 240
 
241 241
     protected function withoutNullValues(array $array): array
242 242
     {
243
-        return array_filter($array, fn (mixed $value): bool => ! is_null($value));
243
+        return array_filter($array, fn (mixed $value): bool => !is_null($value));
244 244
     }
245 245
 
246 246
     /**
Please login to merge, or discard this patch.
packages/publications/src/Views/Components/RelatedPublicationsComponent.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,14 +42,14 @@
 block discarded – undo
42 42
         $currentHydePage = Hyde::currentRoute()->getPage();
43 43
 
44 44
         // If not a publication page, exit early
45
-        if (! $currentHydePage instanceof PublicationPage) {
45
+        if (!$currentHydePage instanceof PublicationPage) {
46 46
             return [];
47 47
         }
48 48
 
49 49
         $publicationType = $currentHydePage->getType();
50 50
 
51 51
         // Get the tag fields for the current publicationType or exit early if there aren't any
52
-        $publicationTypeTagFields = $publicationType->getFields()->filter(function (PublicationFieldDefinition $field): bool {
52
+        $publicationTypeTagFields = $publicationType->getFields()->filter(function(PublicationFieldDefinition $field): bool {
53 53
             return $field->type === PublicationFieldTypes::Tag;
54 54
         });
55 55
         if ($publicationTypeTagFields->isEmpty()) {
Please login to merge, or discard this patch.
packages/publications/src/Providers/TranslationServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     {
17 17
         parent::register();
18 18
 
19
-        if (! is_dir(lang_path())) {
19
+        if (!is_dir(lang_path())) {
20 20
             $this->app->useLangPath(__DIR__.'/../../resources/lang');
21 21
         }
22 22
 
Please login to merge, or discard this patch.