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

Commitaadb453

Browse files
Replace the fluent PHP config format by the array-shape one
1 parent2ef4d4d commitaadb453

File tree

117 files changed

+7513
-5749
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+7513
-5749
lines changed

‎bundles/configuration.rst‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ as integration of other related components:
2323
..code-block::php
2424
2525
// config/packages/framework.php
26-
use Symfony\Config\FrameworkConfig;
26+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
2727
28-
return static function (FrameworkConfig $framework): void {
29-
$framework->form()->enabled(true);
30-
};
28+
return App::config([
29+
'framework' => [
30+
'form' => true,
31+
],
32+
]);
3133
3234
There are two different ways of creating friendly configuration for a bundle:
3335

@@ -148,13 +150,16 @@ can add some configuration that looks like this:
148150
..code-block::php
149151
150152
// config/packages/acme_social.php
151-
use Symfony\Config\AcmeSocialConfig;
152-
153-
return static function (AcmeSocialConfig $acmeSocial): void {
154-
$acmeSocial->twitter()
155-
->clientId(123)
156-
->clientSecret('your_secret');
157-
};
153+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
154+
155+
return App::config([
156+
'acme_social' => [
157+
'twitter' => [
158+
'client_id' => 123,
159+
'client_secret' => 'your_secret',
160+
],
161+
],
162+
]);
158163
159164
The basic idea is that instead of having the user override individual
160165
parameters, you let the user configure just a few, specifically created,

‎bundles/prepend_extension.rst‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,30 +100,26 @@ registered and the ``entity_manager_name`` setting for ``acme_hello`` is set to
100100
101101
# config/packages/acme_something.yaml
102102
acme_something:
103-
# ...
104103
use_acme_goodbye:false
105104
entity_manager_name:non_default
106105
107106
acme_other:
108-
# ...
109107
use_acme_goodbye:false
110108
111109
..code-block::php
112110
113111
// config/packages/acme_something.php
114112
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
115113
116-
return static function (ContainerConfigurator $container): void {
117-
$container->extension('acme_something', [
118-
// ...
114+
return App::config([
115+
'acme_something' => [
119116
'use_acme_goodbye' => false,
120117
'entity_manager_name' => 'non_default',
121-
]);
122-
$container->extension('acme_other', [
123-
// ...
118+
],
119+
'acme_other' => [
124120
'use_acme_goodbye' => false,
125-
]);
126-
};
121+
],
122+
]);
127123
128124
Prepending Extension in the Bundle Class
129125
----------------------------------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp