@@ -14,14 +14,14 @@ discard block |
||
| 14 | 14 | $this->config = $config; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | - public function find($path, $default=null, $delimiter='.') { |
|
| 17 | + public function find($path, $default = null, $delimiter = '.') { |
|
| 18 | 18 | if ($this->pathStartsWithConfig($path, $delimiter)) |
| 19 | 19 | return $this->evalSubPath($path, $delimiter, $default); |
| 20 | 20 | |
| 21 | 21 | return $this->get($this->getFirstToken($path, $delimiter), $default); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - private function get($name, $default=null) { |
|
| 24 | + private function get($name, $default = null) { |
|
| 25 | 25 | return $this->config->get($name, $default); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | private function getFirstToken($path, $delimiter) { |
| 37 | - return $this->gettok($path, $delimiter,0); |
|
| 37 | + return $this->gettok($path, $delimiter, 0); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | private function evalSubPath($path, $delimiter, $default) { |
@@ -39,23 +39,23 @@ |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | # ArrayAccess |
| 42 | - public function offsetGet($offset) { return $this->requireOffset($offset); } |
|
| 43 | - public function offsetExists($offset) { return isset($this->values[$offset]); } |
|
| 44 | - public function offsetSet($offset, $val) { $this->values[$offset] = $val; } |
|
| 45 | - public function offsetUnset($offset) { unset($this->values[$offset]); } |
|
| 42 | + public function offsetGet($offset) { return $this->requireOffset($offset); } |
|
| 43 | + public function offsetExists($offset) { return isset($this->values[$offset]); } |
|
| 44 | + public function offsetSet($offset, $val) { $this->values[$offset] = $val; } |
|
| 45 | + public function offsetUnset($offset) { unset($this->values[$offset]); } |
|
| 46 | 46 | |
| 47 | 47 | # Iterator |
| 48 | - public function rewind() { return reset($this->values); } |
|
| 49 | - public function key() { return key($this->values); } |
|
| 50 | - public function current() { return current($this->values); } |
|
| 51 | - public function next() { return next($this->values); } |
|
| 52 | - public function valid() { return key($this->values) !== null; } |
|
| 48 | + public function rewind() { return reset($this->values); } |
|
| 49 | + public function key() { return key($this->values); } |
|
| 50 | + public function current() { return current($this->values); } |
|
| 51 | + public function next() { return next($this->values); } |
|
| 52 | + public function valid() { return key($this->values) !== null; } |
|
| 53 | 53 | |
| 54 | 54 | # Magic Property Access |
| 55 | - public function __set($offset, $value) { $this->offsetSet($offset, $value); } |
|
| 56 | - public function __unset($offset) { $this->offsetUnset($offset); } |
|
| 57 | - public function __get($offset) { return $this->offsetGet($offset); } |
|
| 58 | - public function __isset($offset) { return $this->offsetExists($offset); } |
|
| 55 | + public function __set($offset, $value) { $this->offsetSet($offset, $value); } |
|
| 56 | + public function __unset($offset) { $this->offsetUnset($offset); } |
|
| 57 | + public function __get($offset) { return $this->offsetGet($offset); } |
|
| 58 | + public function __isset($offset) { return $this->offsetExists($offset); } |
|
| 59 | 59 | |
| 60 | 60 | protected function requireOffset($offset) { |
| 61 | 61 | if (!$this->offsetExists($offset)) |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * @see ../docs/config/README.md |
| 11 | 11 | */ |
| 12 | 12 | abstract class Config extends Registry { |
| 13 | - private $locked = false; |
|
| 13 | + private $locked = false; |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Config constructor. |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function __construct(array $arrayConfig = []) { |
| 21 | 21 | parent::__construct(); |
| 22 | - foreach($arrayConfig as $key => $value) |
|
| 22 | + foreach ($arrayConfig as $key => $value) |
|
| 23 | 23 | $this->offsetSet($key, $value); |
| 24 | 24 | |
| 25 | 25 | $this->onConstruct(); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public function toArray() { |
| 44 | 44 | return array_map( |
| 45 | - function ($value) { |
|
| 45 | + function($value) { |
|
| 46 | 46 | // $value may be another Config object, if so then we toArray() it also. |
| 47 | 47 | return $this->hasToArray($value) ? $value->toArray() : $value; |
| 48 | 48 | }, |
@@ -24,12 +24,12 @@ |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public static function required($name) : Particle { |
| 27 | - $v = new Particle\Validator();; |
|
| 27 | + $v = new Particle\Validator(); ; |
|
| 28 | 28 | return new self($name, $v, $v->required($name)); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public static function optional($name) : Particle { |
| 32 | - $v = new Particle\Validator();; |
|
| 32 | + $v = new Particle\Validator(); ; |
|
| 33 | 33 | return new self($name, $v, $v->optional($name)); |
| 34 | 34 | } |
| 35 | 35 | |