@@ -29,24 +29,24 @@ |
||
| 29 | 29 | if (property_exists($this->data, $camelAttribute)) { |
| 30 | 30 | return $this->data->$camelAttribute; |
| 31 | 31 | } |
| 32 | - throw new DataGridException('Unknown property ' . $attribute . ' in ' . get_class($this->data)); |
|
| 32 | + throw new DataGridException('Unknown property '.$attribute.' in '.get_class($this->data)); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | public function __call(string $name, array $arguments) |
| 36 | 36 | { |
| 37 | - if (method_exists($this->data, $name)){ |
|
| 37 | + if (method_exists($this->data, $name)) { |
|
| 38 | 38 | return call_user_func_array([$this->data, $name], $arguments); |
| 39 | 39 | } |
| 40 | - throw new DataGridException('Unknown method ' . $name . ' in ' . get_class($this->data)); |
|
| 40 | + throw new DataGridException('Unknown method '.$name.' in '.get_class($this->data)); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
| 44 | 44 | private function getPropertyAccessVariations(string $attribute): array |
| 45 | 45 | { |
| 46 | - $camelAttribute = preg_replace_callback('/_([a-z]?)/', function ($matches) { |
|
| 46 | + $camelAttribute = preg_replace_callback('/_([a-z]?)/', function($matches) { |
|
| 47 | 47 | return isset($matches[1]) ? strtoupper($matches[1]) : ''; |
| 48 | 48 | }, $attribute); |
| 49 | - $getter = 'get' . $camelAttribute; |
|
| 49 | + $getter = 'get'.$camelAttribute; |
|
| 50 | 50 | return [$camelAttribute, $getter]; |
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | \ No newline at end of file |
@@ -15,10 +15,10 @@ |
||
| 15 | 15 | |
| 16 | 16 | public function get(string $attribute) |
| 17 | 17 | { |
| 18 | - if ($this->has($attribute)){ |
|
| 18 | + if ($this->has($attribute)) { |
|
| 19 | 19 | return $this->data[$attribute]; |
| 20 | 20 | } |
| 21 | - throw new DataGridException('Unknown property ' . $attribute); |
|
| 21 | + throw new DataGridException('Unknown property '.$attribute); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | public function __call(string $name, array $arguments) |