| @@ 455-465 (lines=11) @@ | ||
| 452 | * @return string |
|
| 453 | * @throws \InvalidArgumentException |
|
| 454 | */ |
|
| 455 | public function validatePropertyType($type) |
|
| 456 | { |
|
| 457 | if (!in_array($type, $this->getPropertyTypes())) { |
|
| 458 | throw $this->getException( |
|
| 459 | 'The property type isn\'t valid ("%s" given, expecting one of following: %s)', |
|
| 460 | [$type, implode(', ', $this->getPropertyTypes())] |
|
| 461 | ); |
|
| 462 | } |
|
| 463 | ||
| 464 | return $type; |
|
| 465 | } |
|
| 466 | ||
| 467 | /** |
|
| 468 | * Validates document annotation |
|
| @@ 475-485 (lines=11) @@ | ||
| 472 | * @return string |
|
| 473 | * @throws \InvalidArgumentException |
|
| 474 | */ |
|
| 475 | public function validateDocumentAnnotation($annotation) |
|
| 476 | { |
|
| 477 | if (!in_array($annotation, $this->getDocumentAnnotations())) { |
|
| 478 | throw $this->getException( |
|
| 479 | 'The document annotation isn\'t valid ("%s" given, expecting one of following: %s)', |
|
| 480 | [$annotation, implode(', ', $this->getDocumentAnnotations())] |
|
| 481 | ); |
|
| 482 | } |
|
| 483 | ||
| 484 | return $annotation; |
|
| 485 | } |
|
| 486 | ||
| 487 | /** |
|
| 488 | * Validates property annotation |
|
| @@ 495-505 (lines=11) @@ | ||
| 492 | * @return string |
|
| 493 | * @throws \InvalidArgumentException |
|
| 494 | */ |
|
| 495 | public function validatePropertyAnnotation($annotation) |
|
| 496 | { |
|
| 497 | if (!in_array($annotation, $this->getPropertyAnnotations())) { |
|
| 498 | throw $this->getException( |
|
| 499 | 'The property annotation isn\'t valid ("%s" given, expecting one of following: %s)', |
|
| 500 | [$annotation, implode(', ', $this->getPropertyAnnotations())] |
|
| 501 | ); |
|
| 502 | } |
|
| 503 | ||
| 504 | return $annotation; |
|
| 505 | } |
|
| 506 | ||
| 507 | /** |
|
| 508 | * Returns formatted question |
|