PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer::fixAnnotations PHP Метод

fixAnnotations() приватный Метод

Make sure the annotations are correctly separated.
private fixAnnotations ( PhpCsFixer\DocBlock\DocBlock $doc ) : string
$doc PhpCsFixer\DocBlock\DocBlock
Результат string
    private function fixAnnotations(DocBlock $doc)
    {
        foreach ($doc->getAnnotations() as $index => $annotation) {
            $next = $doc->getAnnotation($index + 1);
            if (null === $next) {
                break;
            }
            if (true === $next->getTag()->valid()) {
                if (TagComparator::shouldBeTogether($annotation->getTag(), $next->getTag())) {
                    $this->ensureAreTogether($doc, $annotation, $next);
                } else {
                    $this->ensureAreSeparate($doc, $annotation, $next);
                }
            }
        }
        return $doc->getContent();
    }