Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0626df1

Browse files
committed
minor#14812 [DependencyInjection] [Configuration] Fix PHP configuration sample for setting default parameter bindings (neveldo)
This PR was submitted for the 5.2 branch but it was merged into the 4.4 branch instead.Discussion----------[DependencyInjection] [Configuration] Fix PHP configuration sample for setting default parameter bindingsThis pull request fixes the PHP version of the config for setting default parameter bindings that seems to be irrelevant (whereas the XML and YML versions are ok).Commits-------6987db2 Update configuration.rst
2 parents58ddc5f +6987db2 commit0626df1

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

‎configuration.rst‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -881,18 +881,15 @@ whenever a service/controller defines a ``$projectDir`` argument, use this:
881881
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
882882
883883
use App\Controller\LuckyController;
884-
use Psr\Log\LoggerInterface;
885-
use Symfony\Component\DependencyInjection\Reference;
886884
887885
return static function (ContainerConfigurator $container) {
888-
$container->services()
889-
->set(LuckyController::class)
890-
->public()
891-
->args([
892-
// pass this value to any $projectDir argument for any service
893-
// that's created in this file (including controller arguments)
894-
'$projectDir' => '%kernel.project_dir%',
895-
]);
886+
$services = $container->services()
887+
->defaults()
888+
// pass this value to any $projectDir argument for any service
889+
// that's created in this file (including controller arguments)
890+
->bind('$projectDir', '%kernel.project_dir%');
891+
892+
// ...
896893
};
897894
898895
..seealso::

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp