Passed
Pull Request — master (#258)
by
unknown
03:41
created
inc/timberLoader.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
 // Convert ACF Field of type relationship to a Timber\Post and add all ACF Fields of that Post
31 31
 add_filter('acf/format_value/type=relationship', NS . 'formatPostObject', 100);
32
-add_filter('get_twig', function ($twig) {
32
+add_filter('get_twig', function($twig) {
33 33
     $twig->addExtension(new TwigExtensionFlynt());
34 34
     return $twig;
35 35
 });
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 function formatGallery($value)
46 46
 {
47 47
     if (!empty($value)) {
48
-        $value = array_map(function ($image) {
48
+        $value = array_map(function($image) {
49 49
             return new Image($image);
50 50
         }, $value);
51 51
     }
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
     return $value;
71 71
 }
72 72
 
73
-add_action('timber/twig/filters', function ($twig) {
74
-    $twig->addFunction(new TwigFunction('placeholderImage', function ($width, $height, $color = null) {
73
+add_action('timber/twig/filters', function($twig) {
74
+    $twig->addFunction(new TwigFunction('placeholderImage', function($width, $height, $color = null) {
75 75
         $width = round($width);
76 76
         $height = round($height);
77 77
         $colorRect = $color ? "<rect width='{$width}' height='{$height}' style='fill:$color' />" : '';
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         return "data:image/svg+xml;base64," . base64_encode($svg);
80 80
     }));
81 81
 
82
-    $twig->addFunction(new TwigFunction('requireUrl', function ($asset) {
82
+    $twig->addFunction(new TwigFunction('requireUrl', function($asset) {
83 83
         return Asset::requireUrl($asset);
84 84
     }));
85 85
 
Please login to merge, or discard this patch.
inc/customizer-colors.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     ],
119 119
 ];
120 120
 
121
-add_action('customize_register', function ($wp_customize) use ($colorsDefault, $colorsLight, $colorsDark, $colorsHero) {
121
+add_action('customize_register', function($wp_customize) use ($colorsDefault, $colorsLight, $colorsDark, $colorsHero) {
122 122
     $wp_customize->add_panel(
123 123
         'theme_colors_panel',
124 124
         [
@@ -261,11 +261,11 @@  discard block
 block discarded – undo
261 261
     }
262 262
 });
263 263
 
264
-add_action('customize_preview_init', function () {
264
+add_action('customize_preview_init', function() {
265 265
     wp_enqueue_script(
266 266
         'customizer-colors',
267 267
         Asset::requireUrl('assets/customizer-colors.js'),
268
-        array('jquery','customize-preview'),
268
+        array('jquery', 'customize-preview'),
269 269
         '',
270 270
         true
271 271
     );
@@ -287,15 +287,15 @@  discard block
 block discarded – undo
287 287
 
288 288
     // Check if color has 6 or 3 characters and get values
289 289
     if (strlen($color) == 6) {
290
-            $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] );
290
+            $hex = array($color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5]);
291 291
     } elseif (strlen($color) == 3) {
292
-            $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] );
292
+            $hex = array($color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2]);
293 293
     } else {
294 294
             return $default;
295 295
     }
296 296
 
297 297
     // Convert hexadec to rgb
298
-    $rgb =  array_map('hexdec', $hex);
298
+    $rgb = array_map('hexdec', $hex);
299 299
 
300 300
     // Check if opacity is set(rgba or rgb)
301 301
     if ($opacity) {
@@ -352,23 +352,23 @@  discard block
 block discarded – undo
352 352
     return $hash . $hex;
353 353
 }
354 354
 
355
-add_action('wp_head', function () use ($colorsDefault, $colorsLight, $colorsDark, $colorsHero) {
356
-    $hasChangedDefault = array_filter($colorsDefault, function ($color, $name) {
355
+add_action('wp_head', function() use ($colorsDefault, $colorsLight, $colorsDark, $colorsHero) {
356
+    $hasChangedDefault = array_filter($colorsDefault, function($color, $name) {
357 357
         $value = get_theme_mod('theme_colors_' . $name, $color['default']);
358 358
         return $value !== $color['default'];
359 359
     }, ARRAY_FILTER_USE_BOTH);
360 360
 
361
-    $hasChangedLight = array_filter($colorsLight, function ($color, $name) {
361
+    $hasChangedLight = array_filter($colorsLight, function($color, $name) {
362 362
         $value = get_theme_mod('theme_colors_' . $name, $color['default']);
363 363
         return $value !== $color['default'];
364 364
     }, ARRAY_FILTER_USE_BOTH);
365 365
 
366
-    $hasChangedDark = array_filter($colorsDark, function ($color, $name) {
366
+    $hasChangedDark = array_filter($colorsDark, function($color, $name) {
367 367
         $value = get_theme_mod('theme_colors_' . $name, $color['default']);
368 368
         return $value !== $color['default'];
369 369
     }, ARRAY_FILTER_USE_BOTH);
370 370
 
371
-    $hasChangedHero = array_filter($colorsHero, function ($color, $name) {
371
+    $hasChangedHero = array_filter($colorsHero, function($color, $name) {
372 372
         $value = get_theme_mod('theme_colors_' . $name, $color['default']);
373 373
         return $value !== $color['default'];
374 374
     }, ARRAY_FILTER_USE_BOTH);
Please login to merge, or discard this patch.