8000 lint:container callable method parameters · Issue #36607 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

lint:container callable method parameters #36607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Nemo64 opened this issue Apr 28, 2020 · 4 comments
Closed

lint:container callable method parameters #36607

Nemo64 opened this issue Apr 28, 2020 · 4 comments

Comments

@Nemo64
Copy link
Contributor
Nemo64 commented Apr 28, 2020

Symfony version(s) affected: 4.4.7

Description
I tried to configure Guzzle with middlewares completly in yaml.
I tried to push a middleware into a handler stack. The method requires a parameter with the type callable and gets a Closure. It works fine but when i run lint:container, I get: argument 1 of "GuzzleHttp\HandlerStack::push" accepts "callable", "Closure" passed.

It still works, but the linter complains.

How to reproduce

    aws.http_client_handler_stack:
        class: GuzzleHttp\HandlerStack
        factory: [GuzzleHttp\HandlerStack, create]
        calls:
            - [push, ['@aws.http_logger']]
    aws.http_logger:
        class: Closure
        factory: [GuzzleHttp\Middleware, log]
        arguments:
            - '@logger'
            - '@aws.log_formatter'
        tags:
            - {name: monolog.logger, channel: aws}
    aws.log_formatter:
        class: GuzzleHttp\MessageFormatter
        arguments:
            - '{method} {uri} HTTP/{version} {code}'

Possible Solution
The linter should check types similar to the option resolver probably needs to know of the callable type.

@mpdude
Copy link
Contributor
mpdude commented May 27, 2020

Try to write class: callable instead of class: Closure for aws.http_logger.

@Nemo64
Copy link
Contributor Author
Nemo64 commented May 27, 2020

It's already some time ago but If I remember correctly I get a "callable" class not found then which results in the container not compiling.

@carsonbot
Copy link

Hey, thanks for your report!
There has not been a lot of activity here for a while. Is this bug still relevant? Have you managed to find a workaround?

@stof stof removed the Stalled label Feb 18, 2021
@xabbuh
Copy link
Member
xabbuh commented Feb 26, 2021

same as #35066 and thus fixed by #35067 it seems

@xabbuh xabbuh closed this as completed Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
0