Completed
Push — componentlibrary ( de047a...3436b7 )
by
unknown
02:06
created
Features/PasswordForm/functions.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace Flynt\Features\PasswordForm;
4 4
 
5 5
 use Timber\Timber;
6
-use Timber\Post;
7 6
 
8 7
 add_filter('the_password_form', function ($output) {
9 8
     $context = Timber::get_context();
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 add_filter('the_password_form', function ($output) {
9 9
     $context = Timber::get_context();
10 10
     $context['form'] = [
11
-      'url' => site_url('/wp-login.php?action=postpass', 'login_post')
11
+        'url' => site_url('/wp-login.php?action=postpass', 'login_post')
12 12
     ];
13 13
 
14 14
     return Timber::fetch('index.twig', $context);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 use Timber\Timber;
6 6
 use Timber\Post;
7 7
 
8
-add_filter('the_password_form', function ($output) {
8
+add_filter('the_password_form', function($output) {
9 9
     $context = Timber::get_context();
10 10
     $context['form'] = [
11 11
       'url' => site_url('/wp-login.php?action=postpass', 'login_post')
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, 'Component', $componentName));
19 19
     }, []);
20 20
     // don't overwrite existing data
Please login to merge, or discard this patch.
lib/Utils/Feature.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
      *
16 16
      * @since 0.1.0
17 17
      *
18
-     * @param string $feature Name of the feature.
18
+     * @param string $featureName Name of the feature.
19 19
      *
20 20
      * @return array|null Returns an array of options or null if the feature wasn't found.
21 21
      */
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      *
33 33
      * @since 0.1.0
34 34
      *
35
-     * @param string $feature Name of the feature.
35
+     * @param string $featureName Name of the feature.
36 36
      * @param string $key The option key.
37 37
      *
38 38
      * @return mixed|null Returns the option or null if the option / the feature doesn't exist.
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
      *
64 64
      * @since 0.1.0
65 65
      *
66
-     * @param string $feature Name of the feature.
66
+     * @param string $featureName Name of the feature.
67 67
      * @param string $basePath The feature base path.
68 68
      * @param array $options An array of options. Optional.
69 69
      *
70
-     * @return boolean
70
+     * @return boolean|null
71 71
      */
72 72
     public static function register($featureName, $basePath, $options = [])
73 73
     {
Please login to merge, or discard this patch.
lib/Utils/TwigExtensionFlynt.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -29,6 +29,9 @@
 block discarded – undo
29 29
         return $output;
30 30
     }
31 31
 
32
+    /**
33
+     * @param string $componentName
34
+     */
32 35
     public function renderComponent(Twig_Environment $env, $context, $componentName, $data = [], $withContext = true, $ignoreMissing = false, $sandboxed = false)
33 36
     {
34 37
         $data = $this->getComponentData($data, $componentName);
Please login to merge, or discard this patch.
lib/Init.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     public static function setTemplateDirectory()
44 44
     {
45
-        add_action('after_switch_theme', function () {
45
+        add_action('after_switch_theme', function() {
46 46
             $stylesheet = get_option('stylesheet');
47 47
 
48 48
             if (basename($stylesheet) !== 'templates') {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             }
51 51
         });
52 52
 
53
-        add_filter('stylesheet', function ($stylesheet) {
53
+        add_filter('stylesheet', function($stylesheet) {
54 54
             return dirname($stylesheet);
55 55
         });
56 56
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         }
70 70
 
71 71
         if (!$acfActive || !$flyntCoreActive) {
72
-            add_filter('template_include', function () {
72
+            add_filter('template_include', function() {
73 73
                 die(
74 74
                     'One or more required plugins are not activated! Please <a href="'
75 75
                     . esc_url(admin_url('plugins.php'))
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
     protected static function notifyRequiredPluginIsMissing($pluginName)
85 85
     {
86
-        add_action('admin_notices', function () use ($pluginName) {
86
+        add_action('admin_notices', function() use ($pluginName) {
87 87
             echo "<div class=\"error\"><p>${pluginName} Plugin not activated. Make sure you activate the plugin on the <a href=\""
88 88
                 . esc_url(admin_url('plugins.php')) . "\">plugin page</a>.</p></div>";
89 89
         });
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
@@ -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.