Passed
Branch master (ba7e75)
by M. Mikkel
05:34
created
src/CacheFlag.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
         // Add tag option to the Clear Caches utility to invalidate all flagged caches
76 76
         Event::on(ClearCaches::class, ClearCaches::EVENT_REGISTER_TAG_OPTIONS,
77
-            static function (RegisterCacheOptionsEvent $event) {
77
+            static function(RegisterCacheOptionsEvent $event) {
78 78
                 $event->options[] = [
79 79
                     'key' => 'cacheflag-flagged-caches',
80 80
                     'label' => Craft::t('cache-flag', 'Flagged template caches'),
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         Event::on(
116 116
             Plugins::class,
117 117
             Plugins::EVENT_AFTER_UNINSTALL_PLUGIN,
118
-            function (PluginEvent $event) {
118
+            function(PluginEvent $event) {
119 119
                 if ($event->plugin === $this) {
120 120
                     Craft::$app->getProjectConfig()->remove('cacheFlags');
121 121
                 }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         Event::on(
133 133
             Elements::class,
134 134
             Elements::EVENT_AFTER_SAVE_ELEMENT,
135
-            function (ElementEvent $event) {
135
+            function(ElementEvent $event) {
136 136
                 $this->_maybeInvalidateFlaggedCachesByElement($event->element);
137 137
             }
138 138
         );
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         Event::on(
142 142
             Elements::class,
143 143
             Elements::EVENT_BEFORE_DELETE_ELEMENT,
144
-            function (ElementEvent $event) {
144
+            function(ElementEvent $event) {
145 145
                 $this->_maybeInvalidateFlaggedCachesByElement($event->element);
146 146
             }
147 147
         );
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         Event::on(
151 151
             Structures::class,
152 152
             Structures::EVENT_AFTER_MOVE_ELEMENT,
153
-            function (MoveElementEvent $event) {
153
+            function(MoveElementEvent $event) {
154 154
                 $this->_maybeInvalidateFlaggedCachesByElement($event->element);
155 155
             }
156 156
         );
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         Event::on(
160 160
             Elements::class,
161 161
             Elements::EVENT_AFTER_PERFORM_ACTION,
162
-            function (ElementActionEvent $event) {
162
+            function(ElementActionEvent $event) {
163 163
 
164 164
                 /* @var ElementActionInterface|null $action */
165 165
                 $action = $event->action;
Please login to merge, or discard this patch.
src/twigextensions/Extension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
             return $value;
60 60
         }
61 61
         $pattern = '/([a-z])([A-Z])/';
62
-        $r = strtolower(preg_replace_callback($pattern, function ($a) {
62
+        $r = strtolower(preg_replace_callback($pattern, function($a) {
63 63
             return $a[1] . ' ' . strtolower($a[2]);
64 64
         }, $value));
65 65
         return $r;
Please login to merge, or discard this patch.
src/controllers/CachesController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 {
17 17
 
18 18
     /** @var array|bool|int */
19
-    public array|bool|int $allowAnonymous = self::ALLOW_ANONYMOUS_OFFLINE;
19
+    public array | bool | int $allowAnonymous = self::ALLOW_ANONYMOUS_OFFLINE;
20 20
 
21 21
     /**
22 22
      * Invalidate all flagged caches, or caches flagged with one or several particular flags
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
             $flags = \preg_replace('/\s+/', '', $flags);
32 32
             $flags = \array_filter(\explode(',', $flags));
33 33
         } else if (\is_array($flags)) {
34
-            $flags = \array_reduce($flags, function (array $carry, string $flag) {
34
+            $flags = \array_reduce($flags, function(array $carry, string $flag) {
35 35
                 $flag = \preg_replace('/\s+/', '', $flag);
36 36
                 if (\strlen($flag)) {
37 37
                     $carry[] = $flag;
Please login to merge, or discard this patch.
src/controllers/DefaultController.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
 {
20 20
 
21 21
     /** @var array|bool|int */
22
-    public array|bool|int $allowAnonymous = self::ALLOW_ANONYMOUS_NEVER;
22
+    public array | bool | int $allowAnonymous = self::ALLOW_ANONYMOUS_NEVER;
23 23
 
24 24
     /**
25 25
      * @return \yii\web\Response
Please login to merge, or discard this patch.
src/utilities/CacheFlagUtility.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
             'elementTypes' => [
62 62
                 'column' => 'elementType',
63 63
                 'name' => Craft::t('app', 'Element Types'),
64
-                'sources' => array_map(function (string $elementType) {
64
+                'sources' => array_map(function(string $elementType) {
65 65
                     return [
66 66
                         'id' => $elementType,
67 67
                         'name' => $elementType,
Please login to merge, or discard this patch.
src/services/CacheFlagService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
      * @param string|string[]|null $flags
235 235
      * @return bool
236 236
      */
237
-    public function invalidateFlaggedCachesByFlags(string|array|null $flags): bool
237
+    public function invalidateFlaggedCachesByFlags(string | array | null $flags): bool
238 238
     {
239 239
 
240 240
         if (empty($flags)) {
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
             ]));
261 261
         }
262 262
 
263
-        $flagTags = array_map(function (string $flag) {
263
+        $flagTags = array_map(function(string $flag) {
264 264
             return "cacheflag::$flag";
265 265
         }, $flags);
266 266
 
Please login to merge, or discard this patch.