Skip to content

[DIC] !tagged tag list not showing with --show-arguments in debug:container #31340

Closed
@linaori

Description

@linaori

Symfony version(s) affected: 3.4+

Description
When using bin/console debug:container my_service --show-arguments and this service contains an argument as !tagged my_tag, it will not properly show the arguments being passed. The XML will only contain a "tagged" element and doesn't tell you which services will be injected. The command line output will tell you there are 0 elements in the iterator.

How to reproduce

services:
    my_service:
        class: stdClass
        arguments: [!tagged my_tag]

    my_tagged_service_1:
        class: stdClass
        tags: [my_tag]

    my_tagged_service_2:
        class: stdClass
        tags: [my_tag]

To verify the services are actually there:

bin/console debug:container --tag=my_tag

Symfony Container Public Services Tagged with "my_tag" Tag
==========================================================

 --------------------- ------------ 
  Service ID            Class name  
 --------------------- ------------ 
  my_tagged_service_1   stdClass    
  my_tagged_service_2   stdClass    
 --------------------- ------------ 

Missing argument information:

bin/console debug:container my_service --show-arguments 
Information for Service "my_service"
====================================

 ---------------- ------------------------- 
  Option           Value                    
 ---------------- ------------------------- 
  Service ID       my_service               
  Class            stdClass                 
  Tags             -                        
  Public           yes                      
  Synthetic        no                       
  Lazy             no                       
  Shared           yes                      
  Abstract         no                       
  Autowired        yes                      
  Autoconfigured   yes                      
  Arguments        Iterator (0 element(s))  
 ---------------- -------------------------

Possible Solution
I would personally already be satisfied if it properly displayed the actual count, and it would be even better if it could display the list of service_ids it would inject.

Iterator (2 element(s))
# or
Tagged Iterator (2 element(s)) [
    my_tagged_service_1
    my_tagged_service_2
]

This is currently making it a bit troublesome to see if your !tagged works and in a more complex system (autoconfigure), if all the services are picked up correctly.

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