Passed
Push — master ( 553534...d77e2c )
by Dominik
06:58 queued 03:32
created
inc/options.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 function addOptionsToComponent($data, $componentName)
15 15
 {
16 16
     // get fields for this component
17
-    $options = array_reduce(array_keys(Options::OPTION_TYPES), function ($carry, $optionType) use ($componentName) {
17
+    $options = array_reduce(array_keys(Options::OPTION_TYPES), function($carry, $optionType) use ($componentName) {
18 18
         return array_merge($carry, Options::get($optionType, $componentName));
19 19
     }, []);
20 20
     // don't overwrite existing data
Please login to merge, or discard this patch.
lib/Utils/Options.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
             acf_add_local_field_group($fieldGroup);
88 88
         }
89 89
 
90
-        add_action('current_screen', function ($currentScreen) {
90
+        add_action('current_screen', function($currentScreen) {
91 91
             foreach (static::OPTION_TYPES as $optionType => $option) {
92 92
                 $isTranslatable = $option['translatable'];
93 93
                 $toplevelPageId = 'toplevel_page_' . $optionType;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                     add_filter('acf/settings/current_language', 'Flynt\Utils\Options::getDefaultAcfLanguage', 101);
103 103
 
104 104
                     // hide language selector in admin bar
105
-                    add_action('wp_before_admin_bar_render', function () {
105
+                    add_action('wp_before_admin_bar_render', function() {
106 106
                         $adminBar = $GLOBALS['wp_admin_bar'];
107 107
                         $adminBar->remove_menu('WPML_ALS');
108 108
                     });
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             $optionNames = ((static::$registeredOptions[$optionType] ?? [])[$scope] ?? []);
161 161
             return array_combine(
162 162
                 $optionNames,
163
-                array_map(function ($optionName) use ($prefix, $isTranslatable) {
163
+                array_map(function($optionName) use ($prefix, $isTranslatable) {
164 164
                     $fieldKey = $prefix . $optionName;
165 165
                     return static::getOptionField($fieldKey, $isTranslatable);
166 166
                 }, $optionNames)
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 
244 244
     protected static function prefixFields($fields, $prefix)
245 245
     {
246
-        return array_map(function ($field) use ($prefix) {
246
+        return array_map(function($field) use ($prefix) {
247 247
             $field['name'] = $prefix . '_' . $field['name'];
248 248
             return $field;
249 249
         }, $fields);
Please login to merge, or discard this patch.
Components/ListComponents/functions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@  discard block
 block discarded – undo
7 7
 use Flynt\Utils\Options;
8 8
 use Flynt\Utils\Asset;
9 9
 
10
-add_filter('Flynt/addComponentData?name=ListComponents', function ($data) {
10
+add_filter('Flynt/addComponentData?name=ListComponents', function($data) {
11 11
     if (!empty($data['componentBlocks'])) {
12
-        $data['componentBlocks'] = array_map(function ($block) {
12
+        $data['componentBlocks'] = array_map(function($block) {
13 13
             $block['component'] = substr($block['component'], strpos($block['component'], 'Components/'));
14 14
 
15 15
             if (file_exists(Asset::requirePath($block['component'] . 'screenshot.png'))) {
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     return $data;
36 36
 });
37 37
 
38
-add_filter('acf/load_field/name=component', function ($field) {
38
+add_filter('acf/load_field/name=component', function($field) {
39 39
     $componentManager = ComponentManager::getInstance();
40 40
     $field['choices'] = array_flip($componentManager->getAll());
41 41
     return $field;
Please login to merge, or discard this patch.
inc/timberLoader.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
 // Convert ACF Field of type relationship to a Timber\Post and add all ACF Fields of that Post
28 28
 add_filter('acf/format_value/type=relationship', NS . 'formatPostObject', 100);
29
-add_filter('get_twig', function ($twig) {
29
+add_filter('get_twig', function($twig) {
30 30
     $twig->addExtension(new TwigExtensionFlynt());
31 31
     return $twig;
32 32
 });
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 function formatGallery($value)
43 43
 {
44 44
     if (!empty($value)) {
45
-        $value = array_map(function ($image) {
45
+        $value = array_map(function($image) {
46 46
             return new Image($image);
47 47
         }, $value);
48 48
     }
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
     return $value;
68 68
 }
69 69
 
70
-add_action('timber/twig/filters', function ($twig) {
71
-    $twig->addFunction(new TwigFunction('placeholderImage', function ($width, $height, $color = null) {
70
+add_action('timber/twig/filters', function($twig) {
71
+    $twig->addFunction(new TwigFunction('placeholderImage', function($width, $height, $color = null) {
72 72
         $width = round($width);
73 73
         $height = round($height);
74 74
         $colorRect = $color ? "<rect width='{$width}' height='{$height}' style='fill:$color' />" : '';
Please login to merge, or discard this patch.
inc/timberDynamicResize.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     return $wpdb->prefix . TABLE_NAME;
18 18
 }
19 19
 
20
-call_user_func(function () {
20
+call_user_func(function() {
21 21
     $optionName = TABLE_NAME . '_db_version';
22 22
 
23 23
     $installedVersion = get_option($optionName);
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
     return $uploadDir['relative'];
47 47
 }
48 48
 
49
-add_action('timber/twig/filters', function ($twig) {
49
+add_action('timber/twig/filters', function($twig) {
50 50
     $twig->addFilter(
51
-        new TwigFilter('resizeDynamic', function (
51
+        new TwigFilter('resizeDynamic', function(
52 52
             $src,
53 53
             $w,
54 54
             $h = 0,
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
             global $flyntResizedImages;
74 74
             if (empty($flyntResizedImages)) {
75
-                add_action('shutdown', function () {
75
+                add_action('shutdown', function() {
76 76
                     storeResizedUrls();
77 77
                 }, -1);
78 78
             }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     return $twig;
92 92
 });
93 93
 
94
-Routes::map(IMAGE_ROUTE, function () {
94
+Routes::map(IMAGE_ROUTE, function() {
95 95
     $uploadDirRelative = getRelativeUploadDir();
96 96
     $src = str_replace(
97 97
         trailingslashit($uploadDirRelative) . IMAGE_PATH_SEPARATOR,
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
     if ($localDev) {
116 116
         $src = http_build_url($homeUrl, ['path' => $urlParts['path']]);
117 117
     }
118
-    $moveImageFunction = function ($location) use ($uploadDirRelative) {
118
+    $moveImageFunction = function($location) use ($uploadDirRelative) {
119 119
         return str_replace(
120 120
             $uploadDirRelative,
121 121
             trailingslashit($uploadDirRelative) . IMAGE_PATH_SEPARATOR,
@@ -191,11 +191,11 @@  discard block
 block discarded – undo
191 191
 
192 192
 add_filter('mod_rewrite_rules', 'Flynt\\TimberDynamicResize\\addRewriteRule');
193 193
 
194
-add_action('after_switch_theme', function () {
194
+add_action('after_switch_theme', function() {
195 195
     add_action('shutdown', 'flush_rewrite_rules');
196 196
 });
197 197
 
198
-add_action('switch_theme', function () {
198
+add_action('switch_theme', function() {
199 199
     remove_filter('mod_rewrite_rules', 'Flynt\\TimberDynamicResize\\addRewriteRule');
200 200
     flush_rewrite_rules();
201 201
 });
Please login to merge, or discard this patch.