Skip to content

[Console] strlen(): Argument #1 ($string) must be of type string, array given  #51636

@issamkhadiri1989

Description

@issamkhadiri1989

Symfony version(s) affected

6.3.4

Description

Hello,

When using a tag with some additional attribute of type array, I got error

[TypeError]
strlen(): Argument #1 ($string) must be of type string, array given

How to reproduce

With the config bellow

  App\Mail\SmtpTransport:
    arguments: ['%kernel.project_dir%']
    tags:
      - { name: 'app.mail_transport', alias: 'smtp'}

  App\Mail\SendmailTransport:
    tags:
      - { name: 'app.mail_transport', alias: ['sendmail', 'mail'] }

Try to debug the tag using the php bin/console debug:container --tag=app.mail_transport

Possible Solution

In the file https://github.com/symfony/framework-bundle/blob/6.3/Console/Descriptor/TextDescriptor.php#L212

first need to check whether the $value is a type of array.

Additional Context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy