Completed
Push — componentlibrary_bundles ( 9364ee )
by Dominik
02:25
created
lib/Utils/Options.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             acf_add_local_field_group($fieldGroup);
86 86
         }
87 87
 
88
-        add_action('current_screen', function ($currentScreen) {
88
+        add_action('current_screen', function($currentScreen) {
89 89
             foreach (static::OPTION_TYPES as $optionType => $option) {
90 90
                 $isTranslatable = $option['translatable'];
91 91
                 $toplevelPageId = 'toplevel_page_' . $optionType;
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                     add_filter('acf/settings/current_language', 'Flynt\Features\Acf\OptionPages::getDefaultAcfLanguage', 101);
100 100
 
101 101
                     // hide language selector in admin bar
102
-                    add_action('wp_before_admin_bar_render', function () {
102
+                    add_action('wp_before_admin_bar_render', function() {
103 103
                         $adminBar = $GLOBALS['wp_admin_bar'];
104 104
                         $adminBar->remove_menu('WPML_ALS');
105 105
                     });
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
     protected static function prefixFields($fields, $prefix)
220 220
     {
221
-        return array_map(function ($field) use ($prefix) {
221
+        return array_map(function($field) use ($prefix) {
222 222
             $field['name'] = $prefix . '_' . $field['name'];
223 223
             return $field;
224 224
         }, $fields);
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     protected static function collectOptionsWithPrefix($options, $prefix)
283 283
     {
284 284
         $optionKeys = is_array($options) ? array_keys($options) : [];
285
-        return array_reduce($optionKeys, function ($carry, $key) use ($options, $prefix) {
285
+        return array_reduce($optionKeys, function($carry, $key) use ($options, $prefix) {
286 286
             $count = 0;
287 287
             $option = $options[$key];
288 288
             $key = str_replace($prefix, '', $key, $count);
Please login to merge, or discard this patch.
lib/Utils/Asset.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -149,10 +149,10 @@
 block discarded – undo
149 149
         }
150 150
         if ($type === 'style') {
151 151
             global $wp_styles;
152
-            $repo =& $wp_styles;
152
+            $repo = & $wp_styles;
153 153
         } else {
154 154
             global $wp_scripts;
155
-            $repo =& $wp_scripts;
155
+            $repo = & $wp_scripts;
156 156
         }
157 157
 
158 158
         $asset = $repo->query($handle, 'registered');
Please login to merge, or discard this patch.
lib/Utils/Component.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
         }
14 14
 
15 15
         // collect script dependencies
16
-        $scriptDeps = array_reduce($dependencies, function ($list, $dependency) {
16
+        $scriptDeps = array_reduce($dependencies, function($list, $dependency) {
17 17
             if ($dependency['type'] === 'script') {
18 18
                 array_push($list, $dependency['name']);
19 19
             }
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         }, []); // jquery as a default dependency
22 22
 
23 23
         // collect style dependencies
24
-        $styleDeps = array_reduce($dependencies, function ($list, $dependency) {
24
+        $styleDeps = array_reduce($dependencies, function($list, $dependency) {
25 25
             if ($dependency['type'] === 'style') {
26 26
                 array_push($list, $dependency['name']);
27 27
             }
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         }, []);
30 30
 
31 31
         if (!empty($scriptDeps) || !empty($styleDeps)) {
32
-            add_action('wp_enqueue_scripts', function () use ($scriptDeps, $styleDeps) {
32
+            add_action('wp_enqueue_scripts', function() use ($scriptDeps, $styleDeps) {
33 33
                 Asset::addDependencies('Flynt/assets', $scriptDeps);
34 34
                 Asset::addDependencies('Flynt/assets', $styleDeps, 'style');
35 35
             }, 11);
Please login to merge, or discard this patch.
lib/Core/Flynt/Defaults.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         return $output;
28 28
     }
29 29
 
30
-  // this action needs to be removed by the user if they want to overwrite this functionality
30
+    // this action needs to be removed by the user if they want to overwrite this functionality
31 31
     public static function loadFunctionsFile($componentName)
32 32
     {
33 33
         $componentManager = ComponentManager::getInstance();
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,13 +48,13 @@
 block discarded – undo
48 48
             return '';
49 49
         }
50 50
 
51
-        $area = function ($areaName) use ($areaHtml) {
51
+        $area = function($areaName) use ($areaHtml) {
52 52
             if (array_key_exists($areaName, $areaHtml)) {
53 53
                 return $areaHtml[$areaName];
54 54
             }
55 55
         };
56 56
 
57
-        $data = function () use ($componentData) {
57
+        $data = function() use ($componentData) {
58 58
             $args = func_get_args();
59 59
             array_unshift($args, $componentData);
60 60
             return Helpers::extractNestedDataFromArray($args);
Please login to merge, or discard this patch.
lib/Core/Flynt/ComponentManager.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,20 +15,20 @@
 block discarded – undo
15 15
         return self::$instance;
16 16
     }
17 17
 
18
-  /**
19
-   * clone
20
-   *
21
-   * Prevent cloning with 'protected' keyword
22
-  **/
18
+    /**
19
+     * clone
20
+     *
21
+     * Prevent cloning with 'protected' keyword
22
+     **/
23 23
     protected function __clone()
24 24
     {
25 25
     }
26 26
 
27
-  /**
28
-   * constructor
29
-   *
30
-   * Prevent instantiation with 'protected' keyword
31
-  **/
27
+    /**
28
+     * constructor
29
+     *
30
+     * Prevent instantiation with 'protected' keyword
31
+     **/
32 32
     protected function __construct()
33 33
     {
34 34
     }
Please login to merge, or discard this patch.
lib/Core/Flynt.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     return is_null($output) ? '' : $output;
45 45
 }
46 46
 
47
-add_filter('Flynt/renderComponent', function ($output, $componentName, $data) {
47
+add_filter('Flynt/renderComponent', function($output, $componentName, $data) {
48 48
     return apply_filters(
49 49
         "Flynt/renderComponent?name={$componentName}",
50 50
         $output,
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     );
54 54
 }, 10, 3);
55 55
 
56
-add_filter('Flynt/addComponentData', function ($data, $componentName) {
56
+add_filter('Flynt/addComponentData', function($data, $componentName) {
57 57
     return apply_filters(
58 58
         "Flynt/addComponentData?name={$componentName}",
59 59
         $data,
Please login to merge, or discard this patch.
Features/AdminComponentPreview/functions.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 
6 6
 define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\');
7 7
 
8
-add_action('wp_enqueue_scripts', function () {
8
+add_action('wp_enqueue_scripts', function() {
9 9
     if (is_user_logged_in()) {
10 10
         Asset::register([
11 11
             'type' => 'script',
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     wp_localize_script('Flynt/assets/auth', 'wpData', $data);
21 21
 });
22 22
 
23
-add_action('wp_admin_enqueue_scripts', function () {
23
+add_action('wp_admin_enqueue_scripts', function() {
24 24
     $data = [
25 25
         'templateDirectoryUri' => get_template_directory_uri() . '/dist',
26 26
     ];
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     if (is_user_logged_in() || is_admin()) {
32 32
         if (is_admin()) {
33 33
             // add image to the flexible content component name
34
-            add_filter('acf/fields/flexible_content/layout_title', function ($title, $field, $layout, $i) {
34
+            add_filter('acf/fields/flexible_content/layout_title', function($title, $field, $layout, $i) {
35 35
                 $componentName = ucfirst($layout['name']);
36 36
                 $componentPath = "Components/{$componentName}";
37 37
                 $componentPreviewDesktopPath = Asset::requirePath("{$componentPath}/preview-desktop.jpg");
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             }, 11, 4);
48 48
         } else {
49 49
             // adds Component Previews button to admin bar on front-end when logged in
50
-            add_action('admin_bar_menu', function ($wpAdminBar) {
50
+            add_action('admin_bar_menu', function($wpAdminBar) {
51 51
                 $title = __('Component Previews', 'flynt-starter-theme');
52 52
                 $wpAdminBar->add_node([
53 53
                     'id' => 'toggleComponentPreviews',
Please login to merge, or discard this patch.
inc/theme.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-add_action('after_setup_theme', function () {
3
+add_action('after_setup_theme', function() {
4 4
     add_theme_support('title-tag');
5 5
     add_theme_support('post-thumbnails');
6 6
 });
Please login to merge, or discard this patch.
inc/assets.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 use Flynt\Utils\Asset;
4 4
 
5
-add_action('wp_enqueue_scripts', function () {
5
+add_action('wp_enqueue_scripts', function() {
6 6
     Asset::register([
7 7
         'name' => 'console-polyfill',
8 8
         'type' => 'script',
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     }
62 62
 });
63 63
 
64
-add_action('admin_enqueue_scripts', function () {
64
+add_action('admin_enqueue_scripts', function() {
65 65
     Asset::enqueue([
66 66
         'name' => 'Flynt/assets/admin',
67 67
         'path' => 'assets/admin.js',
Please login to merge, or discard this patch.