protected function applyFix(\SplFileInfo $file, Tokens $tokens)
    {
        $searchFor = array_keys($this->configuration['replacements']);

        foreach ($tokens as $index => $token) {
            if (!$token->isGivenKind(T_DOC_COMMENT)) {
                continue;
            }

            $doc = new DocBlock($token->getContent());
            $annotations = $doc->getAnnotationsOfType($searchFor);

            if (empty($annotations)) {
                continue;
            }

            foreach ($annotations as $annotation) {
                $annotation->getTag()->setName($this->configuration['replacements'][$annotation->getTag()->getName()]);
            }

            $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]);
        }
    }
protected function applyFix(\SplFileInfo $file, Tokens $tokens)
    {
        $searchFor = array_keys($this->configuration['replacements']);

        foreach ($tokens as $index => $token) {
            if (!$token->isGivenKind(T_DOC_COMMENT)) {
                continue;
            }

            $doc = new DocBlock($token->getContent());
            $annotations = $doc->getAnnotationsOfType($searchFor);

            if (empty($annotations)) {
                continue;
            }

            foreach ($annotations as $annotation) {
                $annotation->getTag()->setName($this->configuration['replacements'][$annotation->getTag()->getName()]);
            }

            $tokens[$index] = new Token([T_DOC_COMMENT, $doc->getContent()]);
        }
    }
protected function applyFix ( \ SplFileInfo $ file , Tokens $ tokens ) { $ searchFor = array_keys ( $ this -> configuration [ 'replacements' ] ) ; foreach ( $ tokens as $ index => $ token ) { if ( ! $ token -> isGivenKind ( T_DOC_COMMENT ) ) { continue ; } $ doc = new DocBlock ( $ token -> getContent ( ) ) ; $ annotations = $ doc -> getAnnotationsOfType ( $ searchFor ) ; if ( empty ( $ annotations ) ) { continue ; } foreach ( $ annotations as $ annotation ) { $ annotation -> getTag ( ) -> setName ( $ this -> configuration [ 'replacements' ] [ $ annotation -> getTag ( ) -> getName ( ) ] ) ; } $ tokens [ $ index ] = new Token ( [ T_DOC_COMMENT , $ doc -> getContent ( ) ] ) ; } }
{@inheritdoc}
{