@@ -21,19 +21,19 @@ |
||
21 | 21 | * |
22 | 22 | * @link http://php.net/manual/class.seekableiterator.php |
23 | 23 | */ |
24 | -trait SeekableIteratorTrait{ |
|
24 | +trait SeekableIteratorTrait { |
|
25 | 25 | use IteratorTrait; |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * @link http://php.net/manual/seekableiterator.seek.php |
29 | 29 | * @inheritdoc |
30 | 30 | */ |
31 | - public function seek($pos){ |
|
31 | + public function seek($pos) { |
|
32 | 32 | $this->rewind(); |
33 | 33 | |
34 | - for( ; $this->offset < $pos; ){ |
|
34 | + for (; $this->offset < $pos;) { |
|
35 | 35 | |
36 | - if(!next($this->array)) { |
|
36 | + if (!next($this->array)) { |
|
37 | 37 | throw new OutOfBoundsException('invalid seek position: '.$pos); |
38 | 38 | } |
39 | 39 |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * a generic container with magic getter and setter |
19 | 19 | */ |
20 | -trait Container{ |
|
20 | +trait Container { |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * @param array $properties |
24 | 24 | */ |
25 | - public function __construct(array $properties = null){ |
|
25 | + public function __construct(array $properties = null) { |
|
26 | 26 | |
27 | - if(!empty($properties)){ |
|
27 | + if (!empty($properties)) { |
|
28 | 28 | |
29 | - foreach($properties as $key => $value){ |
|
29 | + foreach ($properties as $key => $value) { |
|
30 | 30 | $this->__set($key, $value); |
31 | 31 | } |
32 | 32 | |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * |
40 | 40 | * @return mixed |
41 | 41 | */ |
42 | - public function __get(string $property){ |
|
42 | + public function __get(string $property) { |
|
43 | 43 | |
44 | - if(property_exists($this, $property) && !(new ReflectionProperty($this, $property))->isPrivate()){ |
|
44 | + if (property_exists($this, $property) && !(new ReflectionProperty($this, $property))->isPrivate()) { |
|
45 | 45 | return $this->{$property}; |
46 | 46 | } |
47 | 47 | |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return void |
56 | 56 | */ |
57 | - public function __set(string $property, $value){ |
|
57 | + public function __set(string $property, $value) { |
|
58 | 58 | |
59 | - if(property_exists($this, $property) && !(new ReflectionProperty($this, $property))->isPrivate()){ |
|
59 | + if (property_exists($this, $property) && !(new ReflectionProperty($this, $property))->isPrivate()) { |
|
60 | 60 | $this->{$property} = $value; |
61 | 61 | } |
62 | 62 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | public function __toArray():array { |
69 | 69 | $data = []; |
70 | 70 | |
71 | - foreach($this as $key => $value){ |
|
71 | + foreach ($this as $key => $value) { |
|
72 | 72 | $data[$key] = $value; |
73 | 73 | } |
74 | 74 |