Completed
Pull Request — componentlibrary (#305)
by Doğa
02:07 queued 18s
created
lib/Utils/ArrayHelpers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@
 block discarded – undo
34 34
      */
35 35
     public static function indexedValuesToAssocKeys(array $array)
36 36
     {
37
-        $values = array_map(function ($value) {
37
+        $values = array_map(function($value) {
38 38
             return is_array($value) ? $value : [];
39 39
         }, $array);
40 40
 
41
-        $keys = array_map(function ($key) use ($array) {
41
+        $keys = array_map(function($key) use ($array) {
42 42
             return is_int($key) ? $array[$key] : $key;
43 43
         }, array_keys($array));
44 44
 
Please login to merge, or discard this patch.
Features/BaseStyle/functions.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Flynt\Features\BaseStyle;
4 4
 
5
-use Timber\Timber;
6
-use Flynt\ComponentManager;
7
-
8 5
 if (current_user_can('editor') || (WP_ENV !== 'production')) {
9 6
     add_filter('init', 'Flynt\Features\BaseStyle\registerRewriteRule');
10 7
     add_filter('template_include', 'Flynt\Features\BaseStyle\templateInclude');
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
 function disallowRobots()
17 17
 {
18 18
     if (defined('WPSEO_VERSION')) {
19
-        add_filter('wpseo_robots', function () {
19
+        add_filter('wpseo_robots', function() {
20 20
             return "noindex,nofollow";
21 21
         });
22 22
     } else {
23 23
         remove_action('wp_head', 'noindex', 1);
24
-        add_action('wp_head', function () {
24
+        add_action('wp_head', function() {
25 25
             echo "<meta name='robots' content='noindex,nofollow' />\n";
26 26
         });
27 27
     }
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
     $rules = get_option('rewrite_rules');
38 38
 
39
-    if (! isset($rules["{$routeName}/(.*?)/?$"])) {
39
+    if (!isset($rules["{$routeName}/(.*?)/?$"])) {
40 40
         flush_rewrite_rules();
41 41
     }
42 42
 }
Please login to merge, or discard this patch.
Features/YoutubeNoCookieEmbed/functions.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Flynt\Features\YoutubeNoCookieEmbed;
4 4
 
5
-use Flynt\Utils\Oembed;
6
-
7 5
 add_action('oembed_result', 'Flynt\Features\YoutubeNoCookieEmbed\setNoCookieDomain', 10, 2);
8 6
 add_filter('embed_oembed_html', 'Flynt\Features\YoutubeNoCookieEmbed\setNoCookieDomain', 10, 2);
9 7
 
Please login to merge, or discard this patch.
Features/Acf/functions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 add_action('Flynt/afterRegisterFeatures', 'Flynt\Features\Acf\Loader::init');
17 17
 
18
-add_filter('pre_http_request', function ($preempt, $args, $url) {
18
+add_filter('pre_http_request', function($preempt, $args, $url) {
19 19
     if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) {
20 20
         $response = wp_cache_get($url, 'oembedCache');
21 21
         if (!empty($response)) {
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     return false;
26 26
 }, 10, 3);
27 27
 
28
-add_filter('http_response', function ($response, $args, $url) {
28
+add_filter('http_response', function($response, $args, $url) {
29 29
     if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) {
30 30
         wp_cache_set($url, $response, 'oembedCache');
31 31
     }
Please login to merge, or discard this patch.
Features/Acf/FlexibleContentToggle.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
     {
15 15
         if (is_admin()) {
16 16
             // adds buttons to collapse/expand components
17
-            add_filter('acf/get_field_label', function ($label, $field) {
17
+            add_filter('acf/get_field_label', function($label, $field) {
18 18
                 if ($field['type'] === 'flexible_content') {
19 19
                     $label .= '<span class="flexible-content-controls">';
20 20
                     $label .= '<span class="flexible-content-control"><a class="acf-icon small -collapse collapse-all" title="collapse all"></a></span>';
Please login to merge, or discard this patch.
Features/Acf/GoogleMaps.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public static function init()
10 10
     {
11
-        add_filter('acf/fields/google_map/api', function ($api) {
11
+        add_filter('acf/fields/google_map/api', function($api) {
12 12
             $apiKey = Options::get('globalOptions', 'feature', 'Acf', 'googleMapsApiKey');
13 13
             if ($apiKey) {
14 14
                 $api['key'] = $apiKey;
Please login to merge, or discard this patch.
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.