Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[3.4] Completion for PHP-based configuration for services #1041

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

Open
Haehnchen opened this issue Oct 9, 2017 · 1 comment
Open

[3.4] Completion for PHP-based configuration for services #1041

Haehnchen opened this issue Oct 9, 2017 · 1 comment

Comments

@Haehnchen
Copy link
Owner

Haehnchen commented Oct 9, 2017

// app/config/services.php
return function (ContainerConfigurator $container) {
    $container->import('legacy_services.php');

    $params = $container->parameters();
    $params->set('app.foo_param', 'param_value');

    $container = $container->services()->defaults()
        ->private()
        ->autoconfigure()
        ->autowire();

    $container
        ->load('App\\', '../src/*')
        ->exclude('../src/{Entity,Repository,Tests}');
    $container
        ->load('App\\Controller\\', '../src/Controller')
        ->tag('controller.service_arguments');

    $container->set(FooClass::class)
        ->args(['some_argument', ref(BarClass::class)])
        ->tag('kernel.event_listener', ['event' => 'kernel.exception']);

    $container->alias('foo', FooClass::class)->public();
};

https://symfony.com/blog/new-in-symfony-3-4-php-based-configuration-for-services-and-routes

symfony/symfony#23834

@crozet-magenta
Copy link

crozet-magenta commented Apr 15, 2025

Not sure my issue is related to this, in my app I use php config for service and parameters and autowire attributes to inject services or params. i don't have the autocompletion or quick navigation to go from the attribute to the definition of the param/service. Is this support planned ?

Below is an example of unrecognized service although it is defined into services.php

Image
Image

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

2 participants