|
@@ 280-287 (lines=8) @@
|
| 277 |
|
private function parseDataType(Property $annotation, \ReflectionProperty $property) |
| 278 |
|
{ |
| 279 |
|
if (!empty($annotation->parser)) { |
| 280 |
|
if (!$property->getDeclaringClass()->hasMethod($annotation->parser)) { |
| 281 |
|
throw new \InvalidArgumentException(sprintf( |
| 282 |
|
"Custom parser function %s:%s() for property '%s' does not exist", |
| 283 |
|
$property->class, |
| 284 |
|
$annotation->parser, |
| 285 |
|
$property->name |
| 286 |
|
)); |
| 287 |
|
} |
| 288 |
|
return ['custom', $annotation->parser]; |
| 289 |
|
} elseif (!empty($annotation->type)) { |
| 290 |
|
return $this->parseDataTypeString($annotation->type); |
|
@@ 308-315 (lines=8) @@
|
| 305 |
|
private function parseVirtualDataType(VirtualProperty $annotation, \ReflectionMethod $method) |
| 306 |
|
{ |
| 307 |
|
if (!empty($annotation->parser)) { |
| 308 |
|
if (!$method->getDeclaringClass()->hasMethod($annotation->parser)) { |
| 309 |
|
throw new \InvalidArgumentException(sprintf( |
| 310 |
|
"Custom parser function %s:%s() for virtual property '%s' does not exist", |
| 311 |
|
$method->class, |
| 312 |
|
$annotation->parser, |
| 313 |
|
$annotation->name |
| 314 |
|
)); |
| 315 |
|
} |
| 316 |
|
return ['custom', $annotation->parser]; |
| 317 |
|
} elseif (!empty($annotation->type)) { |
| 318 |
|
return $this->parseDataTypeString($annotation->type); |