/** * Process the license tag. * * @param int $errorPos The line number where the error occurs. * * @return void */ protected function processLicense($errorPos) { $license = $this->commentParser->getLicense(); if ($license !== null) { $value = $license->getValue(); $comment = $license->getComment(); if ($value === '' || $comment === '') { $error = '@license tag must contain a URL and a license name'; $this->currentFile->addError($error, $errorPos, 'EmptyLicense'); } } }
/** * Process the license tag. * * @param int $errorPos The line number where the error occurs. * * @return void */ protected function processLicense($errorPos) { /** @var PHP_CodeSniffer_CommentParser_PairElement $license */ $license = $this->commentParser->getLicense(); if (!is_null($license)) { $value = $license->getValue(); $comment = $license->getComment(); if ($value === '' || $comment === '') { $error = '@license tag must contain a URL and a license name'; $this->currentFile->addError($error, $errorPos, 'EmptyLicense'); } } }