示例#1
0
 /**
  * Process the function "see" comments.
  *
  * @return void
  */
 protected function processSees($commentStart)
 {
     $sees = $this->commentParser->getSees();
     foreach ($sees as $see) {
         $errorPos = $see->getLine() + $commentStart;
         if ($see->getWhitespaceBeforeContent() !== ' ') {
             $error = 'Expected 1 space before see reference';
             $this->currentFile->addError($error, $errorPos, 'SpacingBeforeSee');
         }
         $comment = trim($see->getContent());
         if (strpos($comment, ' ') !== false) {
             $error = 'The @see reference should not contain any additional text';
             $this->currentFile->addError($error, $errorPos, 'SeeAdditionalText');
             continue;
         }
         if (preg_match('/[\\.!\\?]$/', $comment) === 1) {
             $error = 'Trailing punctuation for @see references is not allowed.';
             $this->currentFile->addError($error, $errorPos, 'SeePunctuation');
         }
     }
 }