Completed
Pull Request — master (#23)
by Gorka
05:12
created
src/LIN3S/WPFoundation/Configuration/Theme/Theme.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $this->templateSelector();
29 29
         $this->xmlrpc();
30 30
         add_theme_support('post-thumbnails');
31
-        add_filter('timber_context', [$this, 'context']);
31
+        add_filter('timber_context', [ $this, 'context' ]);
32 32
 
33 33
         // @deprecated since version 1.6, will be removed in 2.0. Extend the ACF class in your project and instantiate
34 34
         // inside your project Theme.
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
     private function templateSelector()
42 42
     {
43 43
         $self = $this;
44
-        add_filter('theme_page_templates', function () use ($self) {
45
-            return $self->templates([]);
44
+        add_filter('theme_page_templates', function() use ($self) {
45
+            return $self->templates([ ]);
46 46
         });
47 47
     }
48 48
 
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
     protected function acf()
65 65
     {
66 66
         $customToolbars = [
67
-            'lin3s' => [1 => ['bold', 'italic', 'bullist', 'numlist', 'link', 'unlink']],
67
+            'lin3s' => [ 1 => [ 'bold', 'italic', 'bullist', 'numlist', 'link', 'unlink' ] ],
68 68
         ];
69 69
 
70
-        add_filter('acf/fields/wysiwyg/toolbars', function (array $toolbars) use ($customToolbars) {
70
+        add_filter('acf/fields/wysiwyg/toolbars', function(array $toolbars) use ($customToolbars) {
71 71
             return array_merge($toolbars, $customToolbars);
72 72
         });
73 73
     }
Please login to merge, or discard this patch.
spec/LIN3S/WPFoundation/Configuration/Theme/ThemeSpec.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,13 +42,13 @@
 block discarded – undo
42 42
 
43 43
     function it_should_return_templates()
44 44
     {
45
-        $this->templates(['my-template' => 'MyTemplate'])->shouldReturn([
45
+        $this->templates([ 'my-template' => 'MyTemplate' ])->shouldReturn([
46 46
             'my-template' => 'MyTemplate', 'dummy-template' => 'DummyTemplate',
47 47
         ]);
48 48
     }
49 49
 
50 50
     function it_should_return_context()
51 51
     {
52
-        $this->context(['heder-menu' => 'Header Menu'])->shouldReturn(['heder-menu' => 'Header Menu']);
52
+        $this->context([ 'heder-menu' => 'Header Menu' ])->shouldReturn([ 'heder-menu' => 'Header Menu' ]);
53 53
     }
54 54
 }
Please login to merge, or discard this patch.
src/LIN3S/WPFoundation/PostTypes/PostType.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
      * @param string $name
31 31
      * @param array $options
32 32
      */
33
-    public function __construct($name = null, $options = [])
33
+    public function __construct($name = null, $options = [ ])
34 34
     {
35 35
         $this->name = $name;
36 36
         $this->options = $options;
37 37
 
38
-        add_action('init', [$this, 'postType']);
39
-        add_action('init', [$this, 'taxonomyType']);
40
-        add_action('init', [$this, 'fields'], 20);
41
-        add_action('init', [$this, 'rewriteRules'], 20);
38
+        add_action('init', [ $this, 'postType' ]);
39
+        add_action('init', [ $this, 'taxonomyType' ]);
40
+        add_action('init', [ $this, 'fields' ], 20);
41
+        add_action('init', [ $this, 'rewriteRules' ], 20);
42 42
 
43
-        add_filter('post_type_link', [$this, 'permalink'], 1, 2);
44
-        add_filter('term_link', [$this, 'taxonomyPermalink'], 1, 2);
43
+        add_filter('post_type_link', [ $this, 'permalink' ], 1, 2);
44
+        add_filter('term_link', [ $this, 'taxonomyPermalink' ], 1, 2);
45 45
     }
46 46
 
47 47
     /**
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     {
74 74
         if (is_array($postTypes)) {
75 75
             foreach ($postTypes as $key => $postType) {
76
-                $postTypes[$key] = static::singleSerialize($postType);
76
+                $postTypes[ $key ] = static::singleSerialize($postType);
77 77
             }
78 78
 
79 79
             return $postTypes;
Please login to merge, or discard this patch.
src/LIN3S/WPFoundation/PostTypes/Taxonomy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
         $this->postType = $postType;
23 23
         $this->options = $options;
24 24
 
25
-        add_action('init', [$this, 'initTaxonomy']);
25
+        add_action('init', [ $this, 'initTaxonomy' ]);
26 26
     }
27 27
 
28 28
     public function initTaxonomy()
Please login to merge, or discard this patch.
src/LIN3S/WPFoundation/PostTypes/Fields/Fields.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,8 +44,7 @@
 block discarded – undo
44 44
     public function __construct(
45 45
         $components = [],
46 46
         $connector = null
47
-    )
48
-    {
47
+    ) {
49 48
         if ($connector !== null && !$connector instanceof FieldConnector) {
50 49
             throw new \Exception('Connector must implement FieldConnector');
51 50
         }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      * Constructor.
44 44
      */
45 45
     public function __construct(
46
-        $components = [],
46
+        $components = [ ],
47 47
         $connector = null
48 48
     )
49 49
     {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     public function fields()
72 72
     {
73 73
         foreach ($this->components() as $component) {
74
-            if($component instanceof FieldComponentInterface) {
74
+            if ($component instanceof FieldComponentInterface) {
75 75
                 return $component->init($this->name, $this->connector());
76 76
             }
77 77
             if (false === class_exists($component)) {
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     public function connector()
103 103
     {
104 104
         if ($this->connector === null) {
105
-            return [];
105
+            return [ ];
106 106
         }
107 107
 
108 108
         return $this->connector->connector();
Please login to merge, or discard this patch.
src/LIN3S/WPFoundation/Configuration/Menus/Menus.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@
 block discarded – undo
26 26
      *
27 27
      * @param array $menus
28 28
      */
29
-    public function __construct($menus = [])
29
+    public function __construct($menus = [ ])
30 30
     {
31 31
         $this->menus = $menus;
32 32
 
33
-        add_action('init', [$this, 'menus']);
33
+        add_action('init', [ $this, 'menus' ]);
34 34
     }
35 35
 
36 36
     /**
Please login to merge, or discard this patch.
spec/LIN3S/WPFoundation/PostTypes/Fields/FieldsSpec.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
 
12 12
 namespace spec\LIN3S\WPFoundation\PostTypes\Fields;
13 13
 
14
-use LIN3S\WordPressPhpSpecBridge\ObjectBehavior;
15 14
 use LIN3S\WPFoundation\PostTypes\Fields\Components\FieldComponentInterface;
16 15
 use LIN3S\WPFoundation\PostTypes\Fields\PostTypeAndTemplateFieldConnector;
16
+use LIN3S\WordPressPhpSpecBridge\ObjectBehavior;
17 17
 
18 18
 /**
19 19
  * Spec of Fields class.
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,9 +65,9 @@
 block discarded – undo
65 65
         FieldComponentInterface $component,
66 66
         PostTypeAndTemplateFieldConnector $connector
67 67
     ) {
68
-        $connector->connector()->shouldBeCalled()->willReturn([]);
68
+        $connector->connector()->shouldBeCalled()->willReturn([ ]);
69 69
         $connector->name()->shouldBeCalled()->willReturn('name');
70
-        $component->init('name', [])->shouldBeCalled();
70
+        $component->init('name', [ ])->shouldBeCalled();
71 71
 
72 72
         $this->beConstructedWith([
73 73
             $component
Please login to merge, or discard this patch.
src/LIN3S/WPFoundation/PostTypes/Fields/Components/FieldComponent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
         );
35 35
         if (method_exists(static::class, 'definition')) {
36 36
             $definition = static::definition($aName);
37
-            $definition['location'] = $aConnector;
37
+            $definition[ 'location' ] = $aConnector;
38 38
             acf_add_local_field_group($definition);
39 39
         } else {
40 40
             return new static($aName, $aConnector);
Please login to merge, or discard this patch.