/**
  * Process the function parameter comments.
  *
  * @param int $commentStart The position in the stack where
  *                          the comment started.
  *
  * @return void
  */
 protected function processParams($commentStart)
 {
     if ($this->isInheritDoc()) {
         return;
     }
     parent::processParams($commentStart);
 }
 /**
  * Process the return comment of this function comment.
  *
  * @param int $commentStart The position in the stack where the comment started.
  * @param int $commentEnd   The position in the stack where the comment ended.
  *
  * @return void
  */
 protected function processReturn($commentStart, $commentEnd)
 {
     $tokens = $this->currentFile->getTokens();
     $funcPtr = $this->currentFile->findNext(T_FUNCTION, $commentEnd);
     // Only check for a return comment if a non-void return statement exists
     if (isset($tokens[$funcPtr]['scope_opener'])) {
         $start = $tokens[$funcPtr]['scope_opener'];
         // iterate over all return statements of this function,
         // run the check on the first which is not only 'return;'
         while ($returnToken = $this->currentFile->findNext(T_RETURN, $start, $tokens[$funcPtr]['scope_closer'])) {
             if ($this->isMatchingReturn($tokens, $returnToken)) {
                 parent::processReturn($commentStart, $commentEnd);
                 break;
             }
             $start = $returnToken + 1;
         }
     }
 }
 /**
  * Process the function parameter comments.
  *
  * @param PHP_CodeSniffer_File $phpcsFile    The file being scanned.
  * @param int                  $stackPtr     The position of the current token
  *                                           in the stack passed in $tokens.
  * @param int                  $commentStart The position in the stack where the comment started.
  *
  * @return void
  */
 protected function processParams(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $commentStart)
 {
     $tokens = $phpcsFile->getTokens();
     if ($this->isInheritDoc($phpcsFile, $stackPtr)) {
         return;
     }
     parent::processParams($phpcsFile, $stackPtr, $commentStart);
 }
Exemplo n.º 4
0
 /**
  * Process the return comment of this function comment.
  *
  * @param PHP_CodeSniffer_File $phpcsFile    The file being scanned.
  * @param int                  $stackPtr     The position of the current token
  *                                           in the stack passed in $tokens.
  * @param int                  $commentStart The position in the stack where the comment started.
  *
  * @return void
  */
 protected function processReturn(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $commentStart)
 {
     // Ignore functions without return type
     if (!$this->hasReturn) {
         return;
     }
     parent::processReturn($phpcsFile, $stackPtr, $commentStart);
 }