| @@ 404-414 (lines=11) @@ | ||
| 401 | * @return string |
|
| 402 | * @throws \InvalidArgumentException |
|
| 403 | */ |
|
| 404 | public function validatePropertyType($type) |
|
| 405 | { |
|
| 406 | if (!in_array($type, $this->getPropertyTypes())) { |
|
| 407 | throw $this->getException( |
|
| 408 | 'The property type isn\'t valid ("%s" given, expecting one of following: %s)', |
|
| 409 | [$type, implode(', ', $this->getPropertyTypes())] |
|
| 410 | ); |
|
| 411 | } |
|
| 412 | ||
| 413 | return $type; |
|
| 414 | } |
|
| 415 | ||
| 416 | /** |
|
| 417 | * Validates document annotation |
|
| @@ 424-434 (lines=11) @@ | ||
| 421 | * @return string |
|
| 422 | * @throws \InvalidArgumentException |
|
| 423 | */ |
|
| 424 | public function validateDocumentAnnotation($annotation) |
|
| 425 | { |
|
| 426 | if (!in_array($annotation, $this->getDocumentAnnotations())) { |
|
| 427 | throw $this->getException( |
|
| 428 | 'The document annotation isn\'t valid ("%s" given, expecting one of following: %s)', |
|
| 429 | [$annotation, implode(', ', $this->getDocumentAnnotations())] |
|
| 430 | ); |
|
| 431 | } |
|
| 432 | ||
| 433 | return $annotation; |
|
| 434 | } |
|
| 435 | ||
| 436 | /** |
|
| 437 | * Validates property annotation |
|
| @@ 444-454 (lines=11) @@ | ||
| 441 | * @return string |
|
| 442 | * @throws \InvalidArgumentException |
|
| 443 | */ |
|
| 444 | public function validatePropertyAnnotation($annotation) |
|
| 445 | { |
|
| 446 | if (!in_array($annotation, $this->getPropertyAnnotations())) { |
|
| 447 | throw $this->getException( |
|
| 448 | 'The property annotation isn\'t valid ("%s" given, expecting one of following: %s)', |
|
| 449 | [$annotation, implode(', ', $this->getPropertyAnnotations())] |
|
| 450 | ); |
|
| 451 | } |
|
| 452 | ||
| 453 | return $annotation; |
|
| 454 | } |
|
| 455 | ||
| 456 | /** |
|
| 457 | * Returns formatted question |
|