@@ 466-476 (lines=11) @@ | ||
463 | * @return string |
|
464 | * @throws \InvalidArgumentException |
|
465 | */ |
|
466 | public function validatePropertyType($type) |
|
467 | { |
|
468 | if (!in_array($type, $this->getPropertyTypes())) { |
|
469 | throw $this->getException( |
|
470 | 'The property type isn\'t valid ("%s" given, expecting one of following: %s)', |
|
471 | [$type, implode(', ', $this->getPropertyTypes())] |
|
472 | ); |
|
473 | } |
|
474 | ||
475 | return $type; |
|
476 | } |
|
477 | ||
478 | /** |
|
479 | * Validates document annotation |
|
@@ 486-496 (lines=11) @@ | ||
483 | * @return string |
|
484 | * @throws \InvalidArgumentException |
|
485 | */ |
|
486 | public function validateDocumentAnnotation($annotation) |
|
487 | { |
|
488 | if (!in_array($annotation, $this->getDocumentAnnotations())) { |
|
489 | throw $this->getException( |
|
490 | 'The document annotation isn\'t valid ("%s" given, expecting one of following: %s)', |
|
491 | [$annotation, implode(', ', $this->getDocumentAnnotations())] |
|
492 | ); |
|
493 | } |
|
494 | ||
495 | return $annotation; |
|
496 | } |
|
497 | ||
498 | /** |
|
499 | * Validates property annotation |
|
@@ 506-516 (lines=11) @@ | ||
503 | * @return string |
|
504 | * @throws \InvalidArgumentException |
|
505 | */ |
|
506 | public function validatePropertyAnnotation($annotation) |
|
507 | { |
|
508 | if (!in_array($annotation, $this->propertyAnnotations)) { |
|
509 | throw $this->getException( |
|
510 | 'The property annotation isn\'t valid ("%s" given, expecting one of following: %s)', |
|
511 | [$annotation, implode(', ', $this->propertyAnnotations)] |
|
512 | ); |
|
513 | } |
|
514 | ||
515 | return $annotation; |
|
516 | } |
|
517 | ||
518 | /** |
|
519 | * Returns formatted question |