Completed
Push — componentlibrary_bundles ( 9364ee )
by Dominik
02:25
created
Components/NavigationFooter/functions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
 use Flynt\Utils\Component;
6 6
 use Timber\Menu;
7 7
 
8
-add_action('init', function () {
8
+add_action('init', function() {
9 9
     register_nav_menus([
10 10
         'navigation_footer' => __('Navigation Footer', 'flynt-starter-theme')
11 11
     ]);
12 12
 });
13 13
 
14
-add_filter('Flynt/addComponentData?name=NavigationFooter', function ($data) {
14
+add_filter('Flynt/addComponentData?name=NavigationFooter', function($data) {
15 15
     Component::enqueueAssets('NavigationFooter');
16 16
 
17 17
     $data['maxLevel'] = 0;
Please login to merge, or discard this patch.
Features/TimberLoader/functions.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
 // Convert ACF Field of type relationship to a Timber\Post and add all ACF Fields of that Post
24 24
 add_filter('acf/format_value/type=relationship', NS . 'formatPostObject', 100);
25
-add_filter('get_twig', function ($twig) {
25
+add_filter('get_twig', function($twig) {
26 26
     $twig->addExtension(new TwigExtensionFlynt());
27 27
     return $twig;
28 28
 });
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 function formatGallery($value)
39 39
 {
40 40
     if (!empty($value)) {
41
-        $value = array_map(function ($image) {
41
+        $value = array_map(function($image) {
42 42
             return new Image($image);
43 43
         }, $value);
44 44
     }
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
     return $value;
64 64
 }
65 65
 
66
-add_action('timber/twig/filters', function ($twig) {
67
-    $twig->addFunction(new \Twig_SimpleFunction('placeholderImage', function ($width, $height, $color = null) {
66
+add_action('timber/twig/filters', function($twig) {
67
+    $twig->addFunction(new \Twig_SimpleFunction('placeholderImage', function($width, $height, $color = null) {
68 68
         $width = round($width);
69 69
         $height = round($height);
70 70
         $colorRect = $color ? "<rect width='{$width}' height='{$height}' style='fill:$color' />" : '';
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
     return crypt(serialize($args), NONCE_SALT);
81 81
 }
82 82
 
83
-add_action('timber/twig/filters', function ($twig) {
84
-    $twig->addFilter(new \Twig_SimpleFilter('resizeDynamic', function ($src, $w, $h = 0, $crop = 'default', $force = false) {
83
+add_action('timber/twig/filters', function($twig) {
84
+    $twig->addFilter(new \Twig_SimpleFilter('resizeDynamic', function($src, $w, $h = 0, $crop = 'default', $force = false) {
85 85
         $arguments = [
86 86
             'src' => $src,
87 87
             'w' => $w,
Please login to merge, or discard this patch.
Components/ListFacts/functions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 use Flynt\Utils\Component;
6 6
 use Flynt;
7 7
 
8
-add_filter('Flynt/addComponentData?name=ListFacts', function ($data) {
8
+add_filter('Flynt/addComponentData?name=ListFacts', function($data) {
9 9
     Component::enqueueAssets('ListFacts', [
10 10
         [
11 11
             'name' => 'countup',
Please login to merge, or discard this patch.
Components/GridPostsSlider/functions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 use Flynt\Utils\Component;
6 6
 use Flynt;
7 7
 
8
-add_filter('Flynt/addComponentData?name=GridPostsSlider', function ($data) {
8
+add_filter('Flynt/addComponentData?name=GridPostsSlider', function($data) {
9 9
     Component::enqueueAssets('GridPostsSlider', [
10 10
         [
11 11
             'name' => 'slick-carousel',
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.
Components/ListPosts/functions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 use Flynt\Utils\Options;
7 7
 use Flynt;
8 8
 
9
-add_filter('Flynt/addComponentData?name=ListPosts', function ($data) {
9
+add_filter('Flynt/addComponentData?name=ListPosts', function($data) {
10 10
     Component::enqueueAssets('ListPosts');
11 11
 
12 12
     return $data;
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.
lib/Utils/TwigExtensionFlynt.php 1 patch
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.