Repository: symfony/symfony
File: src/Symfony/Component/Config/Resource/ReflectionClassResource.php (PHP)

Code before:
        $attributes = [];
        foreach ($class->getAttributes() as $a) {
            $attributes[] = [$a->getName(), (string) $a];
        }
        yield print_r($attributes, true);
        $attributes = [];

        yield $class->getDocComment() ?: '';
        yield (int) $class->isFinal();
        yield (int) $class->isAbstract();

        if ($class->isTrait()) {
            yield print_r(class_uses($class->name), true);
        } else {
            yield print_r(class_parents($class->name), true);
            yield print_r(class_implements($class->name), true);
            yield print_r($class->getConstants(), true);
        }

        $enum = null;
        if ($class->isEnum()) {
            $enum = new \ReflectionEnum($class->name);
        }

        foreach ($class->getReflectionConstants() as $constant) {
            foreach ($constant->getAttributes() as $a) {
                $attributes[] = [$a->getName(), (string) $a];
            }
            yield print_r($attributes, true);
            $attributes = [];
            yield $constant->getName();
            if ($enum && $constant->isEnumCase() && $case = $enum->getCase($constant->name)) {
                if ($case instanceof \ReflectionEnumBackedCase) {
                    yield $case->getBackingValue();
                }
            }
        }

        if (!$class->isInterface()) {
            $defaults = $class->getDefaultProperties();

            foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED) as $p) {
                foreach ($p->getAttributes() as $a) {
                    $attributes[] = [$a->getName(), (string) $a];
                }
                yield print_r($attributes, true);
                $attributes = [];

                yield $p->getDocComment() ?: '';
                yield $p->isDefault() ? '<default>' : '';
                yield $p->isPublic() ? 'public' : 'protected';

Review comment (suggestion):
```suggestion
        foreach ($class->getReflectionConstants() as $constant) {
            foreach ($constant->getAttributes() as $a) {
                $attributes[] = [$a->getName(), (string) $a];
            }
            yield $constant->name.print_r($attributes, true);
            $attributes = [];
        }
```

Code after:
        $attributes = [];
        foreach ($class->getAttributes() as $a) {
            $attributes[] = [$a->getName(), (string) $a];
        }
        yield print_r($attributes, true);
        $attributes = [];

        yield $class->getDocComment() ?: '';
        yield (int) $class->isFinal();
        yield (int) $class->isAbstract();

        if ($class->isTrait()) {
            yield print_r(class_uses($class->name), true);
        } else {
            yield print_r(class_parents($class->name), true);
            yield print_r(class_implements($class->name), true);
            yield print_r($class->getConstants(), true);
        }

        foreach ($class->getReflectionConstants() as $constant) {
            foreach ($constant->getAttributes() as $a) {
                $attributes[] = [$a->getName(), (string) $a];
            }
            yield $constant->name.print_r($attributes, true);
            $attributes = [];
        }

        if (!$class->isInterface()) {
            $defaults = $class->getDefaultProperties();

            foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED) as $p) {
                foreach ($p->getAttributes() as $a) {
                    $attributes[] = [$a->getName(), (string) $a];
                }
                yield print_r($attributes, true);
                $attributes = [];

                yield $p->getDocComment() ?: '';
                yield $p->isDefault() ? '<default>' : '';
                yield $p->isPublic() ? 'public' : 'protected';
                yield $p->isStatic() ? 'static' : '';
                yield '$'.$p->name;
                yield print_r(isset($defaults[$p->name]) && !\is_object($defaults[$p->name]) ? $defaults[$p->name] : null, true);
            }
        }

        foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) {
            foreach ($m->getAttributes() as $a) {
                $attributes[] = [$a->getName(), (string) $a];
            }
            yield print_r($attributes, true);