Skip to content

Commit 7009139

Browse files
committed
Merge branch '2.0' into 2.1
Conflicts: reference/configuration/assetic.rst
2 parents 35c0255 + b372961 commit 7009139

File tree

19 files changed

+106
-62
lines changed

19 files changed

+106
-62
lines changed

book/doctrine.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ information. By convention, this information is usually configured in an
6969
# app/config/config.yml
7070
doctrine:
7171
dbal:
72-
driver: %database_driver%
73-
host: %database_host%
74-
dbname: %database_name%
75-
user: %database_user%
76-
password: %database_password%
72+
driver: "%database_driver%"
73+
host: "%database_host%"
74+
dbname: "%database_name%"
75+
user: "%database_user%"
76+
password: "%database_password%"
7777
7878
By separating the database information into a separate file, you can
7979
easily keep different versions of the file on each server. You can also

book/propel.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ information. By convention, this information is usually configured in an
5252
5353
propel:
5454
dbal:
55-
driver: %database_driver%
56-
user: %database_user%
57-
password: %database_password%
58-
dsn: %database_driver%:host=%database_host%;dbname=%database_name%;charset=%database_charset%
55+
driver: "%database_driver%"
56+
user: "%database_user%"
57+
password: "%database_password%"
58+
dsn: "%database_driver%:host=%database_host%;dbname=%database_name%;charset=%database_charset%"
5959
6060
Now that Propel knows about your database, Symfony2 can create the database for
6161
you:

book/service_container.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ straightforward. Parameters make defining services more organized and flexible:
186186
187187
services:
188188
my_mailer:
189-
class: %my_mailer.class%
189+
class: "%my_mailer.class%"
190190
arguments: [%my_mailer.transport%]
191191
192192
.. code-block:: xml
@@ -358,7 +358,7 @@ directories don't exist, create them.
358358
359359
services:
360360
my_mailer:
361-
class: %my_mailer.class%
361+
class: "%my_mailer.class%"
362362
arguments: [%my_mailer.transport%]
363363
364364
.. code-block:: xml
@@ -592,7 +592,7 @@ the service container gives us a much more appealing option:
592592
my_mailer:
593593
# ...
594594
newsletter_manager:
595-
class: %newsletter_manager.class%
595+
class: "%newsletter_manager.class%"
596596
arguments: [@my_mailer]
597597
598598
.. code-block:: xml
@@ -679,7 +679,7 @@ Injecting the dependency by the setter method just needs a change of syntax:
679679
my_mailer:
680680
# ...
681681
newsletter_manager:
682-
class: %newsletter_manager.class%
682+
class: "%newsletter_manager.class%"
683683
calls:
684684
- [ setMailer, [ @my_mailer ] ]
685685
@@ -744,7 +744,7 @@ it exists and do nothing if it doesn't:
744744
745745
services:
746746
newsletter_manager:
747-
class: %newsletter_manager.class%
747+
class: "%newsletter_manager.class%"
748748
arguments: [@?my_mailer]
749749
750750
.. code-block:: xml
@@ -843,7 +843,7 @@ Configuring the service container is easy:
843843
844844
services:
845845
newsletter_manager:
846-
class: %newsletter_manager.class%
846+
class: "%newsletter_manager.class%"
847847
arguments: [@mailer, @templating]
848848
849849
.. code-block:: xml

components/config/caching.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ the cache can tell if it is still fresh or that its contents should be regenerat
3737
$resources = array();
3838

3939
foreach ($yamlUserFiles as $yamlUserFile) {
40-
// see the previous article "Loading resources" to see where $delegatingLoader comes from
40+
// see the previous article "Loading resources" to
41+
// see where $delegatingLoader comes from
4142
$delegatingLoader->load($yamlUserFile);
4243
$resources[] = new FileResource($yamlUserFile);
4344
}

components/config/definition.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,5 +453,8 @@ Otherwise the result is a clean array of configuration values::
453453

454454
$processor = new Processor();
455455
$configuration = new DatabaseConfiguration;
456-
$processedConfiguration = $processor->processConfiguration($configuration, $configs);
456+
$processedConfiguration = $processor->processConfiguration(
457+
$configuration,
458+
$configs)
459+
;
457460

components/config/resources.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ class, which allows for recursively importing other resources::
5050

5151
public function supports($resource, $type = null)
5252
{
53-
return is_string($resource) && 'yml' === pathinfo($resource, PATHINFO_EXTENSION);
53+
return is_string($resource) && 'yml' === pathinfo(
54+
$resource,
55+
PATHINFO_EXTENSION
56+
);
5457
}
5558
}
5659

components/console/introduction.rst

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,17 @@ and add the following to it::
4242
$this
4343
->setName('demo:greet')
4444
->setDescription('Greet someone')
45-
->addArgument('name', InputArgument::OPTIONAL, 'Who do you want to greet?')
46-
->addOption('yell', null, InputOption::VALUE_NONE, 'If set, the task will yell in uppercase letters')
45+
->addArgument(
46+
'name',
47+
InputArgument::OPTIONAL,
48+
'Who do you want to greet?'
49+
)
50+
->addOption(
51+
'yell',
52+
null,
53+
InputOption::VALUE_NONE,
54+
'If set, the task will yell in uppercase letters'
55+
)
4756
;
4857
}
4958

@@ -69,7 +78,7 @@ an ``Application`` and adds commands to it::
6978

7079
#!/usr/bin/env php
7180
# app/console
72-
<?php
81+
<?php
7382

7483
use Acme\DemoBundle\Command\GreetCommand;
7584
use Symfony\Component\Console\Application;
@@ -141,8 +150,16 @@ and make the ``name`` argument required::
141150

142151
$this
143152
// ...
144-
->addArgument('name', InputArgument::REQUIRED, 'Who do you want to greet?')
145-
->addArgument('last_name', InputArgument::OPTIONAL, 'Your last name?');
153+
->addArgument(
154+
'name',
155+
InputArgument::REQUIRED,
156+
'Who do you want to greet?'
157+
)
158+
->addArgument(
159+
'last_name',
160+
InputArgument::OPTIONAL,
161+
'Your last name?'
162+
);
146163

147164
You now have access to a ``last_name`` argument in your command::
148165

@@ -178,7 +195,13 @@ how many times in a row the message should be printed::
178195

179196
$this
180197
// ...
181-
->addOption('iterations', null, InputOption::VALUE_REQUIRED, 'How many times should the message be printed?', 1);
198+
->addOption(
199+
'iterations',
200+
null,
201+
InputOption::VALUE_REQUIRED,
202+
'How many times should the message be printed?',
203+
1
204+
);
182205

183206
Next, use this in the command to print the message multiple times:
184207

@@ -225,7 +248,13 @@ You can combine VALUE_IS_ARRAY with VALUE_REQUIRED or VALUE_OPTIONAL like this:
225248
226249
$this
227250
// ...
228-
->addOption('iterations', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'How many times should the message be printed?', 1);
251+
->addOption(
252+
'iterations',
253+
null,
254+
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
255+
'How many times should the message be printed?',
256+
1
257+
);
229258
230259
Asking the User for Information
231260
-------------------------------
@@ -236,7 +265,11 @@ to confirm an action before actually executing it. Add the following to your
236265
command::
237266

238267
$dialog = $this->getHelperSet()->get('dialog');
239-
if (!$dialog->askConfirmation($output, '<question>Continue with this action?</question>', false)) {
268+
if (!$dialog->askConfirmation(
269+
$output,
270+
'<question>Continue with this action?</question>',
271+
false
272+
)) {
240273
return;
241274
}
242275

@@ -249,7 +282,11 @@ You can also ask questions with more than a simple yes/no answer. For example,
249282
if you needed to know the name of something, you might do the following::
250283

251284
$dialog = $this->getHelperSet()->get('dialog');
252-
$name = $dialog->ask($output, 'Please enter the name of the widget', 'foo');
285+
$name = $dialog->ask(
286+
$output,
287+
'Please enter the name of the widget',
288+
'foo'
289+
);
253290

254291
Testing Commands
255292
----------------
@@ -285,7 +322,7 @@ method returns what would have been displayed during a normal call from the
285322
console.
286323

287324
You can test sending arguments and options to the command by passing them
288-
as an array to the :method:`Symfony\\Component\\Console\\Tester\\CommandTester::getDisplay`
325+
as an array to the :method:`Symfony\\Component\\Console\\Tester\\CommandTester::execute`
289326
method::
290327

291328
use Symfony\Component\Console\Application;

components/dependency_injection/advanced.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ the service itself gets loaded. To do so, you can use the ``file`` directive.
107107
services:
108108
foo:
109109
class: Example\Foo\Bar
110-
file: %kernel.root_dir%/src/path/to/file/foo.php
110+
file: "%kernel.root_dir%/src/path/to/file/foo.php"
111111
112112
.. code-block:: xml
113113

components/dependency_injection/factories.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class:
4141
newsletter_factory.class: NewsletterFactory
4242
services:
4343
newsletter_manager:
44-
class: %newsletter_manager.class%
45-
factory_class: %newsletter_factory.class%
44+
class: "%newsletter_manager.class%"
45+
factory_class: "%newsletter_factory.class%"
4646
factory_method: get
4747
4848
.. code-block:: xml
@@ -92,9 +92,9 @@ factory itself as a service:
9292
newsletter_factory.class: NewsletterFactory
9393
services:
9494
newsletter_factory:
95-
class: %newsletter_factory.class%
95+
class: "%newsletter_factory.class%"
9696
newsletter_manager:
97-
class: %newsletter_manager.class%
97+
class: "%newsletter_manager.class%"
9898
factory_service: newsletter_factory
9999
factory_method: get
100100
@@ -156,9 +156,9 @@ in the previous example takes the ``templating`` service as an argument:
156156
newsletter_factory.class: NewsletterFactory
157157
services:
158158
newsletter_factory:
159-
class: %newsletter_factory.class%
159+
class: "%newsletter_factory.class%"
160160
newsletter_manager:
161-
class: %newsletter_manager.class%
161+
class: "%newsletter_manager.class%"
162162
factory_service: newsletter_factory
163163
factory_method: get
164164
arguments:
@@ -201,4 +201,4 @@ in the previous example takes the ``templating`` service as an argument:
201201
'newsletter_factory'
202202
)->setFactoryMethod(
203203
'get'
204-
);
204+
);

components/dependency_injection/parentservices.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ The service config for these classes would look something like this:
6262
my_email_formatter:
6363
# ...
6464
newsletter_manager:
65-
class: %newsletter_manager.class%
65+
class: "%newsletter_manager.class%"
6666
calls:
6767
- [ setMailer, [ @my_mailer ] ]
6868
- [ setEmailFormatter, [ @my_email_formatter] ]
6969
7070
greeting_card_manager:
71-
class: %greeting_card_manager.class%
71+
class: "%greeting_card_manager.class%"
7272
calls:
7373
- [ setMailer, [ @my_mailer ] ]
7474
- [ setEmailFormatter, [ @my_email_formatter] ]
@@ -191,18 +191,18 @@ a parent for a service.
191191
my_email_formatter:
192192
# ...
193193
mail_manager:
194-
class: %mail_manager.class%
194+
class: "%mail_manager.class%"
195195
abstract: true
196196
calls:
197197
- [ setMailer, [ @my_mailer ] ]
198198
- [ setEmailFormatter, [ @my_email_formatter] ]
199199
200200
newsletter_manager:
201-
class: %newsletter_manager.class%
201+
class: "%newsletter_manager.class%"
202202
parent: mail_manager
203203
204204
greeting_card_manager:
205-
class: %greeting_card_manager.class%
205+
class: "%greeting_card_manager.class%"
206206
parent: mail_manager
207207
208208
.. code-block:: xml
@@ -317,20 +317,20 @@ to the ``NewsletterManager`` class, the config would look like this:
317317
my_email_formatter:
318318
# ...
319319
mail_manager:
320-
class: %mail_manager.class%
320+
class: "%mail_manager.class%"
321321
abstract: true
322322
calls:
323323
- [ setMailer, [ @my_mailer ] ]
324324
- [ setEmailFormatter, [ @my_email_formatter] ]
325325
326326
newsletter_manager:
327-
class: %newsletter_manager.class%
327+
class: "%newsletter_manager.class%"
328328
parent: mail_manager
329329
calls:
330330
- [ setMailer, [ @my_alternative_mailer ] ]
331331
332332
greeting_card_manager:
333-
class: %greeting_card_manager.class%
333+
class: "%greeting_card_manager.class%"
334334
parent: mail_manager
335335
336336
.. code-block:: xml
@@ -449,13 +449,13 @@ If you had the following config:
449449
another_filter:
450450
# ...
451451
mail_manager:
452-
class: %mail_manager.class%
452+
class: "%mail_manager.class%"
453453
abstract: true
454454
calls:
455455
- [ setFilter, [ @my_filter ] ]
456456
457457
newsletter_manager:
458-
class: %newsletter_manager.class%
458+
class: "%newsletter_manager.class%"
459459
parent: mail_manager
460460
calls:
461461
- [ setFilter, [ @another_filter ] ]

components/dependency_injection/tags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Then, define the chain as a service:
4444
4545
services:
4646
acme_mailer.transport_chain:
47-
class: %acme_mailer.transport_chain.class%
47+
class: "%acme_mailer.transport_chain.class%"
4848
4949
.. code-block:: xml
5050

cookbook/configuration/external_parameters.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ You can now reference these parameters wherever you need them.
6666
dbal:
6767
driver pdo_mysql
6868
dbname: symfony2_project
69-
user: %database.user%
70-
password: %database.password%
69+
user: "%database.user%"
70+
password: "%database.password%"
7171
7272
.. code-block:: xml
7373

cookbook/configuration/override_dir_structure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ may need to modify the paths inside these files::
108108
# ...
109109
assetic:
110110
# ...
111-
read_from: %kernel.root_dir%/../../public_html
111+
read_from: "%kernel.root_dir%/../../public_html"
112112
113113
Now you just need to dump the assets again and your application should
114114
work:

cookbook/security/custom_provider.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Now we make the user provider available as a service.
170170
171171
services:
172172
webservice_user_provider:
173-
class: %webservice_user_provider.class%
173+
class: "%webservice_user_provider.class%"
174174
175175
.. code-block:: xml
176176

0 commit comments

Comments
 (0)