@@ -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 | ); |
@@ -21,13 +21,11 @@ discard block |
||
21 | 21 | (new ReflectionFileFactory($this->reflector->getFileName())) |
22 | 22 | ->build(); |
23 | 23 | $this->accessor->setRawValue('file', $file); |
24 | - $this->accessor->setRawValue |
|
25 | - ( |
|
24 | + $this->accessor->setRawValue( |
|
26 | 25 | 'classname', |
27 | 26 | $this->reflector->name |
28 | 27 | ); |
29 | - $this->accessor->setRawValue |
|
30 | - ( |
|
28 | + $this->accessor->setRawValue( |
|
31 | 29 | 'namespace', |
32 | 30 | $file->namespaces[$this->reflector->getNamespaceName()] |
33 | 31 | ); |
@@ -53,15 +51,13 @@ discard block |
||
53 | 51 | |
54 | 52 | protected function buildProperty($reflect) |
55 | 53 | { |
56 | - $properties = $this->accessor->getRawValue |
|
57 | - ( |
|
54 | + $properties = $this->accessor->getRawValue( |
|
58 | 55 | 'properties' |
59 | 56 | ); |
60 | 57 | |
61 | 58 | $properties[$reflect->getName()] = |
62 | 59 | (new ReflectionPropertyFactory($reflect)) |
63 | - ->build |
|
64 | - ( |
|
60 | + ->build( |
|
65 | 61 | $this->object, |
66 | 62 | $this->reflector |
67 | 63 | ->getDefaultProperties()[$reflect->getName()] |
@@ -70,8 +66,7 @@ discard block |
||
70 | 66 | |
71 | 67 | protected function buildMethod($reflect) |
72 | 68 | { |
73 | - $this->accessor->rawAddToValue |
|
74 | - ( |
|
69 | + $this->accessor->rawAddToValue( |
|
75 | 70 | 'methods', |
76 | 71 | (new ReflectionMethodFactory($reflect)) |
77 | 72 | ->build($this->object) |
@@ -25,8 +25,7 @@ |
||
25 | 25 | if (!static::$reflectionComposite) |
26 | 26 | { |
27 | 27 | static::$reflectionComposite = |
28 | - ReflectionCompositeFactory::fromClassName |
|
29 | - ( |
|
28 | + ReflectionCompositeFactory::fromClassName( |
|
30 | 29 | get_called_class() |
31 | 30 | ) |
32 | 31 | ->build(); |
@@ -29,8 +29,7 @@ |
||
29 | 29 | { |
30 | 30 | if (!$this->accessor) |
31 | 31 | { |
32 | - $this->accessor = new ConditionalPropertyAccessor |
|
33 | - ( |
|
32 | + $this->accessor = new ConditionalPropertyAccessor( |
|
34 | 33 | $this, |
35 | 34 | self::getReflectionComposite() |
36 | 35 | ); |
@@ -40,8 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | public static function fromName($class, $property) |
42 | 42 | { |
43 | - return new static(new PHPNativeReflectionProperty |
|
44 | - ( |
|
43 | + return new static(new PHPNativeReflectionProperty( |
|
45 | 44 | $class, $property |
46 | 45 | )); |
47 | 46 | } |
@@ -50,8 +49,7 @@ discard block |
||
50 | 49 | { |
51 | 50 | $this->accessor->setRawValue('owner', $parent); |
52 | 51 | $this->accessor->setRawValue('defaultValue', $default); |
53 | - $this->accessor->setRawValue |
|
54 | - ( |
|
52 | + $this->accessor->setRawValue( |
|
55 | 53 | 'name', |
56 | 54 | $this->reflector->getName() |
57 | 55 | ); |
@@ -138,50 +136,42 @@ discard block |
||
138 | 136 | switch ($value[0]) |
139 | 137 | { |
140 | 138 | case 'required': |
141 | - $this->accessor->setRawValue |
|
142 | - ( |
|
139 | + $this->accessor->setRawValue( |
|
143 | 140 | 'passedToConstructor', |
144 | 141 | true |
145 | 142 | ); |
146 | - $this->accessor->setRawValue |
|
147 | - ( |
|
143 | + $this->accessor->setRawValue( |
|
148 | 144 | 'requiredInConstructor', |
149 | 145 | true |
150 | 146 | ); |
151 | - $compositeAccessor->rawAddToValue |
|
152 | - ( |
|
147 | + $compositeAccessor->rawAddToValue( |
|
153 | 148 | 'requiredProperties', |
154 | 149 | $this->object |
155 | 150 | ); |
156 | 151 | break; |
157 | 152 | case 'new': |
158 | - $this->accessor->setRawValue |
|
159 | - ( |
|
153 | + $this->accessor->setRawValue( |
|
160 | 154 | 'builtInConstructor', |
161 | 155 | true |
162 | 156 | ); |
163 | - $compositeAccessor->rawAddToValue |
|
164 | - ( |
|
157 | + $compositeAccessor->rawAddToValue( |
|
165 | 158 | 'builtProperties', |
166 | 159 | $this->object |
167 | 160 | ); |
168 | 161 | break; |
169 | 162 | case 'optional': |
170 | - $this->accessor->setRawValue |
|
171 | - ( |
|
163 | + $this->accessor->setRawValue( |
|
172 | 164 | 'passedToConstructor', |
173 | 165 | true |
174 | 166 | ); |
175 | - $compositeAccessor->rawAddToValue |
|
176 | - ( |
|
167 | + $compositeAccessor->rawAddToValue( |
|
177 | 168 | 'optionalProperties', |
178 | 169 | $this->object |
179 | 170 | ); |
180 | 171 | |
181 | 172 | if (isset($value[1]) && $value[1] === 'new') |
182 | 173 | { |
183 | - $this->accessor->setRawValue |
|
184 | - ( |
|
174 | + $this->accessor->setRawValue( |
|
185 | 175 | 'builtInConstructor', |
186 | 176 | true |
187 | 177 | ); |
@@ -47,8 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | if (!isset($args[$i])) |
49 | 49 | { |
50 | - throw new MissingRequiredParameterException |
|
51 | - ( |
|
50 | + throw new MissingRequiredParameterException( |
|
52 | 51 | get_class($this->object), |
53 | 52 | $property->name |
54 | 53 | ); |
@@ -109,14 +108,12 @@ discard block |
||
109 | 108 | { |
110 | 109 | if (!$this->reflect->properties->contains($property)) |
111 | 110 | { |
112 | - throw new CannotWritePropertyException |
|
113 | - ( |
|
111 | + throw new CannotWritePropertyException( |
|
114 | 112 | get_class($this->object), $property |
115 | 113 | ); |
116 | 114 | } |
117 | 115 | |
118 | - $this->setAnyValue |
|
119 | - ( |
|
116 | + $this->setAnyValue( |
|
120 | 117 | $this->reflect->properties[$property], |
121 | 118 | $value |
122 | 119 | ); |
@@ -130,8 +127,7 @@ discard block |
||
130 | 127 | } |
131 | 128 | else |
132 | 129 | { |
133 | - $this->setNonNullValue |
|
134 | - ( |
|
130 | + $this->setNonNullValue( |
|
135 | 131 | $property->name, |
136 | 132 | $value, |
137 | 133 | $property->type |
@@ -198,8 +194,7 @@ discard block |
||
198 | 194 | } |
199 | 195 | elseif (is_object($value) && method_exists([$value, $method])) |
200 | 196 | { |
201 | - $this->setScalarValue |
|
202 | - ( |
|
197 | + $this->setScalarValue( |
|
203 | 198 | $property, |
204 | 199 | $value->$method(), |
205 | 200 | $method, |
@@ -238,8 +233,7 @@ discard block |
||
238 | 233 | |
239 | 234 | private function throwError($property, $expected, $value) |
240 | 235 | { |
241 | - throw new IllegalPropertyTypeException |
|
242 | - ( |
|
236 | + throw new IllegalPropertyTypeException( |
|
243 | 237 | get_class($this->object), |
244 | 238 | $property, |
245 | 239 | $expected, |
@@ -18,8 +18,7 @@ |
||
18 | 18 | { |
19 | 19 | public function __construct($class, $property, $previous = null) |
20 | 20 | { |
21 | - parent::__construct |
|
22 | - ( |
|
21 | + parent::__construct( |
|
23 | 22 | 'Missing required parameter in constructor. ' |
24 | 23 | . $class . ' requires a value for ' . $property, |
25 | 24 | 0, |