Skip to content

[tagged_iterator yaml tag with AutoconfigureTag] Bug #59532

@GrinWay

Description

@GrinWay

Short bug description

When it comes to the AutoconfigureTag attribute !tagged_iterator doesn't process priority attribute properly, to sort the collection of services (first with the highest priority)

Prerequisite (preparation for the bug)

If we describe something like that in services.yaml

services:
    Namespace\:
        resource: 'PATH'
        tags:
        - name: 'TAG_NAME'

And also we have class of that Namespace from that PATH (additionally with an Attribute)

<?php

namespace Namespace;

use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;

#[AutoconfigureTag('TAG_NAME', ['priority' => 1])]
class SomeClass {}

Bug

When I dump the service with php bin/console debug:container Namespace\SomeClass it show the correct priority attribute 1

But If I use !tagged_iterator yaml tag to collect all services with this TAG_NAME I get an incorrect collection
where !tagged_iterator doesn't read the priority from the AutoconfigureTag attribute

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions