Skip to content

Commit

Permalink
Change check
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Babker committed Sep 22, 2016
1 parent 859e3fd commit dd8596c
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions build/phpcs/Joomla/Sniffs/Commenting/FileCommentSniff.php
Expand Up @@ -363,15 +363,22 @@ protected function processTags($commentStart, $commentEnd)
// Required tag missing.
if ($info['required'] === true && in_array($tag, $foundTags) === false) {
// We don't use package tags in namespaced code or the bootstrap file
if ($tag == 'package' && strpos($this->currentFile->getFilename(), '/libraries/src/') === false && strpos($this->currentFile->getFilename(), '/libraries/bootstrap.php') === false) {
$error = 'Missing @%s tag in %s comment';
$data = array(
$tag,
$docBlock,
);
$this->currentFile->addError($error, $commentEnd, 'MissingTag', $data);
continue;
if ($tag == 'package') {
// this should return 0 if there is no namespaced tokens
$namespaced = $this->currentFile->findNext(T_NAMESPACE, 0);

if ($namespaced !== 0 || strpos($this->currentFile->getFilename(), '/libraries/bootstrap.php')) {
continue;
}
}

$error = 'Missing @%s tag in %s comment';
$data = array(
$tag,
$docBlock,
);
$this->currentFile->addError($error, $commentEnd, 'MissingTag', $data);
continue;
}

// Get the line number for current tag.
Expand Down

0 comments on commit dd8596c

Please sign in to comment.