@@ -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 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | public function buildParser() |
| 17 | 17 | { |
| 18 | 18 | return new CallableParser( |
| 19 | - function ($value, $type, \ReflectionProperty $property, $object) { |
|
| 19 | + function($value, $type, \ReflectionProperty $property, $object) { |
|
| 20 | 20 | return ($value === 'success') ? true : false; |
| 21 | 21 | } |
| 22 | 22 | ); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | public function testArray2Object() |
| 20 | 20 | { |
| 21 | 21 | $teamArray = [ |
| 22 | - 'id' => 1,//read-only |
|
| 22 | + 'id' => 1, //read-only |
|
| 23 | 23 | 'name' => 'Dream Team', |
| 24 | 24 | 'Manager' => [ |
| 25 | 25 | 'name' => 'Big Manager', |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | //register custom parser |
| 58 | 58 | $array2Object = Array2ObjectBuilder::create()->addParser( |
| 59 | 59 | new CallableParser( |
| 60 | - function ($value, $type, \ReflectionProperty $property, $object) { |
|
| 60 | + function($value, $type, \ReflectionProperty $property, $object) { |
|
| 61 | 61 | if ($property->getName() === 'salary') { |
| 62 | 62 | $value = str_replace('$', null, $value); |
| 63 | 63 | } |
@@ -67,6 +67,6 @@ |
||
| 67 | 67 | */ |
| 68 | 68 | public function __toString() |
| 69 | 69 | { |
| 70 | - return (string)$this->getName(); |
|
| 70 | + return (string) $this->getName(); |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | \ No newline at end of file |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | public function buildMatcher() |
| 20 | 20 | { |
| 21 | 21 | return new CallableMatcher( |
| 22 | - function (\ReflectionProperty $property, $givenName) { |
|
| 22 | + function(\ReflectionProperty $property, $givenName) { |
|
| 23 | 23 | return ($givenName === 'prueba' && $property->getName() === 'test'); |
| 24 | 24 | } |
| 25 | 25 | ); |