function checkAccess($stackPtr, $commentStart, $commentEnd) { $tokens = $this->currentFile->getTokens(); $access = $this->commentParser->getAccess(); $prevWS = $this->currentFile->findPrevious(T_WHITESPACE, $stackPtr - 1, null, false, "\n"); $type = $this->currentFile->findNext(array(T_PRIVATE, T_PUBLIC, T_PROTECTED), $prevWS + 1, $stackPtr - 1); $code = $tokens[$type]['code']; if (!is_null($access) && ($code === T_PUBLIC && $access->getValue() !== 'public' || $code === T_PRIVATE && $access->getValue() !== 'private' || $code === T_PROTECTED && $access->getValue() !== 'protected')) { $cnt = substr_count(preg_replace('/@access.+$/Ss', '', $this->currentFile->getTokensAsString($commentStart, $commentEnd - $commentStart + 1)), "\n"); $this->currentFile->addError($this->getReqPrefix('REQ.PHP.4.1.25') . 'Значение тэга @access не совпадает с декларацией (декларированно как ' . $tokens[$type]['content'] . ', а @access равен ' . $access->getValue() . ')', $commentStart + $cnt); } }