Home
last modified time | relevance | path

Searched refs:stackPtr (Results 51 – 75 of 219) sorted by relevance

123456789

/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/
H A DDisallowMultipleStatementsSniff.php48 * @param int $stackPtr The position of the current token in
53 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
57 … = $phpcsFile->findPrevious(array(T_SEMICOLON, T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO), ($stackPtr - 1));
62 $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'no');
67 if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) {
68 foreach ($tokens[$stackPtr]['nested_parenthesis'] as $bracket) {
81 if ($tokens[$prev]['line'] === $tokens[$stackPtr]['line']) {
82 $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'yes');
85 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SameLine');
96 $phpcsFile->recordMetric($stackPtr, 'Multiple statements on same line', 'no');
H A DMultipleStatementAlignmentSniff.php80 * @param int $stackPtr The position of the current token
85 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
90 if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) {
98 $lastAssign = $this->checkAlignment($phpcsFile, $stackPtr);
108 * @param int $stackPtr The position of the current token
113 public function checkAlignment(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
119 $lastLine = $tokens[$stackPtr]['line'];
122 $lastCode = $stackPtr;
160 if ($assign !== $stackPtr) {
188 if ($assign !== $stackPtr) {
[all …]
H A DSpaceAfterNotSniff.php58 * @param int $stackPtr The position of the current token in
63 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
68 if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) {
69 $spacing = $tokens[($stackPtr + 1)]['length'];
77 $fix = $phpcsFile->addFixableError($message, $stackPtr, 'Incorrect', array($spacing));
81 $phpcsFile->fixer->addContent($stackPtr, ' ');
83 $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' ');
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR1/Sniffs/Classes/
H A DClassDeclarationSniff.php58 * @param integer $stackPtr The position of the current token in
63 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
73 if (isset($tokens[$stackPtr]['scope_closer']) === false) {
77 $errorData = array(strtolower($tokens[$stackPtr]['content']));
79 …$nextClass = $phpcsFile->findNext(array(T_CLASS, T_INTERFACE, T_TRAIT), ($tokens[$stackPtr]['scope…
83 $phpcsFile->recordMetric($stackPtr, 'One class per file', 'no');
85 $phpcsFile->recordMetric($stackPtr, 'One class per file', 'yes');
92 $phpcsFile->addError($error, $stackPtr, 'MissingNamespace', $errorData);
93 $phpcsFile->recordMetric($stackPtr, 'Class defined in namespace', 'no');
95 $phpcsFile->recordMetric($stackPtr, 'Class defined in namespace', 'yes');
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/
H A DElseIfDeclarationSniff.php51 * @param int $stackPtr The position of the current token in the
56 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
60 if ($tokens[$stackPtr]['code'] === T_ELSEIF) {
61 $phpcsFile->recordMetric($stackPtr, 'Use of ELSE IF or ELSEIF', 'elseif');
65 $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
67 $phpcsFile->recordMetric($stackPtr, 'Use of ELSE IF or ELSEIF', 'else if');
69 $fix = $phpcsFile->addFixableWarning($error, $stackPtr, 'NotAllowed');
73 $phpcsFile->fixer->replaceToken($stackPtr, 'elseif');
74 for ($i = ($stackPtr + 1); $i <= $next; $i++) {
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Strings/
H A DEchoedStringsSniff.php51 * @param int $stackPtr The position of the current token in the
56 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
60 $firstContent = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
63 $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'no');
67 $end = $phpcsFile->findNext(array(T_SEMICOLON, T_CLOSE_TAG), $stackPtr, null, false);
72 $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'no');
78 $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'no');
82 $phpcsFile->recordMetric($stackPtr, 'Brackets around echoed strings', 'yes');
84 …if (($phpcsFile->findNext(PHP_CodeSniffer_Tokens::$operators, $stackPtr, $end, false)) === false) {
87 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'HasBracket');
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/
H A DScopeKeywordSpacingSniff.php52 * @param int $stackPtr The position of the current token
57 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
61 $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true);
62 $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
64 if ($tokens[$stackPtr]['code'] === T_STATIC
77 $nextToken = $tokens[($stackPtr + 1)];
82 $data = array($tokens[$stackPtr]['content']);
83 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data);
85 $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' ');
H A DControlStructureSpacingSniff.php76 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
80 if (isset($tokens[$stackPtr]['parenthesis_opener']) === true
81 && isset($tokens[$stackPtr]['parenthesis_closer']) === true
83 $parenOpener = $tokens[$stackPtr]['parenthesis_opener'];
84 $parenCloser = $tokens[$stackPtr]['parenthesis_closer'];
126 if (isset($tokens[$stackPtr]['scope_closer']) === false) {
130 $scopeOpener = $tokens[$stackPtr]['scope_opener'];
131 $scopeCloser = $tokens[$stackPtr]['scope_closer'];
246 if ($tokens[$stackPtr]['code'] === T_IF) {
253 && $tokens[$stackPtr]['code'] === T_DO
[all …]
H A DFunctionClosingBraceSpaceSniff.php63 * @param int $stackPtr The position of the current token
68 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
72 if (isset($tokens[$stackPtr]['scope_closer']) === false) {
77 $closeBrace = $tokens[$stackPtr]['scope_closer'];
84 if ($tokens[$stackPtr]['scope_closer'] !== ($tokens[$stackPtr]['scope_opener'] + 1)) {
89 for ($i = ($tokens[$stackPtr]['scope_opener'] + 1); $i < $closeBrace; $i++) {
101 if ($phpcsFile->hasCondition($stackPtr, T_FUNCTION) === true
102 || $phpcsFile->hasCondition($stackPtr, T_CLOSURE) === true
103 || isset($tokens[$stackPtr]['nested_parenthesis']) === true
112 $afterKeyword = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
[all …]
H A DMemberVarSpacingSniff.php40 * @param int $stackPtr The position where the token was found.
44 protected function processMemberVar(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
52 $start = $stackPtr;
53 $prev = $phpcsFile->findPrevious($ignore, ($stackPtr - 1), null, true);
72 for ($i = ($prev + 1); $i <= $stackPtr; $i++) {
73 if ($tokens[$i]['line'] === $tokens[$stackPtr]['line']) {
90 if ($start === $stackPtr) {
111 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Incorrect', $data);
137 * @param int $stackPtr The position where the token was found.
141 protected function processVariable(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
[all …]
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/
H A DOpeningFunctionBraceBsdAllmanSniff.php68 * @param int $stackPtr The position of the current token in the
73 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
77 if (isset($tokens[$stackPtr]['scope_opener']) === false) {
81 if (($tokens[$stackPtr]['code'] === T_FUNCTION
83 || ($tokens[$stackPtr]['code'] === T_CLOSURE
89 $openingBrace = $tokens[$stackPtr]['scope_opener'];
90 $closeBracket = $tokens[$stackPtr]['parenthesis_closer'];
91 if ($tokens[$stackPtr]['code'] === T_CLOSURE) {
137 if ($next === $tokens[$stackPtr]['scope_closer']) {
158 $lineStart = $phpcsFile->findFirstOnLine(T_WHITESPACE, $stackPtr, true);
[all …]
H A DOpeningFunctionBraceKernighanRitchieSniff.php69 * @param int $stackPtr The position of the current token in the
74 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
78 if (isset($tokens[$stackPtr]['scope_opener']) === false) {
82 if (($tokens[$stackPtr]['code'] === T_FUNCTION
84 || ($tokens[$stackPtr]['code'] === T_CLOSURE
90 $openingBrace = $tokens[$stackPtr]['scope_opener'];
91 $closeBracket = $tokens[$stackPtr]['parenthesis_closer'];
92 if ($tokens[$stackPtr]['code'] === T_CLOSURE) {
106 $phpcsFile->recordMetric($stackPtr, 'Function opening brace placement', 'new line');
135 $phpcsFile->recordMetric($stackPtr, 'Function opening brace placement', 'same line');
[all …]
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/
H A DUpperCaseConstantSniff.php54 * @param int $stackPtr The position of the current token in the
59 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
62 $keyword = $tokens[$stackPtr]['content'];
66 $phpcsFile->recordMetric($stackPtr, 'PHP constant case', 'lower');
68 $phpcsFile->recordMetric($stackPtr, 'PHP constant case', 'mixed');
77 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found', $data);
79 $phpcsFile->fixer->replaceToken($stackPtr, $expected);
82 $phpcsFile->recordMetric($stackPtr, 'PHP constant case', 'upper');
H A DLowerCaseConstantSniff.php64 * @param int $stackPtr The position of the current token in the
69 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
72 $keyword = $tokens[$stackPtr]['content'];
76 $phpcsFile->recordMetric($stackPtr, 'PHP constant case', 'upper');
78 $phpcsFile->recordMetric($stackPtr, 'PHP constant case', 'mixed');
87 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found', $data);
89 $phpcsFile->fixer->replaceToken($stackPtr, $expected);
92 $phpcsFile->recordMetric($stackPtr, 'PHP constant case', 'lower');
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Arrays/
H A DDisallowLongArraySyntaxSniff.php46 * @param int $stackPtr The position of the current token
51 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
53 $phpcsFile->recordMetric($stackPtr, 'Short array syntax used', 'no');
56 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'Found');
60 $opener = $tokens[$stackPtr]['parenthesis_opener'];
61 $closer = $tokens[$stackPtr]['parenthesis_closer'];
66 $phpcsFile->fixer->replaceToken($stackPtr, '[]');
68 $phpcsFile->fixer->replaceToken($stackPtr, '');
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/
H A DClassCommentSniff.php52 * @param int $stackPtr The position of the current token
57 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
62 $type = strtolower($tokens[$stackPtr]['content']);
68 $commentEnd = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true);
72 $phpcsFile->addError('Missing class doc comment', $stackPtr, 'Missing');
73 $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'no');
77 $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'yes');
80 …$phpcsFile->addError('You must use "/**" style comments for a class comment', $stackPtr, 'WrongSty…
85 $this->processTags($phpcsFile, $stackPtr, $tokens[$commentEnd]['comment_opener']);
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Formatting/
H A DMultiLineAssignmentSniff.php55 * @param int $stackPtr The position of the current token
60 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
65 $next = $phpcsFile->findNext(T_WHITESPACE, ($stackPtr + 1), null, true);
71 if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) {
73 $phpcsFile->addError($error, $stackPtr, 'EqualSignLine');
78 $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), false, true);
84 if ($tokens[$prev]['line'] === $tokens[$stackPtr]['line']) {
103 $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1));
113 $phpcsFile->addError($error, $stackPtr, 'Indent', $data);
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Classes/
H A DOpeningBraceSameLineSniff.php57 * @param int $stackPtr The position of the current token in the
62 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
65 $scope_identifier = $phpcsFile->findNext(T_STRING, ($stackPtr + 1));
66 …$errorData = array(strtolower($tokens[$stackPtr]['content']).' '.$tokens[$scope_identifier]…
68 if (isset($tokens[$stackPtr]['scope_opener']) === false) {
70 $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $errorData);
74 $openingBrace = $tokens[$stackPtr]['scope_opener'];
77 $lastClassLineToken = $phpcsFile->findPrevious(T_STRING, ($openingBrace - 1), $stackPtr);
83 $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'new line');
93 $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'same line');
[all …]
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/
H A DForbiddenStylesSniff.php103 * @param int $stackPtr The position of the current token in
108 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
111 $style = strtolower($tokens[$stackPtr]['content']);
136 $this->addError($phpcsFile, $stackPtr, $style, $pattern);
145 * @param int $stackPtr The position of the forbidden style
152 protected function addError($phpcsFile, $stackPtr, $style, $pattern=null) argument
171 …$fix = $phpcsFile->addFixableError($error.'; use %s instead', $stackPtr, $type.'WithAlternative', …
173 …$fix = $phpcsFile->addFixableWarning($error.'; use %s instead', $stackPtr, $type.'WithAlternative'…
177 $phpcsFile->fixer->replaceToken($stackPtr, $this->forbiddenStyles[$pattern]);
181 $phpcsFile->addError($error, $stackPtr, $type, $data);
[all …]
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Operators/
H A DComparisonOperatorUsageSniff.php122 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
127 if ($tokens[$stackPtr]['code'] === T_INLINE_THEN) {
163 } else if ($tokens[$stackPtr]['code'] === T_FOR) {
164 if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) {
168 $openingBracket = $tokens[$stackPtr]['parenthesis_opener'];
169 $closingBracket = $tokens[$stackPtr]['parenthesis_closer'];
177 if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) {
181 $start = $tokens[$stackPtr]['parenthesis_opener'];
182 $end = $tokens[$stackPtr]['parenthesis_closer'];
225 $phpcsFile->addError($error, $stackPtr, 'ImplicitTrue');
[all …]
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/
H A DForEachLoopDeclarationSniff.php65 * @param int $stackPtr The position of the current token in the
70 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
76 $openingBracket = $phpcsFile->findNext(T_OPEN_PARENTHESIS, $stackPtr);
79 $phpcsFile->addWarning($error, $stackPtr, 'MissingOpenParenthesis');
85 $phpcsFile->addWarning($error, $stackPtr, 'MissingCloseParenthesis');
93 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceAfterOpen');
123 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'SpaceBeforeClose');
154 $phpcsFile->addWarning($error, $stackPtr, 'MissingAs');
196 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceAfterArrow');
215 $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoSpaceBeforeAs');
[all …]
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Arrays/
H A DArrayDeclarationSniff.php60 if ($tokens[$stackPtr]['code'] === T_ARRAY) {
64 if ($tokens[$stackPtr]['content'] !== strtolower($tokens[$stackPtr]['content'])) {
65 if ($tokens[$stackPtr]['content'] === strtoupper($tokens[$stackPtr]['content'])) {
72 $data = array($tokens[$stackPtr]['content']);
88 if ($arrayStart !== ($stackPtr + 1)) {
103 $arrayStart = $stackPtr;
104 $arrayEnd = $tokens[$stackPtr]['bracket_closer'];
317 $keywordStart = $tokens[$stackPtr]['column'];
352 if ($tokens[$stackPtr]['code'] === T_ARRAY) {
355 $lastToken = $stackPtr;
[all …]
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Metrics/
H A DNestingLevelSniff.php62 * @param int $stackPtr The position of the current token
67 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
72 if (isset($tokens[$stackPtr]['scope_opener']) === false) {
77 $start = $tokens[$stackPtr]['scope_opener'];
78 $end = $tokens[$stackPtr]['scope_closer'];
91 $nestingLevel = ($nestingLevel - $tokens[$stackPtr]['level'] - 1);
99 $phpcsFile->addError($error, $stackPtr, 'MaxExceeded', $data);
106 $phpcsFile->addWarning($warning, $stackPtr, 'TooHigh', $data);
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/
H A DClassCommentSniff.php54 * @param int $stackPtr The position of the current token
59 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
65 $commentEnd = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true);
69 $phpcsFile->addError('Missing class doc comment', $stackPtr, 'Missing');
70 $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'no');
74 $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'yes');
77 …$phpcsFile->addError('You must use "/**" style comments for a class comment', $stackPtr, 'WrongSty…
81 if ($tokens[$commentEnd]['line'] !== ($tokens[$stackPtr]['line'] - 1)) {
/plugin/icalevents/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Classes/
H A DClassDeclarationSniff.php61 * @param integer $stackPtr The position of the current token in the
66 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) argument
69 $errorData = array(strtolower($tokens[$stackPtr]['content']));
71 if (isset($tokens[$stackPtr]['scope_opener']) === false) {
73 $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $errorData);
77 $curlyBrace = $tokens[$stackPtr]['scope_opener'];
82 $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'same line');
97 $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'new line');
102 $tokens[$stackPtr]['content'],
103 $tokens[$stackPtr]['content'],
[all …]

123456789