Passed
Push — develop ( 1abd73...bdf49e )
by Paul
13:54
created
src/Helpers/SiteMeta.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -17,39 +17,39 @@  discard block
 block discarded – undo
17 17
 
18 18
     public function __construct()
19 19
     {
20
-        $this->options = get_option(apply_filters('pollux/settings/id', 'pollux_settings'), []);
20
+        $this->options = get_option( apply_filters( 'pollux/settings/id', 'pollux_settings' ), [] );
21 21
     }
22 22
 
23 23
     /**
24 24
      * @param string $group
25 25
      * @return object|array|null
26 26
      */
27
-    public function __call($group, $args)
27
+    public function __call( $group, $args )
28 28
     {
29
-        $args = array_pad($args, 2, null);
29
+        $args = array_pad( $args, 2, null );
30 30
         $group = $this->$group;
31
-        if (is_object($group)) {
31
+        if( is_object( $group ) ) {
32 32
             return $group;
33 33
         }
34
-        return $this->get($group, $args[0], $args[1]);
34
+        return $this->get( $group, $args[0], $args[1] );
35 35
     }
36 36
 
37 37
     /**
38 38
      * @param string $group
39 39
      * @return object|array|null
40 40
      */
41
-    public function __get($group)
41
+    public function __get( $group )
42 42
     {
43
-        if ('all' == $group) {
43
+        if( 'all' == $group ) {
44 44
             return (object) $this->options;
45 45
         }
46
-        if (empty($group)) {
46
+        if( empty( $group ) ) {
47 47
             $group = $this->getDefaultGroup();
48 48
         }
49
-        if (is_array($group)) {
50
-            $group = reset($group);
49
+        if( is_array( $group ) ) {
50
+            $group = reset( $group );
51 51
         }
52
-        return isset($this->options[$group])
52
+        return isset( $this->options[$group] )
53 53
             ? $this->options[$group]
54 54
             : null;
55 55
     }
@@ -60,21 +60,21 @@  discard block
 block discarded – undo
60 60
      * @param mixed $fallback
61 61
      * @return mixed
62 62
      */
63
-    public function get($group = '', $key = '', $fallback = null)
63
+    public function get( $group = '', $key = '', $fallback = null )
64 64
     {
65
-        if (func_num_args() < 1) {
65
+        if( func_num_args() < 1 ) {
66 66
             return $this->all;
67 67
         }
68
-        if (is_string($group)) {
68
+        if( is_string( $group ) ) {
69 69
             $group = $this->$group;
70 70
         }
71
-        if (!is_array($group)) {
71
+        if( !is_array( $group ) ) {
72 72
             return $fallback;
73 73
         }
74
-        if (is_null($key)) {
74
+        if( is_null( $key ) ) {
75 75
             return $group;
76 76
         }
77
-        return $this->getValue($group, $key, $fallback);
77
+        return $this->getValue( $group, $key, $fallback );
78 78
     }
79 79
 
80 80
     /**
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
      * @param mixed $fallback
91 91
      * @return mixed
92 92
      */
93
-    protected function getValue(array $group, $key = '', $fallback = null)
93
+    protected function getValue( array $group, $key = '', $fallback = null )
94 94
     {
95
-        if (empty($key) || !array_key_exists($key, $group)) {
95
+        if( empty( $key ) || !array_key_exists( $key, $group ) ) {
96 96
             return $fallback;
97 97
         }
98
-        return empty($group[$key]) && !is_null($fallback)
98
+        return empty( $group[$key] ) && !is_null( $fallback )
99 99
             ? $fallback
100 100
             : $group[$key];
101 101
     }
Please login to merge, or discard this patch.