Skip to content

Commit 714f630

Browse files
committed
Merge branch '2.7'
* 2.7: (28 commits) Fixing typo thanks to xabbuh Add missing comma in array Removed unneeded spaces Updated as per discussion Updated according to comment and changed to AppBundle Added configuration of the your_api_key_user_provider as user provider fixed typo (acme -> app) Fix code examples Fix typo: missing of Fix typo: missing space Fix typo: Fabien => World Adding reference link Quick proofread of the email cookbook Small grammar-ish fix Remove horizontal scrollbar Fix typos Fix typo, remove horizontal scrollbar Set twig service as private added Kévin as a merger for the Serializer component Fix typo: looks => look ...
2 parents 99e2996 + 39f6876 commit 714f630

File tree

20 files changed

+209
-109
lines changed

20 files changed

+209
-109
lines changed

best_practices/business-logic.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,12 @@ the class namespace as a parameter:
140140
# app/config/services.yml
141141
142142
# service definition with class namespace as parameter
143+
parameters:
144+
slugger.class: AppBundle\Utils\Slugger
145+
143146
services:
144147
app.slugger:
145-
class: AppBundle\Utils\Slugger
148+
class: "%slugger.class%"
146149
147150
This practice is cumbersome and completely unnecessary for your own services:
148151

best_practices/configuration.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ and security credentials) and different environments (development, production).
66
That's why Symfony recommends that you split the application configuration into
77
three parts.
88

9+
.. _config-parameters.yml:
10+
911
Infrastructure-Related Configuration
1012
------------------------------------
1113

components/class_loader/class_map_generator.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Generating a Class Map
4545
----------------------
4646

4747
To generate the class map, simply pass the root directory of your class files
48-
to the :method:`Symfony\\Component\\ClassLoader\\ClassMapGenerator::createMap``
48+
to the :method:`Symfony\\Component\\ClassLoader\\ClassMapGenerator::createMap`
4949
method::
5050

5151
use Symfony\Component\ClassLoader\ClassMapGenerator;
@@ -115,7 +115,10 @@ the same as in the example above)::
115115

116116
use Symfony\Component\ClassLoader\ClassMapGenerator;
117117

118-
ClassMapGenerator::dump(array(__DIR__.'/library/bar', __DIR__.'/library/foo'), __DIR__.'/class_map.php');
118+
ClassMapGenerator::dump(
119+
array(__DIR__.'/library/bar', __DIR__.'/library/foo'),
120+
__DIR__.'/class_map.php'
121+
);
119122

120123
.. _`PSR-0`: http://www.php-fig.org/psr/psr-0
121124
.. _`PSR-4`: http://www.php-fig.org/psr/psr-4

components/config/definition.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ By changing a string value into an associative array with ``name`` as the key::
500500
->arrayNode('connection')
501501
->beforeNormalization()
502502
->ifString()
503-
->then(function($v) { return array('name'=> $v); })
503+
->then(function ($v) { return array('name' => $v); })
504504
->end()
505505
->children()
506506
->scalarNode('name')->isRequired()

components/console/changing_default_command.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This will print the following to the command line:
5151

5252
.. code-block:: text
5353
54-
Hello Fabien
54+
Hello World
5555
5656
.. tip::
5757

components/console/helpers/debug_formatter.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ display information that the program is started::
5151

5252
$output->writeln($debugFormatter->start(
5353
spl_object_hash($process),
54-
'Some process description')
55-
);
54+
'Some process description'
55+
));
5656

5757
$process->run();
5858

@@ -68,7 +68,7 @@ You can tweak the prefix using the third argument::
6868
spl_object_hash($process),
6969
'Some process description',
7070
'STARTED'
71-
);
71+
));
7272
// will output:
7373
// STARTED Some process description
7474

components/console/helpers/dialoghelper.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ this set the seventh argument to ``true``::
230230
true // enable multiselect
231231
);
232232

233-
$selectedColors = array_map(function($c) use ($colors) {
233+
$selectedColors = array_map(function ($c) use ($colors) {
234234
return $colors[$c];
235235
}, $selected);
236236

components/console/helpers/questionhelper.rst

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ The second argument to
4141
is the default value to return if the user doesn't enter any input. Any other
4242
input will ask the same question again.
4343

44+
.. tip::
45+
46+
You can customize the regex used to check if the answer means "yes" in the
47+
third argument of the constructor. For instance, to allow anything that
48+
starts with either ``y`` or ``j``, you would set it to::
49+
50+
$question = new ConfirmationQuestion(
51+
'Continue with this action?',
52+
false,
53+
'/^(y|j)/i'
54+
);
55+
56+
The regex defaults to ``/^y/i``.
57+
58+
.. versionadded:: 2.7
59+
The regex argument was introduced in Symfony 2.7. Before, only answers
60+
starting with ``y`` were considered as "yes".
61+
4462
Asking the User for Information
4563
-------------------------------
4664

@@ -90,7 +108,7 @@ option is the default one.
90108
If the user enters an invalid string, an error message is shown and the user
91109
is asked to provide the answer another time, until they enter a valid string
92110
or reach the maximum number of attempts. The default value for the maximum number
93-
of attempts is ``null``, which means infinite number attempts. You can define
111+
of attempts is ``null``, which means infinite number of attempts. You can define
94112
your own error message using
95113
:method:`Symfony\\Component\\Console\\Question\\ChoiceQuestion::setErrorMessage`.
96114

components/console/introduction.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,11 @@ method::
459459

460460
$command = $application->find('demo:greet');
461461
$commandTester = new CommandTester($command);
462-
$commandTester->execute(
463-
array('command' => $command->getName(), 'name' => 'Fabien', '--iterations' => 5)
464-
);
462+
$commandTester->execute(array(
463+
'command' => $command->getName(),
464+
'name' => 'Fabien',
465+
'--iterations' => 5,
466+
));
465467

466468
$this->assertRegExp('/Fabien/', $commandTester->getDisplay());
467469
}

components/expression_language/syntax.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ For example::
259259
$inGroup = $language->evaluate(
260260
'user.group in ["human_resources", "marketing"]',
261261
array(
262-
'user' => $user
262+
'user' => $user,
263263
)
264264
);
265265

0 commit comments

Comments
 (0)