Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Protected Member Functions
FunctionCommentSniff Class Reference
Inheritance diagram for FunctionCommentSniff:

Protected Member Functions

 processReturn (File $phpcsFile, $stackPtr, $commentStart)
 
 processThrows (File $phpcsFile, $stackPtr, $commentStart)
 
 processParams (File $phpcsFile, $stackPtr, $commentStart)
 
 checkSpacingAfterParamType (File $phpcsFile, $param, $maxType, $spacing=1)
 
 checkSpacingAfterParamName (File $phpcsFile, $param, $maxVar, $spacing=1)
 

Detailed Description

Definition at line 17 of file FunctionCommentSniff.php.

Member Function Documentation

◆ checkSpacingAfterParamName()

checkSpacingAfterParamName ( File  $phpcsFile,
  $param,
  $maxVar,
  $spacing = 1 
)
protected

Check the spacing after the name of a parameter.

Parameters
\PHP_CodeSniffer\Files\File$phpcsFileThe file being scanned.
array$paramThe parameter to be checked.
int$maxVarThe maxlength of the longest parameter name.
int$spacingThe number of spaces to add after the type.
Returns
void

Definition at line 618 of file FunctionCommentSniff.php.

619  {
620  // Check number of spaces after the var name.
621  $spaces = ($maxVar - strlen($param['var']) + $spacing);
622  if ($param['var_space'] !== $spaces) {
623  $error = 'Expected %s spaces after parameter name; %s found';
624  $data = array(
625  $spaces,
626  $param['var_space'],
627  );
628 
629  $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamName', $data);
630  if ($fix === true) {
631  $phpcsFile->fixer->beginChangeset();
632 
633  $content = $param['type'];
634  $content .= str_repeat(' ', $param['type_space']);
635  $content .= $param['var'];
636  $content .= str_repeat(' ', $spaces);
637  $content .= $param['commentLines'][0]['comment'];
638  $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content);
639 
640  // Fix up the indent of additional comment lines.
641  foreach ($param['commentLines'] as $lineNum => $line) {
642  if ($lineNum === 0
643  || $param['commentLines'][$lineNum]['indent'] === 0
644  ) {
645  continue;
646  }
647 
648  $diff = ($param['var_space'] - $spaces);
649  $newIndent = ($param['commentLines'][$lineNum]['indent'] - $diff);
650  $phpcsFile->fixer->replaceToken(
651  ($param['commentLines'][$lineNum]['token'] - 1),
652  str_repeat(' ', $newIndent)
653  );
654  }
655 
656  $phpcsFile->fixer->endChangeset();
657  }//end if
658  }//end if
659 
660  }//end checkSpacingAfterParamName()

◆ checkSpacingAfterParamType()

checkSpacingAfterParamType ( File  $phpcsFile,
  $param,
  $maxType,
  $spacing = 1 
)
protected

Check the spacing after the type of a parameter.

Parameters
\PHP_CodeSniffer\Files\File$phpcsFileThe file being scanned.
array$paramThe parameter to be checked.
int$maxTypeThe maxlength of the longest parameter type.
int$spacingThe number of spaces to add after the type.
Returns
void

Definition at line 563 of file FunctionCommentSniff.php.

564  {
565  // Check number of spaces after the type.
566  $spaces = ($maxType - strlen($param['type']) + $spacing);
567  if ($param['type_space'] !== $spaces) {
568  $error = 'Expected %s spaces after parameter type; %s found';
569  $data = array(
570  $spaces,
571  $param['type_space'],
572  );
573 
574  $fix = $phpcsFile->addFixableError($error, $param['tag'], 'SpacingAfterParamType', $data);
575  if ($fix === true) {
576  $phpcsFile->fixer->beginChangeset();
577 
578  $content = $param['type'];
579  $content .= str_repeat(' ', $spaces);
580  $content .= $param['var'];
581  $content .= str_repeat(' ', $param['var_space']);
582  $content .= $param['commentLines'][0]['comment'];
583  $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content);
584 
585  // Fix up the indent of additional comment lines.
586  foreach ($param['commentLines'] as $lineNum => $line) {
587  if ($lineNum === 0
588  || $param['commentLines'][$lineNum]['indent'] === 0
589  ) {
590  continue;
591  }
592 
593  $diff = ($param['type_space'] - $spaces);
594  $newIndent = ($param['commentLines'][$lineNum]['indent'] - $diff);
595  $phpcsFile->fixer->replaceToken(
596  ($param['commentLines'][$lineNum]['token'] - 1),
597  str_repeat(' ', $newIndent)
598  );
599  }
600 
601  $phpcsFile->fixer->endChangeset();
602  }//end if
603  }//end if
604 
605  }//end checkSpacingAfterParamType()

◆ processParams()

processParams ( File  $phpcsFile,
  $stackPtr,
  $commentStart 
)
protected

Process the function parameter comments.

Parameters
\PHP_CodeSniffer\Files\File$phpcsFileThe file being scanned.
int$stackPtrThe position of the current token in the stack passed in $tokens.
int$commentStartThe position in the stack where the comment started.
Returns
void

Definition at line 244 of file FunctionCommentSniff.php.

245  {
246  if ($this->phpVersion === null) {
247  $this->phpVersion = Config::getConfigData('php_version');
248  if ($this->phpVersion === null) {
249  $this->phpVersion = PHP_VERSION_ID;
250  }
251  }
252 
253  $tokens = $phpcsFile->getTokens();
254 
255  $params = array();
256  $maxType = 0;
257  $maxVar = 0;
258  foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) {
259  if ($tokens[$tag]['content'] !== '@param') {
260  continue;
261  }
262 
263  $type = '';
264  $typeSpace = 0;
265  $var = '';
266  $varSpace = 0;
267  $comment = '';
268  $commentLines = array();
269  if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) {
270  $matches = array();
271  preg_match('/([^$&.]+)(?:((?:\.\.\.)?(?:\$|&)[^\s]+)(?:(\s+)(.*))?)?/', $tokens[($tag + 2)]['content'], $matches);
272 
273  if (empty($matches) === false) {
274  $typeLen = strlen($matches[1]);
275  $type = trim($matches[1]);
276  $typeSpace = ($typeLen - strlen($type));
277  $typeLen = strlen($type);
278  if ($typeLen > $maxType) {
279  $maxType = $typeLen;
280  }
281  }
282 
283  if (isset($matches[2]) === true) {
284  $var = $matches[2];
285  $varLen = strlen($var);
286  if ($varLen > $maxVar) {
287  $maxVar = $varLen;
288  }
289 
290  if (isset($matches[4]) === true) {
291  $varSpace = strlen($matches[3]);
292  $comment = $matches[4];
293  $commentLines[] = array(
294  'comment' => $comment,
295  'token' => ($tag + 2),
296  'indent' => $varSpace,
297  );
298 
299  // Any strings until the next tag belong to this comment.
300  if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) {
301  $end = $tokens[$commentStart]['comment_tags'][($pos + 1)];
302  } else {
303  $end = $tokens[$commentStart]['comment_closer'];
304  }
305 
306  for ($i = ($tag + 3); $i < $end; $i++) {
307  if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) {
308  $indent = 0;
309  if ($tokens[($i - 1)]['code'] === T_DOC_COMMENT_WHITESPACE) {
310  $indent = strlen($tokens[($i - 1)]['content']);
311  }
312 
313  $comment .= ' '.$tokens[$i]['content'];
314  $commentLines[] = array(
315  'comment' => $tokens[$i]['content'],
316  'token' => $i,
317  'indent' => $indent,
318  );
319  }
320  }
321  } else {
322  $error = 'Missing parameter comment';
323 // $phpcsFile->addError($error, $tag, 'MissingParamComment');
324  $commentLines[] = array('comment' => '');
325  }//end if
326  } else {
327  $error = 'Missing parameter name';
328  $phpcsFile->addError($error, $tag, 'MissingParamName');
329  }//end if
330  } else {
331  $error = 'Missing parameter type';
332  $phpcsFile->addError($error, $tag, 'MissingParamType');
333  }//end if
334 
335  $params[] = array(
336  'tag' => $tag,
337  'type' => $type,
338  'var' => $var,
339  'comment' => $comment,
340  'commentLines' => $commentLines,
341  'type_space' => $typeSpace,
342  'var_space' => $varSpace,
343  );
344  }//end foreach
345 
346  $realParams = $phpcsFile->getMethodParameters($stackPtr);
347  $foundParams = array();
348 
349  // We want to use ... for all variable length arguments, so added
350  // this prefix to the variable name so comparisons are easier.
351  foreach ($realParams as $pos => $param) {
352  if ($param['variable_length'] === true) {
353  $realParams[$pos]['name'] = '...'.$realParams[$pos]['name'];
354  }
355  }
356 
357  foreach ($params as $pos => $param) {
358  // If the type is empty, the whole line is empty.
359  if ($param['type'] === '') {
360  continue;
361  }
362 
363  // Check the param type value.
364  $typeNames = explode('|', $param['type']);
365  $suggestedTypeNames = array();
366 
367  foreach ($typeNames as $typeName) {
368  $suggestedName = Common::suggestType($typeName);
369  $suggestedTypeNames[] = $suggestedName;
370 
371  if (count($typeNames) > 1) {
372  continue;
373  }
374 
375  // Check type hint for array and custom type.
376  $suggestedTypeHint = '';
377  if (strpos($suggestedName, 'array') !== false || substr($suggestedName, -2) === '[]') {
378  $suggestedTypeHint = 'array';
379  } else if (strpos($suggestedName, 'callable') !== false) {
380  $suggestedTypeHint = 'callable';
381  } else if (strpos($suggestedName, 'callback') !== false) {
382  $suggestedTypeHint = 'callable';
383  } else if (in_array($suggestedName, Common::$allowedTypes) === false) {
384  $suggestedTypeHint = $suggestedName;
385  }
386 
387  if ($this->phpVersion >= 70000) {
388  if ($suggestedName === 'string') {
389  $suggestedTypeHint = 'string';
390  } else if ($suggestedName === 'int' || $suggestedName === 'integer') {
391  $suggestedTypeHint = 'int';
392  } else if ($suggestedName === 'float') {
393  $suggestedTypeHint = 'float';
394  } else if ($suggestedName === 'bool' || $suggestedName === 'boolean') {
395  $suggestedTypeHint = 'bool';
396  }
397  }
398 
399  if ($suggestedTypeHint !== '' && isset($realParams[$pos]) === true) {
400  $typeHint = $realParams[$pos]['type_hint'];
401  if ($typeHint === '') {
402  $error = 'Type hint "%s" missing for %s';
403  $data = array(
404  $suggestedTypeHint,
405  $param['var'],
406  );
407 
408  $errorCode = 'TypeHintMissing';
409  if ($suggestedTypeHint === 'string'
410  || $suggestedTypeHint === 'int'
411  || $suggestedTypeHint === 'float'
412  || $suggestedTypeHint === 'bool'
413  ) {
414  $errorCode = 'Scalar'.$errorCode;
415  }
416 
417 // $phpcsFile->addError($error, $stackPtr, $errorCode, $data);
418  } else if ($typeHint !== substr($suggestedTypeHint, (strlen($typeHint) * -1))) {
419  $error = 'Expected type hint "%s"; found "%s" for %s';
420  $data = array(
421  $suggestedTypeHint,
422  $typeHint,
423  $param['var'],
424  );
425  $phpcsFile->addError($error, $stackPtr, 'IncorrectTypeHint', $data);
426  }//end if
427  } else if ($suggestedTypeHint === '' && isset($realParams[$pos]) === true) {
428  $typeHint = $realParams[$pos]['type_hint'];
429  if ($typeHint !== '') {
430  $error = 'Unknown type hint "%s" found for %s';
431  $data = array(
432  $typeHint,
433  $param['var'],
434  );
435  $phpcsFile->addError($error, $stackPtr, 'InvalidTypeHint', $data);
436  }
437  }//end if
438  }//end foreach
439 
440  $suggestedType = implode($suggestedTypeNames, '|');
441  if ($param['type'] !== $suggestedType) {
442  $error = 'Expected "%s" but found "%s" for parameter type';
443  $data = array(
444  $suggestedType,
445  $param['type'],
446  );
447 
448  $fix = $phpcsFile->addFixableError($error, $param['tag'], 'IncorrectParamVarName', $data);
449  if ($fix === true) {
450  $phpcsFile->fixer->beginChangeset();
451 
452  $content = $suggestedType;
453  $content .= str_repeat(' ', $param['type_space']);
454  $content .= $param['var'];
455  $content .= str_repeat(' ', $param['var_space']);
456  if (isset($param['commentLines'][0]) === true) {
457  $content .= $param['commentLines'][0]['comment'];
458  }
459 
460  $phpcsFile->fixer->replaceToken(($param['tag'] + 2), $content);
461 
462  // Fix up the indent of additional comment lines.
463  foreach ($param['commentLines'] as $lineNum => $line) {
464  if ($lineNum === 0
465  || $param['commentLines'][$lineNum]['indent'] === 0
466  ) {
467  continue;
468  }
469 
470  $diff = (strlen($param['type']) - strlen($suggestedType));
471  $newIndent = ($param['commentLines'][$lineNum]['indent'] - $diff);
472  $phpcsFile->fixer->replaceToken(
473  ($param['commentLines'][$lineNum]['token'] - 1),
474  str_repeat(' ', $newIndent)
475  );
476  }
477 
478  $phpcsFile->fixer->endChangeset();
479  }//end if
480  }//end if
481 
482  if ($param['var'] === '') {
483  continue;
484  }
485 
486  $foundParams[] = $param['var'];
487 
488  // Check number of spaces after the type.
489  $this->checkSpacingAfterParamType($phpcsFile, $param, $maxType);
490 
491  // Make sure the param name is correct.
492  if (isset($realParams[$pos]) === true) {
493  $realName = $realParams[$pos]['name'];
494  if ($realName !== $param['var']) {
495  $code = 'ParamNameNoMatch';
496  $data = array(
497  $param['var'],
498  $realName,
499  );
500 
501  $error = 'Doc comment for parameter %s does not match ';
502  if (strtolower($param['var']) === strtolower($realName)) {
503  $error .= 'case of ';
504  $code = 'ParamNameNoCaseMatch';
505  }
506 
507  $error .= 'actual variable name %s';
508 
509  $phpcsFile->addError($error, $param['tag'], $code, $data);
510  }
511  } else if (substr($param['var'], -4) !== ',...') {
512  // We must have an extra parameter comment.
513  $error = 'Superfluous parameter comment';
514  $phpcsFile->addError($error, $param['tag'], 'ExtraParamComment');
515  }//end if
516 
517  if ($param['comment'] === '') {
518  continue;
519  }
520 
521  // Check number of spaces after the var name.
522  $this->checkSpacingAfterParamName($phpcsFile, $param, $maxVar);
523 
524  // Param comments must start with a capital letter and end with the full stop.
525  if (preg_match('/^(\p{Ll}|\P{L})/u', $param['comment']) === 1) {
526  $error = 'Parameter comment must start with a capital letter';
527  $phpcsFile->addError($error, $param['tag'], 'ParamCommentNotCapital');
528  }
529 
530  $lastChar = substr($param['comment'], -1);
531  if ($lastChar !== '.') {
532  $error = 'Parameter comment must end with a full stop';
533  $phpcsFile->addError($error, $param['tag'], 'ParamCommentFullStop');
534  }
535  }//end foreach
536 
537  $realNames = array();
538  foreach ($realParams as $realParam) {
539  $realNames[] = $realParam['name'];
540  }
541 
542  // Report missing comments.
543  $diff = array_diff($realNames, $foundParams);
544  foreach ($diff as $neededParam) {
545  $error = 'Doc comment for parameter "%s" missing';
546  $data = array($neededParam);
547 // $phpcsFile->addError($error, $commentStart, 'MissingParamTag', $data);
548  }
549 
550  }//end processParams()
checkSpacingAfterParamType(File $phpcsFile, $param, $maxType, $spacing=1)
checkSpacingAfterParamName(File $phpcsFile, $param, $maxVar, $spacing=1)
$type
Definition: item.phtml:13
$pos
Definition: list.phtml:42
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18
$i
Definition: gallery.phtml:31
$tokens
Definition: cards_list.phtml:9
$code
Definition: info.phtml:12

◆ processReturn()

processReturn ( File  $phpcsFile,
  $stackPtr,
  $commentStart 
)
protected

Process the return comment of this function comment.

Parameters
\PHP_CodeSniffer\Files\File$phpcsFileThe file being scanned.
int$stackPtrThe position of the current token in the stack passed in $tokens.
int$commentStartThe position in the stack where the comment started.
Returns
void

Definition at line 38 of file FunctionCommentSniff.php.

39  {
40  $tokens = $phpcsFile->getTokens();
41 
42  // Skip constructor and destructor.
43  $methodName = $phpcsFile->getDeclarationName($stackPtr);
44  $isSpecialMethod = ($methodName === '__construct' || $methodName === '__destruct');
45 
46  $return = null;
47  foreach ($tokens[$commentStart]['comment_tags'] as $tag) {
48  if ($tokens[$tag]['content'] === '@return') {
49  if ($return !== null) {
50  $error = 'Only 1 @return tag is allowed in a function comment';
51  $phpcsFile->addError($error, $tag, 'DuplicateReturn');
52  return;
53  }
54 
55  $return = $tag;
56  }
57  }
58 
59 
60  if ($isSpecialMethod === true) {
61  return;
62  }
63 
64  if ($return !== null) {
65  $content = $tokens[($return + 2)]['content'];
66  if (empty($content) === true || $tokens[($return + 2)]['code'] !== T_DOC_COMMENT_STRING) {
67  $error = 'Return type missing for @return tag in function comment';
68  $phpcsFile->addError($error, $return, 'MissingReturnType');
69  } else {
70  // Support both a return type and a description.
71  $split = preg_match('`^((?:\|?(?:array\([^\)]*\)|[\\\\a-z0-9\[\]]+))*)( .*)?`i', $content, $returnParts);
72  if (isset($returnParts[1]) === false) {
73  return;
74  }
75 
76  $returnType = $returnParts[1];
77 
78  // Check return type (can be multiple, separated by '|').
79  $typeNames = explode('|', $returnType);
80  $suggestedNames = array();
81  foreach ($typeNames as $i => $typeName) {
82  $suggestedName = Common::suggestType($typeName);
83  if (in_array($suggestedName, $suggestedNames) === false) {
84  $suggestedNames[] = $suggestedName;
85  }
86  }
87 
88  $suggestedType = implode('|', $suggestedNames);
89  if ($returnType !== $suggestedType) {
90  $error = 'Expected "%s" but found "%s" for function return type';
91  $data = array(
92  $suggestedType,
93  $returnType,
94  );
95  $fix = $phpcsFile->addFixableError($error, $return, 'InvalidReturn', $data);
96  if ($fix === true) {
97  $replacement = $suggestedType;
98  if (empty($returnParts[2]) === false) {
99  $replacement .= $returnParts[2];
100  }
101 
102  $phpcsFile->fixer->replaceToken(($return + 2), $replacement);
103  unset($replacement);
104  }
105  }
106 
107  // If the return type is void, make sure there is
108  // no return statement in the function.
109  if ($returnType === 'void') {
110  if (isset($tokens[$stackPtr]['scope_closer']) === true) {
111  $endToken = $tokens[$stackPtr]['scope_closer'];
112  for ($returnToken = $stackPtr; $returnToken < $endToken; $returnToken++) {
113  if ($tokens[$returnToken]['code'] === T_CLOSURE
114  || $tokens[$returnToken]['code'] === T_ANON_CLASS
115  ) {
116  $returnToken = $tokens[$returnToken]['scope_closer'];
117  continue;
118  }
119 
120  if ($tokens[$returnToken]['code'] === T_RETURN
121  || $tokens[$returnToken]['code'] === T_YIELD
122  || $tokens[$returnToken]['code'] === T_YIELD_FROM
123  ) {
124  break;
125  }
126  }
127 
128  if ($returnToken !== $endToken) {
129  // If the function is not returning anything, just
130  // exiting, then there is no problem.
131  $semicolon = $phpcsFile->findNext(T_WHITESPACE, ($returnToken + 1), null, true);
132  if ($tokens[$semicolon]['code'] !== T_SEMICOLON) {
133  $error = 'Function return type is void, but function contains return statement';
134  $phpcsFile->addError($error, $return, 'InvalidReturnVoid');
135  }
136  }
137  }//end if
138  } else if ($returnType !== 'mixed' && in_array('void', $typeNames, true) === false) {
139  // If return type is not void, there needs to be a return statement
140  // somewhere in the function that returns something.
141  if (isset($tokens[$stackPtr]['scope_closer']) === true) {
142  $endToken = $tokens[$stackPtr]['scope_closer'];
143  $returnToken = $phpcsFile->findNext(array(T_RETURN, T_YIELD, T_YIELD_FROM), $stackPtr, $endToken);
144  if ($returnToken === false) {
145  $error = 'Function return type is not void, but function has no return statement';
146  $phpcsFile->addError($error, $return, 'InvalidNoReturn');
147  } else {
148  $semicolon = $phpcsFile->findNext(T_WHITESPACE, ($returnToken + 1), null, true);
149  if ($tokens[$semicolon]['code'] === T_SEMICOLON) {
150  $error = 'Function return type is not void, but function is returning void here';
151  $phpcsFile->addError($error, $returnToken, 'InvalidReturnNotVoid');
152  }
153  }
154  }
155  }//end if
156  }//end if
157  } else {
158  $error = 'Missing @return tag in function comment';
159  $phpcsFile->addError($error, $tokens[$commentStart]['comment_closer'], 'MissingReturn');
160  }//end if
161 
162  }//end processReturn()
$replacement
Definition: website.php:23
$i
Definition: gallery.phtml:31
$tokens
Definition: cards_list.phtml:9

◆ processThrows()

processThrows ( File  $phpcsFile,
  $stackPtr,
  $commentStart 
)
protected

Process any throw tags that this function comment has.

Parameters
\PHP_CodeSniffer\Files\File$phpcsFileThe file being scanned.
int$stackPtrThe position of the current token in the stack passed in $tokens.
int$commentStartThe position in the stack where the comment started.
Returns
void

Definition at line 175 of file FunctionCommentSniff.php.

176  {
177  $tokens = $phpcsFile->getTokens();
178 
179  $throws = array();
180  foreach ($tokens[$commentStart]['comment_tags'] as $pos => $tag) {
181  if ($tokens[$tag]['content'] !== '@throws') {
182  continue;
183  }
184 
185  $exception = null;
186  $comment = null;
187  if ($tokens[($tag + 2)]['code'] === T_DOC_COMMENT_STRING) {
188  $matches = array();
189  preg_match('/([^\s]+)(?:\s+(.*))?/', $tokens[($tag + 2)]['content'], $matches);
190  $exception = $matches[1];
191  if (isset($matches[2]) === true && trim($matches[2]) !== '') {
192  $comment = $matches[2];
193  }
194  }
195 
196  if ($exception === null) {
197  $error = 'Exception type and comment missing for @throws tag in function comment';
198  $phpcsFile->addError($error, $tag, 'InvalidThrows');
199  } else if ($comment === null) {
200  $error = 'Comment missing for @throws tag in function comment';
201 // $phpcsFile->addError($error, $tag, 'EmptyThrows');
202  } else {
203  // Any strings until the next tag belong to this comment.
204  if (isset($tokens[$commentStart]['comment_tags'][($pos + 1)]) === true) {
205  $end = $tokens[$commentStart]['comment_tags'][($pos + 1)];
206  } else {
207  $end = $tokens[$commentStart]['comment_closer'];
208  }
209 
210  for ($i = ($tag + 3); $i < $end; $i++) {
211  if ($tokens[$i]['code'] === T_DOC_COMMENT_STRING) {
212  $comment .= ' '.$tokens[$i]['content'];
213  }
214  }
215 
216  // Starts with a capital letter and ends with a fullstop.
217  $firstChar = $comment{0};
218  if (strtoupper($firstChar) !== $firstChar) {
219  $error = '@throws tag comment must start with a capital letter';
220  $phpcsFile->addError($error, ($tag + 2), 'ThrowsNotCapital');
221  }
222 
223  $lastChar = substr($comment, -1);
224  if ($lastChar !== '.') {
225  $error = '@throws tag comment must end with a full stop';
226  $phpcsFile->addError($error, ($tag + 2), 'ThrowsNoFullStop');
227  }
228  }//end if
229  }//end foreach
230 
231  }//end processThrows()
$pos
Definition: list.phtml:42
$i
Definition: gallery.phtml:31
$tokens
Definition: cards_list.phtml:9

The documentation for this class was generated from the following file: