Completed
Push — baseComponentsListPosts ( 2a73c9 )
by Markus
02:48
created
lib/Bootstrap.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 {
7 7
     public static function setTemplateDirectory()
8 8
     {
9
-        add_action('after_switch_theme', function () {
9
+        add_action('after_switch_theme', function() {
10 10
             $stylesheet = get_option('stylesheet');
11 11
 
12 12
             if (basename($stylesheet) !== 'templates') {
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
             }
15 15
         });
16 16
 
17
-        add_filter('stylesheet', function ($stylesheet) {
17
+        add_filter('stylesheet', function($stylesheet) {
18 18
             return dirname($stylesheet);
19 19
         });
20 20
     }
@@ -24,13 +24,13 @@  discard block
 block discarded – undo
24 24
         $pluginActive = class_exists('\\Flynt\\Render');
25 25
 
26 26
         if (!$pluginActive) {
27
-            add_action('admin_notices', function () {
27
+            add_action('admin_notices', function() {
28 28
                 echo '<div class="error"><p>Flynt Core Plugin not activated. Make sure you activate the plugin in <a href="'
29 29
                     . esc_url(admin_url('plugins.php#flynt')) . '">'
30 30
                     . esc_url(admin_url('plugins.php')) . '</a></p></div>';
31 31
             });
32 32
 
33
-            add_filter('template_include', function () {
33
+            add_filter('template_include', function() {
34 34
                 $newTemplate = locate_template(['plugin-inactive.php']);
35 35
                 if ('' != $newTemplate) {
36 36
                     return $newTemplate;
Please login to merge, or discard this patch.
lib/Init.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
     }
85 85
 
86 86
     // Filter out other (non-flynt) theme features
87
-    $flyntThemeFeatures = array_filter($GLOBALS['_wp_theme_features'], function ($feature) {
87
+    $flyntThemeFeatures = array_filter($GLOBALS['_wp_theme_features'], function($feature) {
88 88
         return StringHelpers::startsWith('flynt-', $feature);
89 89
     }, ARRAY_FILTER_USE_KEY);
90 90
 
Please login to merge, or discard this patch.
lib/Utils/Log.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 
17 17
     public static function consoleDebug($data, $title = 'PHP', $logType = 'log')
18 18
     {
19
-        $title .= '(' . self::getCallerFile(2) .'):';
19
+        $title .= '(' . self::getCallerFile(2) . '):';
20 20
         $type = gettype($data);
21 21
         if (is_array($data) || is_object($data)) {
22 22
             $output = json_encode($data);
Please login to merge, or discard this patch.
lib/Utils/FileLoader.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
         if (count($files) === 0) {
45 45
             $dir = get_template_directory() . '/' . $dir;
46 46
 
47
-            self::iterateDir($dir, function ($file) {
47
+            self::iterateDir($dir, function($file) {
48 48
                 if ($file->isDir()) {
49 49
                     $dirPath = trim(str_replace(get_template_directory(), '', $file->getPathname()), '/');
50 50
                     self::loadPhpFiles($dirPath);
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
                 }
55 55
             });
56 56
         } else {
57
-            array_walk($files, function ($file) use ($dir) {
57
+            array_walk($files, function($file) use ($dir) {
58 58
                 $filePath = $dir . '/' . ltrim($file, '/');
59 59
 
60 60
                 if (!locate_template($filePath, true, true)) {
Please login to merge, or discard this patch.
lib/Utils/ArrayHelpers.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,18 +17,18 @@
 block discarded – undo
17 17
     // only converts first dimension of object
18 18
     public static function objectToArray($obj)
19 19
     {
20
-        return array_map(function ($val) {
20
+        return array_map(function($val) {
21 21
             return (array) $val;
22 22
         }, $obj);
23 23
     }
24 24
 
25 25
     public static function indexedValuesToAssocKeys(array $array)
26 26
     {
27
-        $values = array_map(function ($value) {
27
+        $values = array_map(function($value) {
28 28
             return is_array($value) ? $value : [];
29 29
         }, $array);
30 30
 
31
-        $keys = array_map(function ($key) use ($array) {
31
+        $keys = array_map(function($key) use ($array) {
32 32
             return is_int($key) ? $array[$key] : $key;
33 33
         }, array_keys($array));
34 34
 
Please login to merge, or discard this patch.
Features/CustomPostTypes/Translator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         if (is_array($value)) {
52 52
             // Loop through array and apply translations while keeping keys intact
53 53
             // NOTE: assuming it's a single dimensional array
54
-            return array_reduce(array_keys($value), function ($carry, $key) use ($value) {
54
+            return array_reduce(array_keys($value), function($carry, $key) use ($value) {
55 55
                 return array_merge($carry, [
56 56
                     $key => _x($value[$key], $key, 'flynt-starter-theme')
57 57
                 ]);
Please login to merge, or discard this patch.
lib/Utils/TimberHelper.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,23 +5,23 @@  discard block
 block discarded – undo
5 5
 use Timber\Post;
6 6
 
7 7
 class TimberHelper {
8
-  public static function getTimberPostById($postId, $moreLinkText = null, $stripteaser = false) {
8
+    public static function getTimberPostById($postId, $moreLinkText = null, $stripteaser = false) {
9 9
     global $post;
10 10
     $post = get_post($postId);
11 11
     setup_postdata($post, $moreLinkText, $stripteaser);
12 12
     $timberPost = new Post($post);
13 13
     wp_reset_postdata($post);
14 14
     return $timberPost;
15
-  }
15
+    }
16 16
 
17
-  public static function getExcerpt(
17
+    public static function getExcerpt(
18 18
     $postId,
19 19
     $len = 50,
20 20
     $force = false,
21 21
     $readmore = "Read More",
22 22
     $strip = true,
23 23
     $end = "&hellip;"
24
-  ) {
24
+    ) {
25 25
     global $post;
26 26
     $post = get_post($postId);
27 27
     setup_postdata($post, null, false);
@@ -29,5 +29,5 @@  discard block
 block discarded – undo
29 29
     $excerpt = $timberPost->get_preview($len, $force, $readmore, $strip, $end);
30 30
     wp_reset_postdata($post);
31 31
     return $excerpt;
32
-  }
32
+    }
33 33
 }
Please login to merge, or discard this patch.
Components/ListPosts/functions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@
 block discarded – undo
4 4
 
5 5
 use Flynt\Features\Components\Component;
6 6
 
7
-add_action('wp_enqueue_scripts', function () {
7
+add_action('wp_enqueue_scripts', function() {
8 8
     Component::enqueueAssets('ListPosts');
9 9
 });
10 10
 
11
-add_filter('Flynt/addComponentData?name=ListPosts', function ($data, $parentData) {
11
+add_filter('Flynt/addComponentData?name=ListPosts', function($data, $parentData) {
12 12
     $data['isArchive'] = is_home() || is_archive() ? true : false;
13 13
 
14 14
     $data['pagination'] = (isset($parentData['pagination'])) ? $parentData['pagination'] : null;
Please login to merge, or discard this patch.