Completed
Push — componentlibrary-svgplaceholde... ( e44b76 )
by
unknown
01:18
created
Features/TimberLoader/functions.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
         return $output;
40 40
     }
41 41
 
42
-    $addArea = function ($twig) use ($areaHtml) {
42
+    $addArea = function($twig) use ($areaHtml) {
43 43
 
44
-        $twig->addFunction(new Twig_SimpleFunction('area', function ($areaName) use ($areaHtml) {
44
+        $twig->addFunction(new Twig_SimpleFunction('area', function($areaName) use ($areaHtml) {
45 45
             if (array_key_exists($areaName, $areaHtml)) {
46 46
                 return $areaHtml[$areaName];
47 47
             }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
     add_filter('get_twig', $addArea);
54 54
 
55
-    $returnTimberPaths = function ($paths) use ($filePath) {
55
+    $returnTimberPaths = function($paths) use ($filePath) {
56 56
         array_unshift($paths, dirname($filePath));
57 57
         return $paths;
58 58
     };
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 function formatGallery($value)
80 80
 {
81 81
     if (!empty($value)) {
82
-        $value = array_map(function ($image) {
82
+        $value = array_map(function($image) {
83 83
             return new Image($image);
84 84
         }, $value);
85 85
     }
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
     return $value;
105 105
 }
106 106
 
107
-add_action('timber/twig/filters', function ($twig) {
108
-    $twig->addFunction(new \Twig_SimpleFunction('placeholderImage', function ($width, $height, $color = null) {
107
+add_action('timber/twig/filters', function($twig) {
108
+    $twig->addFunction(new \Twig_SimpleFunction('placeholderImage', function($width, $height, $color = null) {
109 109
         $colorRect = $color ? "<rect width='{$width}' height='{$height}' style='fill:$color' />" : '';
110 110
         $svg = "<svg width='{$width}' height='{$height}' xmlns='http://www.w3.org/2000/svg'>{$colorRect}</svg>";
111 111
         return "data:image/svg+xml;base64," . base64_encode($svg);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
     $k2 = 1;
123 123
     $b = 1 / $n;
124 124
     do {
125
-        $b = 1/$b;
125
+        $b = 1 / $b;
126 126
         $a = floor($b);
127 127
         $aux = $h1;
128 128
         $h1 = $a * $h1 + $h2;
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
     return crypt(serialize($args), NONCE_SALT);
145 145
 }
146 146
 
147
-add_action('timber/twig/filters', function ($twig) {
148
-    $twig->addFilter(new \Twig_SimpleFilter('resizeDynamic', function ($src, $w, $h = 0, $crop = 'default', $force = false) {
147
+add_action('timber/twig/filters', function($twig) {
148
+    $twig->addFilter(new \Twig_SimpleFilter('resizeDynamic', function($src, $w, $h = 0, $crop = 'default', $force = false) {
149 149
         $arguments = [
150 150
             'src' => $src,
151 151
             'w' => $w,
Please login to merge, or discard this patch.