Skip to content

Commit f5792a7

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: Update configuration.rst
2 parents e620cba + b72cfde commit f5792a7

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

configuration.rst

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -869,18 +869,15 @@ whenever a service/controller defines a ``$projectDir`` argument, use this:
869869
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
870870
871871
use App\Controller\LuckyController;
872-
use Psr\Log\LoggerInterface;
873-
use Symfony\Component\DependencyInjection\Reference;
874872
875873
return static function (ContainerConfigurator $container) {
876874
$container->services()
877-
->set(LuckyController::class)
878-
->public()
879-
->args([
880-
// pass this value to any $projectDir argument for any service
881-
// that's created in this file (including controller arguments)
882-
'$projectDir' => '%kernel.project_dir%',
883-
]);
875+
->defaults()
876+
// pass this value to any $projectDir argument for any service
877+
// that's created in this file (including controller arguments)
878+
->bind('$projectDir', '%kernel.project_dir%');
879+
880+
// ...
884881
};
885882
886883
.. seealso::

0 commit comments

Comments
 (0)