Completed
Push — master ( 0d18cd...170cf3 )
by JM
02:47
created
src/jmversteeg/contextual/Context.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      * @param Context|null $parentContext
32 32
      * @param array        $values Array of initial value "overrides"
33 33
      */
34
-    public function __construct ($parentContext = null, $values = [])
34
+    public function __construct($parentContext = null, $values = [])
35 35
     {
36 36
         $this->parentContext = $parentContext;
37 37
         $this->setDefaults();
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      * @param string $key
46 46
      * @param mixed  $value
47 47
      */
48
-    protected function setDefault ($key, $value)
48
+    protected function setDefault($key, $value)
49 49
     {
50 50
         $this->defaults[$key] = $value;
51 51
     }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      *
58 58
      * @return bool
59 59
      */
60
-    protected function isDefaultSet ($key)
60
+    protected function isDefaultSet($key)
61 61
     {
62 62
         return isset($this->defaults[$key]);
63 63
     }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      * @param array $values
68 68
      * @return static Array of initial value "overrides"
69 69
      */
70
-    public function createSubContext ($values = [])
70
+    public function createSubContext($values = [])
71 71
     {
72 72
         return new static($this, $values);
73 73
     }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * Returns an array of parent contexts up to and including the current context, in order of ascending depth
77 77
      * @return Context[]
78 78
      */
79
-    public function getContextTree ()
79
+    public function getContextTree()
80 80
     {
81 81
         $parentContext = $this;
82 82
         $parents       = array($parentContext);
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      *
95 95
      * @return mixed[]
96 96
      */
97
-    public function getValueTree ($name, $removeDuplicates = true)
97
+    public function getValueTree($name, $removeDuplicates = true)
98 98
     {
99 99
         $contextTree = $this->getContextTree();
100 100
         $values      = array();
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
      * @param array $values
112 112
      * @return $this
113 113
      */
114
-    public function set ($values = [])
114
+    public function set($values = [])
115 115
     {
116 116
         foreach ($values as $key => $value)
117 117
             $this->{$key} = $value;
118 118
         return $this;
119 119
     }
120 120
 
121
-    public function __get ($name)
121
+    public function __get($name)
122 122
     {
123 123
         // First, check if the "actual" property exists
124 124
         if (property_exists($this, $name))
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             return array_key_exists($name, $this->defaults) ? $this->defaults[$name] : null;
135 135
     }
136 136
 
137
-    public function __set ($name, $value)
137
+    public function __set($name, $value)
138 138
     {
139 139
         if (property_exists($this, $name))
140 140
             $this->{$name} = $value;
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     /**
146 146
      * Loads all the default properties starting with an underscore into the defaults array
147 147
      */
148
-    private function setDefaults ()
148
+    private function setDefaults()
149 149
     {
150 150
         $class = get_class($this);
151 151
         do {
Please login to merge, or discard this patch.