Passed
Pull Request — master (#169)
by
unknown
05:01
created
Components/SliderImages/functions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 use Flynt\Api;
6 6
 use Flynt\Utils\Options;
7 7
 
8
-add_filter('Flynt/addComponentData?name=SliderImages', function ($data) {
8
+add_filter('Flynt/addComponentData?name=SliderImages', function($data) {
9 9
     $translatableOptions = Options::getTranslatable('SliderOptions');
10 10
     $data['jsonData'] = [
11 11
         'options' => array_merge($translatableOptions, $data['options']),
Please login to merge, or discard this patch.
inc/acf.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 
4 4
 use Flynt\Utils\Options;
5 5
 
6
-add_filter('pre_http_request', function ($preempt, $args, $url) {
6
+add_filter('pre_http_request', function($preempt, $args, $url) {
7 7
     if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) {
8 8
         $response = wp_cache_get($url, 'oembedCache');
9 9
         if (!empty($response)) {
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
13 13
     return false;
14 14
 }, 10, 3);
15 15
 
16
-add_filter('http_response', function ($response, $args, $url) {
16
+add_filter('http_response', function($response, $args, $url) {
17 17
     if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) {
18 18
         wp_cache_set($url, $response, 'oembedCache');
19 19
     }
20 20
     return $response;
21 21
 }, 10, 3);
22 22
 
23
-add_filter('acf/fields/google_map/api', function ($api) {
23
+add_filter('acf/fields/google_map/api', function($api) {
24 24
     $apiKey = Options::getGlobal('Acf', 'googleMapsApiKey');
25 25
     if ($apiKey) {
26 26
         $api['key'] = $apiKey;
Please login to merge, or discard this patch.
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/timberDynamicResize.php 1 patch
Spacing   +7 added lines, -7 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 Twig_SimpleFilter('resizeDynamic', function (
51
+        new Twig_SimpleFilter('resizeDynamic', function(
52 52
             $src,
53 53
             $w,
54 54
             $h = 0,
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     return $twig;
93 93
 });
94 94
 
95
-Routes::map(IMAGE_ROUTE, function () {
95
+Routes::map(IMAGE_ROUTE, function() {
96 96
     $uploadDirRelative = getRelativeUploadDir();
97 97
     $src = str_replace(
98 98
         trailingslashit($uploadDirRelative) . IMAGE_PATH_SEPARATOR,
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     if ($localDev) {
117 117
         $src = http_build_url($homeUrl, ['path' => $urlParts['path']]);
118 118
     }
119
-    $moveImageFunction = function ($location) use ($uploadDirRelative) {
119
+    $moveImageFunction = function($location) use ($uploadDirRelative) {
120 120
         return str_replace(
121 121
             $uploadDirRelative,
122 122
             trailingslashit($uploadDirRelative) . IMAGE_PATH_SEPARATOR,
@@ -192,11 +192,11 @@  discard block
 block discarded – undo
192 192
 
193 193
 add_filter('mod_rewrite_rules', 'Flynt\\TimberDynamicResize\\addRewriteRule');
194 194
 
195
-add_action('after_switch_theme', function () {
195
+add_action('after_switch_theme', function() {
196 196
     add_action('shutdown', 'flush_rewrite_rules');
197 197
 });
198 198
 
199
-add_action('switch_theme', function () {
199
+add_action('switch_theme', function() {
200 200
     remove_filter('mod_rewrite_rules', 'Flynt\\TimberDynamicResize\\addRewriteRule');
201 201
     flush_rewrite_rules();
202 202
 });
Please login to merge, or discard this patch.
Components/FeatureGoogleAnalytics/functions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 use Flynt\Utils\Options;
8 8
 
9 9
 
10
-add_filter('Flynt/addComponentData?name=FeatureGoogleAnalytics', function ($data) {
10
+add_filter('Flynt/addComponentData?name=FeatureGoogleAnalytics', function($data) {
11 11
 
12 12
     $googleAnalyticsOptions = Options::getGlobal('GoogleAnalytics');
13 13
 
Please login to merge, or discard this patch.