@@ -11,8 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | trait ReflectionTrait |
| 13 | 13 | { |
| 14 | - public function getClassFromClassProperty($class, $property) |
|
| 15 | - { |
|
| 14 | + public function getClassFromClassProperty($class, $property) { |
|
| 16 | 15 | if(!class_exists($class)) { |
| 17 | 16 | throw new \Exception($class. ' not found or does not exist'); |
| 18 | 17 | } |
@@ -31,8 +30,7 @@ discard block |
||
| 31 | 30 | * |
| 32 | 31 | * @return bool|string |
| 33 | 32 | */ |
| 34 | - public static function getClassFromDocComment($comment, $includeNamespaces = true, $reflectionClass = null) |
|
| 35 | - { |
|
| 33 | + public static function getClassFromDocComment($comment, $includeNamespaces = true, $reflectionClass = null) { |
|
| 36 | 34 | if (preg_match('~\@var[\s]+([A-Za-z0-9\\\\]+)~', $comment, $matches)) { |
| 37 | 35 | if ($includeNamespaces) { |
| 38 | 36 | if ($reflectionClass instanceof \ReflectionClass && !in_array($matches[1], HydratableTrait::$nonObjectTypes)) { |
@@ -29,8 +29,7 @@ discard block |
||
| 29 | 29 | * @return Object |
| 30 | 30 | * @throws \Exception if setting value has failed |
| 31 | 31 | */ |
| 32 | - public function setPropertyValue($key, $value, $override = false, $isCollection = false) |
|
| 33 | - { |
|
| 32 | + public function setPropertyValue($key, $value, $override = false, $isCollection = false) { |
|
| 34 | 33 | // Replace empty strings with null |
| 35 | 34 | if ($value === "") { |
| 36 | 35 | $value = null; |
@@ -65,8 +64,7 @@ discard block |
||
| 65 | 64 | * @param string $propertyKey |
| 66 | 65 | * @return string |
| 67 | 66 | */ |
| 68 | - protected function getMethodName($propertyKey) |
|
| 69 | - { |
|
| 67 | + protected function getMethodName($propertyKey) { |
|
| 70 | 68 | return ucfirst(preg_replace_callback('/_([a-z])/', function ($match) { |
| 71 | 69 | return strtoupper($match[1]); |
| 72 | 70 | }, $propertyKey)); |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | * @param object|array $class class |
| 55 | 55 | * @return object |
| 56 | 56 | */ |
| 57 | - public function hydrateClass($class) |
|
| 58 | - { |
|
| 57 | + public function hydrateClass($class) { |
|
| 59 | 58 | $reflection = new \ReflectionClass($this); |
| 60 | 59 | |
| 61 | 60 | // Iterate over $class for properties |
@@ -123,8 +122,7 @@ discard block |
||
| 123 | 122 | * @param bool $fix Fix errors |
| 124 | 123 | * @return void |
| 125 | 124 | */ |
| 126 | - private function checkObjectForErrors(&$object, $fix = false) |
|
| 127 | - { |
|
| 125 | + private function checkObjectForErrors(&$object, $fix = false) { |
|
| 128 | 126 | if ($object instanceof \DateTime) { |
| 129 | 127 | // The constructor (passed from the API) is NULL, indicating an empty value |
| 130 | 128 | // PHP DateTime's default value is now() |