Completed
Push — constructionplanless ( cb84a3...5132cc )
by Dominik
01:29
created
inc/Utils/TwigExtensionFlynt.php 2 patches
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.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,16 +9,16 @@
 block discarded – undo
9 9
 
10 10
 class TwigExtensionFlynt extends Twig_Extension {
11 11
 
12
-	public function getName() {
13
-		return 'twig_extension_flynt';
14
-	}
12
+    public function getName() {
13
+        return 'twig_extension_flynt';
14
+    }
15 15
 
16
-	public function getFunctions() {
17
-		return array(
16
+    public function getFunctions() {
17
+        return array(
18 18
             new Twig_SimpleFunction('renderComponent', [$this, 'renderComponent'], array('needs_environment' => true, 'needs_context' => true, 'is_safe' => array('all'))),
19 19
             new Twig_SimpleFunction('renderFlexibleContent', [$this, 'renderFlexibleContent'], array('needs_environment' => true, 'needs_context' => true, 'is_safe' => array('all'))),
20
-		);
21
-	}
20
+        );
21
+    }
22 22
 
23 23
     public function renderFlexibleContent(Twig_Environment $env, $context, $fields, $withContext = true, $ignoreMissing = false, $sandboxed = false)
24 24
     {
Please login to merge, or discard this patch.
Features/TimberLoader/functions.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 // Convert ACF Field of type post_object to a Timber\Post and add all ACF Fields of that Post
21 21
 add_filter('acf/format_value/type=post_object', NS . 'formatPostObject', 100);
22 22
 
23
-add_filter('get_twig', function ($twig) {
23
+add_filter('get_twig', function($twig) {
24 24
     $twig->addExtension(new TwigExtensionFlynt());
25 25
     return $twig;
26 26
 });
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 function formatGallery($value)
37 37
 {
38 38
     if (!empty($value)) {
39
-        $value = array_map(function ($image) {
39
+        $value = array_map(function($image) {
40 40
             return new Image($image);
41 41
         }, $value);
42 42
     }
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
     return $value;
62 62
 }
63 63
 
64
-add_action('timber/twig/filters', function ($twig) {
65
-    $twig->addFunction(new \Twig_SimpleFunction('transparentPng', function ($aspect, $r = 0, $g = 0, $b = 0, $a = 127) {
64
+add_action('timber/twig/filters', function($twig) {
65
+    $twig->addFunction(new \Twig_SimpleFunction('transparentPng', function($aspect, $r = 0, $g = 0, $b = 0, $a = 127) {
66 66
         $ratio = aspectToRatio($aspect);
67 67
         //create image with specified sizes
68 68
         $image = imagecreatetruecolor($ratio['width'], $ratio['height']);
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     $k2 = 1;
92 92
     $b = 1 / $n;
93 93
     do {
94
-        $b = 1/$b;
94
+        $b = 1 / $b;
95 95
         $a = floor($b);
96 96
         $aux = $h1;
97 97
         $h1 = $a * $h1 + $h2;
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
     return crypt(serialize($args), NONCE_SALT);
114 114
 }
115 115
 
116
-add_action('timber/twig/filters', function ($twig) {
117
-    $twig->addFilter(new \Twig_SimpleFilter('resizeDynamic', function ($src, $w, $h = 0, $crop = 'default', $force = false) {
116
+add_action('timber/twig/filters', function($twig) {
117
+    $twig->addFilter(new \Twig_SimpleFilter('resizeDynamic', function($src, $w, $h = 0, $crop = 'default', $force = false) {
118 118
         $arguments = [
119 119
             'src' => $src,
120 120
             'w' => $w,
Please login to merge, or discard this patch.
inc/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
     }
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         }
34 34
 
35 35
         if (!$acfActive || !$flyntCoreActive) {
36
-            add_filter('template_include', function () {
36
+            add_filter('template_include', function() {
37 37
                 die(
38 38
                     'One or more required plugins are not activated! Please <a href="'
39 39
                     . esc_url(admin_url('plugins.php'))
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
     protected static function notifyRequiredPluginIsMissing($pluginName)
49 49
     {
50
-        add_action('admin_notices', function () use ($pluginName) {
50
+        add_action('admin_notices', function() use ($pluginName) {
51 51
             echo "<div class=\"error\"><p>${pluginName} Plugin not activated. Make sure you activate the plugin on the <a href=\""
52 52
                 . esc_url(admin_url('plugins.php')) . "\">plugin page</a>.</p></div>";
53 53
         });
Please login to merge, or discard this patch.
inc/assets.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 use Flynt\Utils\Asset;
4 4
 
5
-add_action('wp_enqueue_scripts', function () {
5
+add_action('wp_enqueue_scripts', function() {
6 6
     Asset::register([
7 7
         'name' => 'console-polyfill',
8 8
         'type' => 'script',
Please login to merge, or discard this patch.