コード例 #1
0
 /**
  * InvalidFunctionException constructor.
  *
  * @param string $name
  */
 public function __construct($name)
 {
     parent::__construct(sprintf('Annotation function "%s" is undefined.', $name));
 }
コード例 #2
0
 public function __construct($method)
 {
     parent::__construct("Annotator method `{$method}` does not allow wildcards in annotation name.");
 }
コード例 #3
0
ファイル: Parser.php プロジェクト: andreia/doctrine
 /**
  * Generates a new syntax error.
  *
  * @param string $expected Expected string.
  * @param array $token Optional token.
  * @throws AnnotationException
  */
 private function syntaxError($expected, $token = null)
 {
     if ($token === null) {
         $token = $this->_lexer->lookahead;
     }
     $message = "Expected {$expected}, got ";
     if ($this->_lexer->lookahead === null) {
         $message .= 'end of string';
     } else {
         $message .= "'{$token['value']}' at position {$token['position']}";
     }
     if (strlen($this->_context)) {
         $message .= ' in ' . $this->_context;
     }
     $message .= '.';
     throw AnnotationException::syntaxError($message);
 }
コード例 #4
0
 public function __construct($annotation)
 {
     parent::__construct("The `{$annotation}` annotation was used wrong. Please check the arguments.");
 }