Skip to content
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

Missing argument and/or missing service in several cases ... #616

Open
akomm opened this issue Nov 9, 2015 · 3 comments
Open

Missing argument and/or missing service in several cases ... #616

akomm opened this issue Nov 9, 2015 · 3 comments

Comments

@akomm
Copy link

akomm commented Nov 9, 2015

When you define a service in your configuration, which is created by a factory, the plugin seem to check against arguments of the class-constructor and not the factory-method, which is used. This cause false warnings and proposals. This also happens, when extending services (parent-property).

I have this issue in a yaml-configuration file. I did not test it in other configuration formats.

Oh my gosh, just found another case, here an example of the configuration part, in which I get a "missing service":

      calls:
         -  method: "initFilters"
            arguments:
               -
                  - "@resource.product.search_filter"
                  - "@resource.product.date_filter"
@akomm akomm changed the title Missing argument and/or missing service when using Factories in service definitions Missing argument and/or missing service when using factories or "parent" in service definitions Nov 9, 2015
@akomm akomm changed the title Missing argument and/or missing service when using factories or "parent" in service definitions Missing argument and/or missing service in several cases ... Nov 9, 2015
Haehnchen added a commit that referenced this issue Nov 9, 2015
@Haehnchen
Copy link
Owner

not supporting factory and other fancy stuff right now. i will try to blacklist your cases until iam working on a proper solution

@JParkinson1991
Copy link

Can confirm this is still an issue

PHPStorm: 2020.3
Plugin: 0.22.206
symfony/dependency-injection: 3.4.18

@isleshocky77
Copy link

isleshocky77 commented Aug 11, 2021

Still present

PHPStorm: 2021.2
Plugin: 0.23.210

NOTE For the factory instance of this issue; it's now

# config/services.yaml 
services:
    # ...
     App\Email\NewsletterManager:
         factory:   ['@App\Email\NewsletterManagerFactory', createNewsletterManager]
         arguments: ['@templating']

instead of having factory_class and factory_method which were deprecated. I think this may effect the blacklisting of the rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants