@@ -10,7 +10,7 @@ |
||
| 10 | 10 | { |
| 11 | 11 | parent::__construct |
| 12 | 12 | ( |
| 13 | - 'Tried to read unreadable property ' |
|
| 13 | + 'Tried to read unreadable property ' |
|
| 14 | 14 | . $class . '::$' . $property, |
| 15 | 15 | 0, |
| 16 | 16 | $previous |
@@ -8,8 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function __construct($class, $property, $previous = null) |
| 10 | 10 | { |
| 11 | - parent::__construct |
|
| 12 | - ( |
|
| 11 | + parent::__construct( |
|
| 13 | 12 | 'Tried to read unreadable property ' |
| 14 | 13 | . $class . '::$' . $property, |
| 15 | 14 | 0, |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | { |
| 11 | 11 | parent::__construct |
| 12 | 12 | ( |
| 13 | - 'Tried to write to unwritable property ' |
|
| 13 | + 'Tried to write to unwritable property ' |
|
| 14 | 14 | . $class . '::$' . $property, |
| 15 | 15 | 0, |
| 16 | 16 | $previous |
@@ -8,8 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function __construct($class, $property, $previous = null) |
| 10 | 10 | { |
| 11 | - parent::__construct |
|
| 12 | - ( |
|
| 11 | + parent::__construct( |
|
| 13 | 12 | 'Tried to write to unwritable property ' |
| 14 | 13 | . $class . '::$' . $property, |
| 15 | 14 | 0, |
@@ -36,14 +36,12 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | if (!$this->reflect->properties->contains($property)) |
| 38 | 38 | { |
| 39 | - throw new CannotWritePropertyException |
|
| 40 | - ( |
|
| 39 | + throw new CannotWritePropertyException( |
|
| 41 | 40 | get_class($this->object), $property |
| 42 | 41 | ); |
| 43 | 42 | } |
| 44 | 43 | |
| 45 | - $this->setAnyValue |
|
| 46 | - ( |
|
| 44 | + $this->setAnyValue( |
|
| 47 | 45 | $this->reflect->properties[$property], |
| 48 | 46 | $value |
| 49 | 47 | ); |
@@ -57,8 +55,7 @@ discard block |
||
| 57 | 55 | } |
| 58 | 56 | else |
| 59 | 57 | { |
| 60 | - $this->setNonNullValue |
|
| 61 | - ( |
|
| 58 | + $this->setNonNullValue( |
|
| 62 | 59 | $property->name, |
| 63 | 60 | $value, |
| 64 | 61 | $property->type |
@@ -125,8 +122,7 @@ discard block |
||
| 125 | 122 | } |
| 126 | 123 | elseif (is_object($value) && method_exists([$value, $method])) |
| 127 | 124 | { |
| 128 | - $this->setScalarValue |
|
| 129 | - ( |
|
| 125 | + $this->setScalarValue( |
|
| 130 | 126 | $property, |
| 131 | 127 | $value->$method(), |
| 132 | 128 | $method, |
@@ -165,8 +161,7 @@ discard block |
||
| 165 | 161 | |
| 166 | 162 | private function throwError($property, $expected, $value) |
| 167 | 163 | { |
| 168 | - throw new IllegalPropertyTypeException |
|
| 169 | - ( |
|
| 164 | + throw new IllegalPropertyTypeException( |
|
| 170 | 165 | get_class($this->object), |
| 171 | 166 | $property, |
| 172 | 167 | $expected, |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | if (is_null($value)) |
| 55 | 55 | { |
| 56 | 56 | $this->setNullValue($property->name, $property->type); |
| 57 | - } |
|
| 58 | - else |
|
| 57 | + } else |
|
| 59 | 58 | { |
| 60 | 59 | $this->setNonNullValue |
| 61 | 60 | ( |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | if ($type->nullable) |
| 72 | 71 | { |
| 73 | 72 | $this->setRawValue($property, null); |
| 74 | - } |
|
| 75 | - else |
|
| 73 | + } else |
|
| 76 | 74 | { |
| 77 | 75 | $this->throwError($property, 'NonNull', null); |
| 78 | 76 | } |
@@ -122,8 +120,7 @@ discard block |
||
| 122 | 120 | if (is_scalar($value)) |
| 123 | 121 | { |
| 124 | 122 | $this->setRawValue($property, $cast($value)); |
| 125 | - } |
|
| 126 | - elseif (is_object($value) && method_exists([$value, $method])) |
|
| 123 | + } elseif (is_object($value) && method_exists([$value, $method])) |
|
| 127 | 124 | { |
| 128 | 125 | $this->setScalarValue |
| 129 | 126 | ( |
@@ -132,8 +129,7 @@ discard block |
||
| 132 | 129 | $method, |
| 133 | 130 | $cast |
| 134 | 131 | ); |
| 135 | - } |
|
| 136 | - else |
|
| 132 | + } else |
|
| 137 | 133 | { |
| 138 | 134 | $this->throwError($property, $name, $value); |
| 139 | 135 | } |
@@ -144,8 +140,7 @@ discard block |
||
| 144 | 140 | if (is_a($value, $type->classname)) |
| 145 | 141 | { |
| 146 | 142 | $this->setRawValue($property, $value); |
| 147 | - } |
|
| 148 | - else |
|
| 143 | + } else |
|
| 149 | 144 | { |
| 150 | 145 | $this->throwError($property, $type->classname, $value); |
| 151 | 146 | } |
@@ -156,8 +151,7 @@ discard block |
||
| 156 | 151 | if (is_a($value, \ArrayAccess::class) || is_array($value)) |
| 157 | 152 | { |
| 158 | 153 | $this->setRawValue($property, $value); |
| 159 | - } |
|
| 160 | - else |
|
| 154 | + } else |
|
| 161 | 155 | { |
| 162 | 156 | $this->throwError($property, 'Collection', $value); |
| 163 | 157 | } |
@@ -15,8 +15,7 @@ discard block |
||
| 15 | 15 | } |
| 16 | 16 | else |
| 17 | 17 | { |
| 18 | - throw new PropertyNotWritableException |
|
| 19 | - ( |
|
| 18 | + throw new PropertyNotWritableException( |
|
| 20 | 19 | get_class($this->object), |
| 21 | 20 | $property->name |
| 22 | 21 | ); |
@@ -27,16 +26,14 @@ discard block |
||
| 27 | 26 | { |
| 28 | 27 | if (!$this->reflect->properties->contains($property)) |
| 29 | 28 | { |
| 30 | - throw new CannotReadPropertyException |
|
| 31 | - ( |
|
| 29 | + throw new CannotReadPropertyException( |
|
| 32 | 30 | get_class($this->object), |
| 33 | 31 | $property |
| 34 | 32 | ); |
| 35 | 33 | } |
| 36 | 34 | elseif (!$this->reflect->properties[$property]->readable) |
| 37 | 35 | { |
| 38 | - throw new PropertyNotReadableException |
|
| 39 | - ( |
|
| 36 | + throw new PropertyNotReadableException( |
|
| 40 | 37 | get_class($this->object), |
| 41 | 38 | $property |
| 42 | 39 | ); |
@@ -12,8 +12,7 @@ discard block |
||
| 12 | 12 | if ($property->writable) |
| 13 | 13 | { |
| 14 | 14 | parent::setAnyValue($property, $value); |
| 15 | - } |
|
| 16 | - else |
|
| 15 | + } else |
|
| 17 | 16 | { |
| 18 | 17 | throw new PropertyNotWritableException |
| 19 | 18 | ( |
@@ -32,8 +31,7 @@ discard block |
||
| 32 | 31 | get_class($this->object), |
| 33 | 32 | $property |
| 34 | 33 | ); |
| 35 | - } |
|
| 36 | - elseif (!$this->reflect->properties[$property]->readable) |
|
| 34 | + } elseif (!$this->reflect->properties[$property]->readable) |
|
| 37 | 35 | { |
| 38 | 36 | throw new PropertyNotReadableException |
| 39 | 37 | ( |