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

Appearance settings

Commit b0d2263

Browse filesBrowse files
committed
Merge branch '2.5' into 2.6
* 2.5: Remove 'acme' Update introduction.rst [Book][Translation] Added tip for routing params Remove trailing whitespace [BestPractices] fix minor typo Remove horizontal scrollbar [Components][Debug] fix DebugClassLoader namespace Update override.rst Update override.rst Conflicts: cookbook/form/dynamic_form_modification.rst
2 parents 2f41c9e + 62248df commit b0d2263
Copy full SHA for b0d2263
Expand file treeCollapse file tree

29 files changed

+110
-86
lines changed

‎best_practices/security.rst

Copy file name to clipboardExpand all lines: best_practices/security.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ Security Voters
245245

246246
If your security logic is complex and can't be centralized into a method
247247
like ``isAuthor()``, you should leverage custom voters. These are an order
248-
of magnitude easier than :doc:`ACL's </cookbook/security/acl>` and will give
248+
of magnitude easier than :doc:`ACLs </cookbook/security/acl>` and will give
249249
you the flexibility you need in almost all cases.
250250

251251
First, create a voter class. The following example shows a voter that implements

‎book/controller.rst

Copy file name to clipboardExpand all lines: book/controller.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ Symfony will automatically return a 500 HTTP response code.
559559
throw new \Exception('Something went wrong!');
560560
561561
In every case, an error page is shown to the end user and a full debug
562-
error page is shown to the developer (i.e. when you're using ``app_dev.php`` -
562+
error page is shown to the developer (i.e. when you're using ``app_dev.php`` -
563563
see :ref:`page-creation-environments`).
564564

565565
You'll want to customize the error page your user sees. To do that, see the

‎book/from_flat_php_to_symfony2.rst

Copy file name to clipboardExpand all lines: book/from_flat_php_to_symfony2.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ the layout:
244244

245245
<?php include 'layout.php' ?>
246246

247-
You now have a setup that will allow you to reuse the layout.
247+
You now have a setup that will allow you to reuse the layout.
248248
Unfortunately, to accomplish this, you're forced to use a few ugly
249249
PHP functions (``ob_start()``, ``ob_get_clean()``) in the template. Symfony
250250
uses a Templating component that allows this to be accomplished cleanly

‎book/http_cache.rst

Copy file name to clipboardExpand all lines: book/http_cache.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,8 @@ won't be asked to return the updated response until the cache finally becomes
538538
stale.
539539

540540
The validation model addresses this issue. Under this model, the cache continues
541-
to store responses. The difference is that, for each request, the cache asks the
542-
application if the cached response is still valid or if it needs to be regenerated.
541+
to store responses. The difference is that, for each request, the cache asks the
542+
application if the cached response is still valid or if it needs to be regenerated.
543543
If the cache *is* still valid, your application should return a 304 status code
544544
and no content. This tells the cache that it's ok to return the cached response.
545545

‎book/service_container.rst

Copy file name to clipboardExpand all lines: book/service_container.rst
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ the service container gives you a much more appealing option:
569569
services:
570570
my_mailer:
571571
# ...
572-
572+
573573
newsletter_manager:
574574
class: Acme\HelloBundle\Newsletter\NewsletterManager
575575
arguments: ["@my_mailer"]
@@ -762,7 +762,7 @@ Injecting the dependency by the setter method just needs a change of syntax:
762762
services:
763763
my_mailer:
764764
# ...
765-
765+
766766
newsletter_manager:
767767
class: Acme\HelloBundle\Newsletter\NewsletterManager
768768
calls:
@@ -797,7 +797,7 @@ Injecting the dependency by the setter method just needs a change of syntax:
797797
use Symfony\Component\DependencyInjection\Reference;
798798
799799
$container->setDefinition('my_mailer', ...);
800-
800+
801801
$container->setDefinition('newsletter_manager', new Definition(
802802
'Acme\HelloBundle\Newsletter\NewsletterManager'
803803
))->addMethodCall('setMailer', array(
@@ -938,7 +938,7 @@ it exists and do nothing if it doesn't:
938938
<service id="my_mailer">
939939
<!-- ... -->
940940
</service>
941-
941+
942942
<service id="newsletter_manager" class="Acme\HelloBundle\Newsletter\NewsletterManager">
943943
<argument type="service" id="my_mailer" on-invalid="ignore" />
944944
</service>
@@ -953,7 +953,7 @@ it exists and do nothing if it doesn't:
953953
use Symfony\Component\DependencyInjection\ContainerInterface;
954954
955955
$container->setDefinition('my_mailer', ...);
956-
956+
957957
$container->setDefinition('newsletter_manager', new Definition(
958958
'Acme\HelloBundle\Newsletter\NewsletterManager',
959959
array(

‎book/translation.rst

Copy file name to clipboardExpand all lines: book/translation.rst
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ via the ``request`` object::
428428

429429
.. tip::
430430

431-
Read :doc:`/cookbook/session/locale_sticky_session` to learn, how to store
431+
Read :doc:`/cookbook/session/locale_sticky_session` to learn how to store
432432
the user's locale in the session.
433433

434434
.. index::
@@ -508,6 +508,11 @@ as the locale for the current request.
508508
You can now use the locale to create routes to other translated pages
509509
in your application.
510510

511+
.. tip::
512+
513+
Read :doc:`/cookbook/routing/service_container_parameters` to learn how to
514+
avoid hardcoding the ``_locale`` requirement in all your routes.
515+
511516
Setting a default Locale
512517
~~~~~~~~~~~~~~~~~~~~~~~~
513518

‎components/class_loader/cache_class_loader.rst

Copy file name to clipboardExpand all lines: components/class_loader/cache_class_loader.rst
+9-9Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
single: ClassLoader; Cache
55
single: ClassLoader; XcacheClassLoader
66
single: XCache; XcacheClassLoader
7-
7+
88
Cache a Class Loader
99
====================
1010

@@ -30,16 +30,16 @@ ApcClassLoader
3030
``findFile()`` method using `APC`_::
3131

3232
require_once '/path/to/src/Symfony/Component/ClassLoader/ApcClassLoader.php';
33-
33+
3434
// instance of a class that implements a findFile() method, like the ClassLoader
3535
$loader = ...;
36-
36+
3737
// sha1(__FILE__) generates an APC namespace prefix
3838
$cachedLoader = new ApcClassLoader(sha1(__FILE__), $loader);
39-
39+
4040
// register the cached class loader
4141
$cachedLoader->register();
42-
42+
4343
// deactivate the original, non-cached loader if it was registered previously
4444
$loader->unregister();
4545

@@ -50,16 +50,16 @@ XcacheClassLoader
5050
it is straightforward::
5151

5252
require_once '/path/to/src/Symfony/Component/ClassLoader/XcacheClassLoader.php';
53-
53+
5454
// instance of a class that implements a findFile() method, like the ClassLoader
5555
$loader = ...;
56-
56+
5757
// sha1(__FILE__) generates an XCache namespace prefix
5858
$cachedLoader = new XcacheClassLoader(sha1(__FILE__), $loader);
59-
59+
6060
// register the cached class loader
6161
$cachedLoader->register();
62-
62+
6363
// deactivate the original, non-cached loader if it was registered previously
6464
$loader->unregister();
6565

‎components/class_loader/map_class_loader.rst

Copy file name to clipboardExpand all lines: components/class_loader/map_class_loader.rst
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. index::
22
single: ClassLoader; MapClassLoader
3-
3+
44
MapClassLoader
55
==============
66

@@ -26,14 +26,14 @@ Using it is as easy as passing your mapping to its constructor when creating
2626
an instance of the ``MapClassLoader`` class::
2727

2828
require_once '/path/to/src/Symfony/Component/ClassLoader/MapClassLoader';
29-
29+
3030
$mapping = array(
3131
'Foo' => '/path/to/Foo',
3232
'Bar' => '/path/to/Bar',
3333
);
34-
34+
3535
$loader = new MapClassLoader($mapping);
36-
36+
3737
$loader->register();
3838

3939
.. _PSR-0: http://www.php-fig.org/psr/psr-0/

‎components/console/introduction.rst

Copy file name to clipboardExpand all lines: components/console/introduction.rst
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ tools capable of helping you with different tasks:
404404
* :doc:`/components/console/helpers/formatterhelper`: customize the output colorization
405405
* :doc:`/components/console/helpers/progressbar`: shows a progress bar
406406
* :doc:`/components/console/helpers/table`: displays tabular data as a table
407-
* :doc:`/components/console/helpers/questionhelper`: interactively ask the user for information
408407

409408
.. _component-console-testing-commands:
410409

‎components/css_selector.rst

Copy file name to clipboardExpand all lines: components/css_selector.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ web-browser.
7676

7777
* link-state selectors: ``:link``, ``:visited``, ``:target``
7878
* selectors based on user action: ``:hover``, ``:focus``, ``:active``
79-
* UI-state selectors: ``:invalid``, ``:indeterminate`` (however, ``:enabled``,
79+
* UI-state selectors: ``:invalid``, ``:indeterminate`` (however, ``:enabled``,
8080
``:disabled``, ``:checked`` and ``:unchecked`` are available)
8181

8282
Pseudo-elements (``:before``, ``:after``, ``:first-line``,

‎components/debug/class_loader.rst

Copy file name to clipboardExpand all lines: components/debug/class_loader.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ with a ``DebugClassLoader`` wrapper.
1313
Using the ``DebugClassLoader`` is as easy as calling its static
1414
:method:`Symfony\\Component\\Debug\\DebugClassLoader::enable` method::
1515

16-
use Symfony\Component\ClassLoader\DebugClassLoader;
16+
use Symfony\Component\Debug\DebugClassLoader;
1717

1818
DebugClassLoader::enable();

‎components/dependency_injection/advanced.rst

Copy file name to clipboardExpand all lines: components/dependency_injection/advanced.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ using the ``get()`` method::
1717

1818
In some cases, a service *only* exists to be injected into another service
1919
and is *not* intended to be fetched directly from the container as shown
20-
above.
20+
above.
2121

2222
.. _inlined-private-services:
2323

‎components/security/authentication.rst

Copy file name to clipboardExpand all lines: components/security/authentication.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ in) is correct, you can use::
263263

264264
// fetch the Acme\Entity\LegacyUser
265265
$user = ...;
266-
266+
267267
// the submitted password, e.g. from the login form
268268
$plainPassword = ...;
269269

‎components/templating/helpers/assetshelper.rst

Copy file name to clipboardExpand all lines: components/templating/helpers/assetshelper.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Asset path generation is handled internally by packages. The component provides
105105
You can also use multiple packages::
106106

107107
use Symfony\Component\Templating\Asset\PathPackage;
108-
108+
109109
// ...
110110
$templateEngine->set(new AssetsHelper());
111111

‎components/templating/introduction.rst

Copy file name to clipboardExpand all lines: components/templating/introduction.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ escaper using the
135135
Helpers
136136
-------
137137

138-
The Templating component can be easily extended via helpers. Helpers are PHP objects that
138+
The Templating component can be easily extended via helpers. Helpers are PHP objects that
139139
provide features useful in a template context. The component has
140140
2 built-in helpers:
141141

‎contributing/code/standards.rst

Copy file name to clipboardExpand all lines: contributing/code/standards.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ example containing most features described below:
7979

8080
throw new \RuntimeException(sprintf('Unrecognized dummy option "%s"', $dummy));
8181
}
82-
82+
8383
private function reverseBoolean($value = null, $theSwitch = false)
8484
{
8585
if (!$theSwitch) {
@@ -95,7 +95,7 @@ Structure
9595

9696
* Add a single space after each comma delimiter;
9797

98-
* Add a single space around binary operators (``==``, ``&&``, ...), with
98+
* Add a single space around binary operators (``==``, ``&&``, ...), with
9999
the exception of the concatenation (``.``) operator;
100100

101101
* Place unary operators (``!``, ``--``, ...) adjacent to the affected variable;

‎cookbook/bundles/override.rst

Copy file name to clipboardExpand all lines: cookbook/bundles/override.rst
+14-7Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ the routes from any bundle, then they must be manually imported from somewhere
2323
in your application (e.g. ``app/config/routing.yml``).
2424

2525
The easiest way to "override" a bundle's routing is to never import it at
26-
all. Instead of importing a third-party bundle's routing, simply copying
26+
all. Instead of importing a third-party bundle's routing, simply copy
2727
that routing file into your application, modify it, and import it instead.
2828

2929
Controllers
@@ -68,7 +68,7 @@ in the core FrameworkBundle:
6868
$container->setParameter('translator.class', 'Acme\HelloBundle\Translation\Translator');
6969
7070
Secondly, if the class is not available as a parameter, you want to make sure the
71-
class is always overridden when your bundle is used, or you need to modify
71+
class is always overridden when your bundle is used or if you need to modify
7272
something beyond just the class name, you should use a compiler pass::
7373

7474
// src/Acme/DemoBundle/DependencyInjection/Compiler/OverrideServiceCompilerPass.php
@@ -106,7 +106,7 @@ Forms
106106
-----
107107

108108
In order to override a form type, it has to be registered as a service (meaning
109-
it is tagged as "form.type"). You can then override it as you would override any
109+
it is tagged as ``form.type``). You can then override it as you would override any
110110
service as explained in `Services & Configuration`_. This, of course, will only
111111
work if the type is referred to by its alias rather than being instantiated,
112112
e.g.::
@@ -136,7 +136,7 @@ the constraints to a new validation group:
136136
.. code-block:: yaml
137137
138138
# src/Acme/UserBundle/Resources/config/validation.yml
139-
Fos\UserBundle\Model\User:
139+
FOS\UserBundle\Model\User:
140140
properties:
141141
plainPassword:
142142
- NotBlank:
@@ -152,10 +152,17 @@ the constraints to a new validation group:
152152
<?xml version="1.0" encoding="UTF-8" ?>
153153
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
154154
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
155-
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
155+
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping
156+
http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
157+
158+
<class name="FOS\UserBundle\Model\User">
159+
<property name="plainPassword">
160+
<constraint name="NotBlank">
161+
<option name="groups">
162+
<value>AcmeValidation</value>
163+
</option>
164+
</constraint>
156165
157-
<class name="Fos\UserBundle\Model\User">
158-
<property name="password">
159166
<constraint name="Length">
160167
<option name="min">6</option>
161168
<option name="minMessage">fos_user.password.short</option>

‎cookbook/configuration/external_parameters.rst

Copy file name to clipboardExpand all lines: cookbook/configuration/external_parameters.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ Environment Variables
1414
---------------------
1515

1616
Symfony will grab any environment variable prefixed with ``SYMFONY__`` and
17-
set it as a parameter in the service container. Some transformations are
17+
set it as a parameter in the service container. Some transformations are
1818
applied to the resulting parameter name:
1919

2020
* ``SYMFONY__`` prefix is removed;
2121
* Parameter name is lowercased;
22-
* Double underscores are replaced with a period, as a period is not
22+
* Double underscores are replaced with a period, as a period is not
2323
a valid character in an environment variable name.
2424

2525
For example, if you're using Apache, environment variables can be set using

‎cookbook/configuration/override_dir_structure.rst

Copy file name to clipboardExpand all lines: cookbook/configuration/override_dir_structure.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ file:
151151
work:
152152

153153
.. code-block:: bash
154-
154+
155155
$ php app/console cache:clear --env=prod
156156
$ php app/console assetic:dump --env=prod --no-debug
157157

‎cookbook/console/console_command.rst

Copy file name to clipboardExpand all lines: cookbook/console/console_command.rst
+17-4Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,17 @@ want to extend the AppBundle to greet you from the command line, create
3333
$this
3434
->setName('demo:greet')
3535
->setDescription('Greet someone')
36-
->addArgument('name', InputArgument::OPTIONAL, 'Who do you want to greet?')
37-
->addOption('yell', null, InputOption::VALUE_NONE, 'If set, the task will yell in uppercase letters')
36+
->addArgument(
37+
'name',
38+
InputArgument::OPTIONAL,
39+
'Who do you want to greet?'
40+
)
41+
->addOption(
42+
'yell',
43+
null,
44+
InputOption::VALUE_NONE,
45+
'If set, the task will yell in uppercase letters'
46+
)
3847
;
3948
}
4049

@@ -103,7 +112,9 @@ translate some contents using a console command::
103112
$name = $input->getArgument('name');
104113
$translator = $this->getContainer()->get('translator');
105114
if ($name) {
106-
$output->writeln($translator->trans('Hello %name%!', array('%name%' => $name)));
115+
$output->writeln(
116+
$translator->trans('Hello %name%!', array('%name%' => $name))
117+
);
107118
} else {
108119
$output->writeln($translator->trans('Hello!'));
109120
}
@@ -137,7 +148,9 @@ before translating contents::
137148
$translator->setLocale($locale);
138149

139150
if ($name) {
140-
$output->writeln($translator->trans('Hello %name%!', array('%name%' => $name)));
151+
$output->writeln(
152+
$translator->trans('Hello %name%!', array('%name%' => $name))
153+
);
141154
} else {
142155
$output->writeln($translator->trans('Hello!'));
143156
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.