@@ -21,7 +21,9 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function __construct(bool $init = true) |
| 23 | 23 | { |
| 24 | - if ($init) $this->data = new stdClass(); |
|
| 24 | + if ($init) { |
|
| 25 | + $this->data = new stdClass(); |
|
| 26 | + } |
|
| 25 | 27 | } |
| 26 | 28 | |
| 27 | 29 | /** |
@@ -99,8 +101,9 @@ discard block |
||
| 99 | 101 | */ |
| 100 | 102 | private function get_called_value(string $function) |
| 101 | 103 | { |
| 102 | - if (!isset($this->data->{lcfirst(substr($function, 3, strlen($function) - 3))})) |
|
| 103 | - throw new BadMethodCallException("Function '$function' does not exist."); |
|
| 104 | + if (!isset($this->data->{lcfirst(substr($function, 3, strlen($function) - 3))})) { |
|
| 105 | + throw new BadMethodCallException("Function '$function' does not exist."); |
|
| 106 | + } |
|
| 104 | 107 | |
| 105 | 108 | return $this->data->{lcfirst(substr($function, 3, strlen($function) - 3))}; |
| 106 | 109 | } |
@@ -114,8 +117,9 @@ discard block |
||
| 114 | 117 | */ |
| 115 | 118 | private function set_called_value(string $function, $value): void |
| 116 | 119 | { |
| 117 | - if (!isset($this->data->{lcfirst(substr($function, 3, strlen($function) - 3))})) |
|
| 118 | - throw new BadMethodCallException("Function '$function' does not exist."); |
|
| 120 | + if (!isset($this->data->{lcfirst(substr($function, 3, strlen($function) - 3))})) { |
|
| 121 | + throw new BadMethodCallException("Function '$function' does not exist."); |
|
| 122 | + } |
|
| 119 | 123 | |
| 120 | 124 | $this->data->{lcfirst(substr($function, 3, strlen($function) - 3))} = $value; |
| 121 | 125 | } |