src/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixer.php
private function annotationIsSuperfluous(Annotation $annotation, array $info, array $symbolShortNames)
    {
        if ('param' === $annotation->getTag()->getName()) {
            $regex = '/@param\s+(?:\S|\s(?!\$))+\s\$\S+\s+\S/';
        } else {
            $regex = '/@return\s+\S+\s+\S/';
        }

        if (Preg::match($regex, $annotation->getContent())) {
            return false;
        }

        $annotationTypes = $this->toComparableNames($annotation->getTypes(), $symbolShortNames);

        if (['null'] === $annotationTypes) {
            return false;
        }

        if (['mixed'] === $annotationTypes && null === $info['type']) {
            return !$this->configuration['allow_mixed'];
        }

        $actualTypes = null === $info['type'] ? [] : [$info['type']];
        if ($info['allows_null']) {
            $actualTypes[] = 'null';
        }

        return $annotationTypes === $this->toComparableNames($actualTypes, $symbolShortNames);
    }
private function annotationIsSuperfluous(Annotation $annotation, array $info, array $symbolShortNames)
    {
        if ('param' === $annotation->getTag()->getName()) {
            $regex = '/@param\s+(?:\S|\s(?!\$))+\s\$\S+\s+\S/';
        } else {
            $regex = '/@return\s+\S+\s+\S/';
        }

        if (Preg::match($regex, $annotation->getContent())) {
            return false;
        }

        $annotationTypes = $this->toComparableNames($annotation->getTypes(), $symbolShortNames);

        if (['null'] === $annotationTypes) {
            return false;
        }

        if (['mixed'] === $annotationTypes && null === $info['type']) {
            return !$this->configuration['allow_mixed'];
        }

        $actualTypes = null === $info['type'] ? [] : [$info['type']];
        if ($info['allows_null']) {
            $actualTypes[] = 'null';
        }

        return $annotationTypes === $this->toComparableNames($actualTypes, $symbolShortNames);
    }
private function annotationIsSuperfluous ( Annotation $ annotation , array $ info , array $ symbolShortNames ) { if ( 'param' === $ annotation -> getTag ( ) -> getName ( ) ) { $ regex = '/@param\s+(?:\S|\s(?!\$))+\s\$\S+\s+\S/' ; } else { $ regex = '/@return\s+\S+\s+\S/' ; } if ( Preg :: match ( $ regex , $ annotation -> getContent ( ) ) ) { return false ; } $ annotationTypes = $ this -> toComparableNames ( $ annotation -> getTypes ( ) , $ symbolShortNames ) ; if ( [ 'null' ] === $ annotationTypes ) { return false ; } if ( [ 'mixed' ] === $ annotationTypes && null === $ info [ 'type' ] ) { return ! $ this -> configuration [ 'allow_mixed' ] ; } $ actualTypes = null === $ info [ 'type' ] ? [ ] : [ $ info [ 'type' ] ] ; if ( $ info [ 'allows_null' ] ) { $ actualTypes [ ] = 'null' ; } return $ annotationTypes === $ this -> toComparableNames ( $ actualTypes , $ symbolShortNames ) ; }
@param Annotation            $annotation
@param array                 $info
@param array<string, string> $symbolShortNames

@return bool
@param Annotation $annotation @param array $info @param array<string string > $symbolShortNames