private function processCopyrightTags(File $phpcs_file, $stack_ptr, $comment_start): void
    {
        $tokens = $phpcs_file->getTokens();
        foreach ($tokens[$comment_start]['comment_tags'] as $tag) {
            if ($tokens[$tag]['content'] === $this->copyright_tag) {
                $this->checkForContentInCopyrightTag($phpcs_file, $tag, $tokens[$comment_start]['comment_closer']);

                //Use default PEAR style copyright notation checking.
                $this->processCopyright($phpcs_file, [$tag]);

                return;
            }
        }

        //No @copyright tag because not returned
        $error = 'Missing ' . $this->copyright_tag . ' tag in file doc-block';
        if (false === $phpcs_file->addFixableError($error, $stack_ptr, 'MissingCopyrightTag')) {
            return;
        }

        if ($tokens[$tokens[$comment_start]['comment_closer']]['line'] === $tokens[$comment_start]['line']) {
            $phpcs_file->fixer->replaceToken($tokens[$comment_start]['comment_closer'] - 1, '');
            $phpcs_file->fixer->addContentBefore(
                $tokens[$comment_start]['comment_closer'],
                sprintf("\n * %s %s\n ", $this->copyright_tag, $this->getCopyrightLine())
            );

            return;
        }

        $phpcs_file->fixer->addContentBefore(
            $tokens[$comment_start]['comment_closer'],
            sprintf("* %s %s\n ", $this->copyright_tag, $this->getCopyrightLine())
        );
    }
private function processCopyrightTags(File $phpcs_file, $stack_ptr, $comment_start): void
    {
        $tokens = $phpcs_file->getTokens();
        foreach ($tokens[$comment_start]['comment_tags'] as $tag) {
            if ($tokens[$tag]['content'] === $this->copyright_tag) {
                $this->checkForContentInCopyrightTag($phpcs_file, $tag, $tokens[$comment_start]['comment_closer']);

                //Use default PEAR style copyright notation checking.
                $this->processCopyright($phpcs_file, [$tag]);

                return;
            }
        }

        //No @copyright tag because not returned
        $error = 'Missing ' . $this->copyright_tag . ' tag in file doc-block';
        if (false === $phpcs_file->addFixableError($error, $stack_ptr, 'MissingCopyrightTag')) {
            return;
        }

        if ($tokens[$tokens[$comment_start]['comment_closer']]['line'] === $tokens[$comment_start]['line']) {
            $phpcs_file->fixer->replaceToken($tokens[$comment_start]['comment_closer'] - 1, '');
            $phpcs_file->fixer->addContentBefore(
                $tokens[$comment_start]['comment_closer'],
                sprintf("\n * %s %s\n ", $this->copyright_tag, $this->getCopyrightLine())
            );

            return;
        }

        $phpcs_file->fixer->addContentBefore(
            $tokens[$comment_start]['comment_closer'],
            sprintf("* %s %s\n ", $this->copyright_tag, $this->getCopyrightLine())
        );
    }
private function processCopyrightTags ( File $ phpcs_file , $ stack_ptr , $ comment_start ) : void { $ tokens = $ phpcs_file -> getTokens ( ) ; foreach ( $ tokens [ $ comment_start ] [ 'comment_tags' ] as $ tag ) { if ( $ tokens [ $ tag ] [ 'content' ] === $ this -> copyright_tag ) { $ this -> checkForContentInCopyrightTag ( $ phpcs_file , $ tag , $ tokens [ $ comment_start ] [ 'comment_closer' ] ) ; //Use default PEAR style copyright notation checking. $ this -> processCopyright ( $ phpcs_file , [ $ tag ] ) ; return ; } } //No @copyright tag because not returned $ error = 'Missing ' . $ this -> copyright_tag . ' tag in file doc-block' ; if ( false === $ phpcs_file -> addFixableError ( $ error , $ stack_ptr , 'MissingCopyrightTag' ) ) { return ; } if ( $ tokens [ $ tokens [ $ comment_start ] [ 'comment_closer' ] ] [ 'line' ] === $ tokens [ $ comment_start ] [ 'line' ] ) { $ phpcs_file -> fixer -> replaceToken ( $ tokens [ $ comment_start ] [ 'comment_closer' ] - 1 , '' ) ; $ phpcs_file -> fixer -> addContentBefore ( $ tokens [ $ comment_start ] [ 'comment_closer' ] , sprintf ( "\n * %s %s\n " , $ this -> copyright_tag , $ this -> getCopyrightLine ( ) ) ) ; return ; } $ phpcs_file -> fixer -> addContentBefore ( $ tokens [ $ comment_start ] [ 'comment_closer' ] , sprintf ( "* %s %s\n " , $ this -> copyright_tag , $ this -> getCopyrightLine ( ) ) ) ; }
Processes the file level doc-block tags, this function is executed once the parent class finds a file-level
doc-block.

@param File $phpcs_file The file being scanned.
@param int $stack_ptr The position of the current token in the stack passed in $tokens.
@param int $comment_start Position in the stack where the comment started.

@return void
Processes the file level doc - block tags this function is executed once the parent class finds a file - level doc - block .