@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public static function getPropertyValue(object $object, string $propertyName) |
27 | 27 | { |
28 | - if(static::hasPublicProperty($object, $propertyName)) { |
|
28 | + if (static::hasPublicProperty($object, $propertyName)) { |
|
29 | 29 | return $object->{$propertyName}; |
30 | 30 | } |
31 | 31 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public static function setPropertyValue(object $object, string $propertyName, $value): void |
47 | 47 | { |
48 | - if(static::hasPublicProperty($object, $propertyName) || $object instanceof stdClass) { |
|
48 | + if (static::hasPublicProperty($object, $propertyName) || $object instanceof stdClass) { |
|
49 | 49 | $object->{$propertyName} = $value; |
50 | 50 | return; |
51 | 51 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public static function get($container, string $key, $defaultValue = null) |
32 | 32 | { |
33 | - switch(true) { |
|
33 | + switch (true) { |
|
34 | 34 | case is_array($container): |
35 | 35 | return static::getFromArray($container, $key, $defaultValue); |
36 | 36 | case $container instanceof ArrayAccess: |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public static function set(&$container, string $key, $value): void |
59 | 59 | { |
60 | - switch(true) { |
|
60 | + switch (true) { |
|
61 | 61 | case is_array($container): |
62 | 62 | case $container instanceof ArrayAccess: |
63 | 63 | $container[$key] = $value; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public static function exists($container, string $key): bool |
80 | 80 | { |
81 | - switch(true) { |
|
81 | + switch (true) { |
|
82 | 82 | case is_array($container): |
83 | 83 | return static::existsInArray($container, $key); |
84 | 84 | case $container instanceof ArrayAccess: |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | protected static function getFromArray(array $container, string $key, $defaultValue) |
104 | 104 | { |
105 | - if(static::existsInArray($container, $key)) { |
|
105 | + if (static::existsInArray($container, $key)) { |
|
106 | 106 | return $container[$key]; |
107 | 107 | } |
108 | 108 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | protected static function getFromArrayAccess(ArrayAccess $container, string $key, $defaultValue) |
138 | 138 | { |
139 | - if(static::existsInArrayAccess($container, $key)) { |
|
139 | + if (static::existsInArrayAccess($container, $key)) { |
|
140 | 140 | return $container[$key]; |
141 | 141 | } |
142 | 142 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | */ |
170 | 170 | protected static function getFromObject(object $container, string $key, $defaultValue) |
171 | 171 | { |
172 | - if(ObjectAccess::hasReadableProperty($container, $key)) { |
|
172 | + if (ObjectAccess::hasReadableProperty($container, $key)) { |
|
173 | 173 | return ObjectAccess::getPropertyValue($container, $key); |
174 | 174 | } |
175 | 175 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | */ |
190 | 190 | protected static function setToObject(object $container, string $key, $value): void |
191 | 191 | { |
192 | - if(!ObjectAccess::hasWritableProperty($container, $key) && !($container instanceof stdClass)) { |
|
192 | + if (!ObjectAccess::hasWritableProperty($container, $key) && !($container instanceof stdClass)) { |
|
193 | 193 | throw new KeyError("property ".get_class($container)."::{$key} is not writable"); |
194 | 194 | } |
195 | 195 |