@@ -55,7 +55,7 @@ |
||
| 55 | 55 | //register custom parser |
| 56 | 56 | Array2Object::registerParser( |
| 57 | 57 | new CallableParser( |
| 58 | - function ($value, $type, \ReflectionProperty $property, $object) { |
|
| 58 | + function($value, $type, \ReflectionProperty $property, $object) { |
|
| 59 | 59 | if ($property->name === 'salary') { |
| 60 | 60 | $value = str_replace('$', null, $value); |
| 61 | 61 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | public function parseValue($value, $type, \ReflectionProperty $property, $object) |
| 18 | 18 | { |
| 19 | 19 | if ($type === 'string') { |
| 20 | - return (string)$value; |
|
| 20 | + return (string) $value; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | return $value; |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | public function parseValue($value, $type, \ReflectionProperty $property, $object) |
| 18 | 18 | { |
| 19 | 19 | if ($type === 'integer' || $type === 'int') { |
| 20 | - return (integer)$value; |
|
| 20 | + return (integer) $value; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | return $value; |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | public function parseValue($value, $type, \ReflectionProperty $property, $object) |
| 18 | 18 | { |
| 19 | 19 | if ($type === 'float' || $type === 'double') { |
| 20 | - return (float)$value; |
|
| 20 | + return (float) $value; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | return $value; |
@@ -36,8 +36,8 @@ |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | //use the same namespace as class container |
| 39 | - if ($className === null && class_exists($context->getNamespaceName() . "\\" . $type)) { |
|
| 40 | - $className = $context->getNamespaceName() . "\\" . $type; |
|
| 39 | + if ($className === null && class_exists($context->getNamespaceName()."\\".$type)) { |
|
| 40 | + $className = $context->getNamespaceName()."\\".$type; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | if (is_array($value) && $className !== null && class_exists($className)) { |
@@ -29,10 +29,10 @@ |
||
| 29 | 29 | $value = false; |
| 30 | 30 | break; |
| 31 | 31 | default: |
| 32 | - $value = (boolean)$value; |
|
| 32 | + $value = (boolean) $value; |
|
| 33 | 33 | } |
| 34 | 34 | } else { |
| 35 | - $value = (boolean)$value; |
|
| 35 | + $value = (boolean) $value; |
|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | static public function populate($object, array $data) |
| 78 | 78 | { |
| 79 | - self::setup();//register parsers |
|
| 79 | + self::setup(); //register parsers |
|
| 80 | 80 | |
| 81 | 81 | if (!is_object($object)) { |
| 82 | 82 | throw new \InvalidArgumentException('The first param should be a object.'); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $props_arr[$f] = $prop; |
| 132 | 132 | } |
| 133 | 133 | if ($parentClass = $refClass->getParentClass()) { |
| 134 | - $parent_props_arr = self::getClassProperties($parentClass);//RECURSION |
|
| 134 | + $parent_props_arr = self::getClassProperties($parentClass); //RECURSION |
|
| 135 | 135 | if (count($parent_props_arr) > 0) { |
| 136 | 136 | $props_arr = array_merge($parent_props_arr, $props_arr); |
| 137 | 137 | } |