Skip to content

Commit 12d8531

Browse files
committed
Merge branch '2.8'
* 2.8: (25 commits) Update doctrine.rst Doctrine Custom Mapping fixing whitespace Update NotBlank to reflect the actual validation Updated autoload standard to PSR-4. remove unnecessary code uppercase "dependency injection" use "Symfony Framework" instead of "Symfony framework" use "Form component" instead of "form framework" use "full-stack" instead of "full stack" unify exception usages unify event subscriber usages use "console command" instead of "Console Command" unify EventDispatcher/event dispatcher usages use boolean instead of Boolean use "object-oriented" instead of "object oriented" "web debug toolbar" instead of "Web Debug Toolbar" use "stylesheet" instead of "Stylesheet" unify "Symfony Standard Edition" usages consistency, replace "save-handler" with "save handler" ...
2 parents 25c9705 + 3fddd4a commit 12d8531

File tree

90 files changed

+523
-236
lines changed

Some content is hidden

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

90 files changed

+523
-236
lines changed

best_practices/introduction.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
The Symfony Framework Best Practices
55
====================================
66

7-
The Symfony framework is well-known for being *really* flexible and is used
7+
The Symfony Framework is well-known for being *really* flexible and is used
88
to build micro-sites, enterprise applications that handle billions of connections
99
and even as the basis for *other* frameworks. Since its release in July 2011,
1010
the community has learned a lot about what's possible and how to do things *best*.
@@ -19,7 +19,7 @@ What is this Guide About?
1919
-------------------------
2020

2121
This guide aims to fix that by describing the **best practices for developing
22-
web apps with the Symfony full-stack framework**. These are best practices that
22+
web apps with the Symfony full-stack Framework**. These are best practices that
2323
fit the philosophy of the framework as envisioned by its original creator
2424
`Fabien Potencier`_.
2525

@@ -32,7 +32,7 @@ fit the philosophy of the framework as envisioned by its original creator
3232

3333
This guide is **specially suited** for:
3434

35-
* Websites and web applications developed with the full-stack Symfony framework.
35+
* Websites and web applications developed with the full-stack Symfony Framework.
3636

3737
For other situations, this guide might be a good **starting point** that you can
3838
then **extend and fit to your specific needs**:
@@ -62,8 +62,8 @@ Symfony to follow everything. If you are totally new to Symfony, welcome!
6262
Start with :doc:`The Quick Tour </quick_tour/the_big_picture>` tutorial first.
6363

6464
We've deliberately kept this guide short. We won't repeat explanations that
65-
you can find in the vast Symfony documentation, like discussions about dependency
66-
injection or front controllers. We'll solely focus on explaining how to do
65+
you can find in the vast Symfony documentation, like discussions about Dependency
66+
Injection or front controllers. We'll solely focus on explaining how to do
6767
what you already know.
6868

6969
The Application

book/doctrine.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Databases and Doctrine
66

77
One of the most common and challenging tasks for any application
88
involves persisting and reading information to and from a database. Although
9-
the Symfony full-stack framework doesn't integrate any ORM by default,
9+
the Symfony full-stack Framework doesn't integrate any ORM by default,
1010
the Symfony Standard Edition, which is the most widely used distribution,
1111
comes integrated with `Doctrine`_, a library whose sole goal is to give
1212
you powerful tools to make this easy. In this chapter, you'll learn the

book/forms.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ it into a format that's suitable for being rendered in an HTML form.
198198
``task`` property via the ``getTask()`` and ``setTask()`` methods on the
199199
``Task`` class. Unless a property is public, it *must* have a "getter" and
200200
"setter" method so that the Form component can get and put data onto the
201-
property. For a Boolean property, you can use an "isser" or "hasser" method
201+
property. For a boolean property, you can use an "isser" or "hasser" method
202202
(e.g. ``isPublished()`` or ``hasReminder()``) instead of a getter (e.g.
203203
``getPublished()`` or ``getReminder()``).
204204

@@ -1530,7 +1530,7 @@ file, you can see every block needed to render a form and every default field
15301530
type.
15311531

15321532
In PHP, the fragments are individual template files. By default they are located in
1533-
the `Resources/views/Form` directory of the framework bundle (`view on GitHub`_).
1533+
the ``Resources/views/Form`` directory of the FrameworkBundle (`view on GitHub`_).
15341534

15351535
Each fragment name follows the same basic pattern and is broken up into two pieces,
15361536
separated by a single underscore character (``_``). A few examples are:
@@ -1866,7 +1866,7 @@ an array.
18661866

18671867
Be advised, however, that in most cases using the ``getData()`` method is
18681868
a better choice, since it returns the data (usually an object) after
1869-
it's been transformed by the form framework.
1869+
it's been transformed by the Form component.
18701870

18711871
Adding Validation
18721872
~~~~~~~~~~~~~~~~~

book/http_fundamentals.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ the user is connecting via a secured connection (i.e. HTTPS).
266266

267267
The Request class also has a public ``attributes`` property, which holds
268268
special data related to how the application works internally. For the
269-
Symfony framework, the ``attributes`` holds the values returned by the
269+
Symfony Framework, the ``attributes`` holds the values returned by the
270270
matched route, like ``_controller``, ``id`` (if you have an ``{id}``
271271
wildcard), and even the name of the matched route (``_route``). The
272272
``attributes`` property exists entirely to be a place where you can
@@ -500,7 +500,7 @@ emails, validating user input and handling security.
500500
The good news is that none of these problems is unique. Symfony provides
501501
a framework full of tools that allow you to build your application, not your
502502
tools. With Symfony, nothing is imposed on you: you're free to use the full
503-
Symfony framework, or just one piece of Symfony all by itself.
503+
Symfony Framework, or just one piece of Symfony all by itself.
504504

505505
.. index::
506506
single: Symfony Components
@@ -542,9 +542,9 @@ regardless of how your project is developed. To name a few:
542542
:doc:`Translation </components/translation/introduction>`
543543
A framework for translating strings in your application.
544544

545-
Each one of these components is decoupled and can be used in *any*
546-
PHP project, regardless of whether or not you use the Symfony framework.
547-
Every part is made to be used if needed and replaced when necessary.
545+
Each one of these components is decoupled and can be used in *any* PHP project,
546+
regardless of whether or not you use the Symfony Framework. Every part is
547+
made to be used if needed and replaced when necessary.
548548

549549
.. _the-full-solution-the-symfony2-framework:
550550

book/installation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ you can create Symfony applications using the alternative installation method
126126
based on `Composer`_.
127127

128128
Composer is the dependency manager used by modern PHP applications and it can
129-
also be used to create new applications based on the Symfony framework. If you
129+
also be used to create new applications based on the Symfony Framework. If you
130130
don't have installed it globally, start by reading the next section.
131131

132132
Installing Composer Globally
@@ -333,7 +333,7 @@ applications:
333333
* The `Symfony CMF Standard Edition`_ is the best distribution to get started
334334
with the `Symfony CMF`_ project, which is a project that makes it easier for
335335
developers to add CMS functionality to applications built with the Symfony
336-
framework.
336+
Framework.
337337
* The `Symfony REST Edition`_ shows how to build an application that provides a
338338
RESTful API using the FOSRestBundle and several other related bundles.
339339

book/internals.rst

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ On top of HttpFoundation is the :namespace:`Symfony\\Component\\HttpKernel`
5555
component. HttpKernel handles the dynamic part of HTTP; it is a thin wrapper
5656
on top of the Request and Response classes to standardize the way requests are
5757
handled. It also provides extension points and tools that makes it the ideal
58-
starting point to create a Web framework without too much overhead.
58+
starting point to create a web framework without too much overhead.
5959

6060
It also optionally adds configurability and extensibility, thanks to the
6161
DependencyInjection component and a powerful plugin system (bundles).
@@ -177,12 +177,12 @@ Event):
177177
#. Listeners of the ``kernel.terminate`` event can perform tasks after the
178178
Response has been served.
179179

180-
If an Exception is thrown during processing, the ``kernel.exception`` is
181-
notified and listeners are given a chance to convert the Exception to a
180+
If an exception is thrown during processing, the ``kernel.exception`` is
181+
notified and listeners are given a chance to convert the exception into a
182182
Response. If that works, the ``kernel.response`` event is notified; if not, the
183183
Exception is re-thrown.
184184

185-
If you don't want Exceptions to be caught (for embedded requests for
185+
If you don't want exceptions to be caught (for embedded requests for
186186
instance), disable the ``kernel.exception`` event by passing ``false`` as the
187187
third argument to the ``handle()`` method.
188188

@@ -241,8 +241,8 @@ add the following code at the beginning of your listener method::
241241

242242
.. tip::
243243

244-
If you are not yet familiar with the Symfony EventDispatcher, read the
245-
:doc:`EventDispatcher component documentation </components/event_dispatcher/introduction>`
244+
If you are not yet familiar with the Symfony EventDispatcher component,
245+
read :doc:`its documentation </components/event_dispatcher/introduction>`
246246
section first.
247247

248248
.. index::
@@ -354,7 +354,7 @@ The FrameworkBundle registers several listeners:
354354
Collects data for the current request.
355355

356356
:class:`Symfony\\Bundle\\WebProfilerBundle\\EventListener\\WebDebugToolbarListener`
357-
Injects the Web Debug Toolbar.
357+
Injects the web debug toolbar.
358358

359359
:class:`Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener`
360360
Fixes the Response ``Content-Type`` based on the request format.
@@ -412,7 +412,7 @@ forwards the ``Request`` to a given Controller (the value of the
412412
``class::method`` notation).
413413

414414
A listener on this event can create and set a ``Response`` object, create
415-
and set a new ``Exception`` object, or do nothing::
415+
and set a new ``Exception`` object or do nothing::
416416

417417
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
418418
use Symfony\Component\HttpFoundation\Response;
@@ -452,8 +452,10 @@ and set a new ``Exception`` object, or do nothing::
452452
.. index::
453453
single: EventDispatcher
454454

455-
The EventDispatcher
456-
-------------------
455+
.. _the-eventdispatcher:
456+
457+
The EventDispatcher Component
458+
-----------------------------
457459

458460
The EventDispatcher is a standalone component that is responsible for much
459461
of the underlying logic and flow behind a Symfony request. For more information,
@@ -474,7 +476,7 @@ enhance performance; use it in the production environment to explore problems
474476
after the fact.
475477

476478
You rarely have to deal with the profiler directly as Symfony provides
477-
visualizer tools like the Web Debug Toolbar and the Web Profiler. If you use
479+
visualizer tools like the web debug toolbar and the web profiler. If you use
478480
the Symfony Standard Edition, the profiler, the web debug toolbar, and the
479481
web profiler are all already configured with sensible settings.
480482

@@ -500,7 +502,7 @@ bottom of all pages. It displays a good summary of the profiling data that
500502
gives you instant access to a lot of useful information when something does
501503
not work as expected.
502504

503-
If the summary provided by the Web Debug Toolbar is not enough, click on the
505+
If the summary provided by the web debug toolbar is not enough, click on the
504506
token link (a string made of 13 random characters) to access the Web Profiler.
505507

506508
.. note::

book/page_creation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ of the most common elements of a bundle:
763763
Contains the controllers of the bundle (e.g. ``RandomController.php``).
764764

765765
``DependencyInjection/``
766-
Holds certain dependency injection extension classes, which may import service
766+
Holds certain Dependency Injection Extension classes, which may import service
767767
configuration, register compiler passes or more (this directory is not
768768
necessary).
769769

@@ -1082,7 +1082,7 @@ in mind:
10821082
and ``vendor/`` (third-party code) (there's also a ``bin/`` directory that's
10831083
used to help updated vendor libraries);
10841084

1085-
* Each feature in Symfony (including the Symfony framework core) is organized
1085+
* Each feature in Symfony (including the Symfony Framework core) is organized
10861086
into a *bundle*, which is a structured set of files for that feature;
10871087

10881088
* The **configuration** for each bundle lives in the ``Resources/config``

book/performance.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ your ``php.ini`` configuration.
4646
Use Composer's Class Map Functionality
4747
--------------------------------------
4848

49-
By default, the Symfony standard edition uses Composer's autoloader
49+
By default, the Symfony Standard Edition uses Composer's autoloader
5050
in the `autoload.php`_ file. This autoloader is easy to use, as it will
5151
automatically find any new classes that you've placed in the registered
5252
directories.

book/propel.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ from cheapest to most expensive. From inside a controller, do the following::
288288
->orderByPrice()
289289
->find();
290290

291-
In one line, you get your products in a powerful oriented object way. No need
292-
to waste your time with SQL or whatever, Symfony offers fully object oriented
291+
In one line, you get your products in a powerful object-oriented way. No need
292+
to waste your time with SQL or whatever, Symfony offers fully object-oriented
293293
programming and Propel respects the same philosophy by providing an awesome
294294
abstraction layer.
295295

book/routing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ In an upcoming section, you'll learn how to generate URLs from inside templates.
14951495

14961496
.. tip::
14971497

1498-
If the frontend of your application uses Ajax requests, you might want
1498+
If the front-end of your application uses Ajax requests, you might want
14991499
to be able to generate URLs in JavaScript based on your routing configuration.
15001500
By using the `FOSJsRoutingBundle`_, you can do exactly that:
15011501

book/service_container.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ In other words, a service container extension configures the services for
419419
a bundle on your behalf. And as you'll see in a moment, the extension provides
420420
a sensible, high-level interface for configuring the bundle.
421421

422-
Take the FrameworkBundle - the core Symfony framework bundle - as an
422+
Take the FrameworkBundle - the core Symfony Framework bundle - as an
423423
example. The presence of the following code in your application configuration
424424
invokes the service container extension inside the FrameworkBundle:
425425

@@ -474,7 +474,7 @@ can handle the ``framework`` configuration directive. The extension in question,
474474
which lives in the FrameworkBundle, is invoked and the service configuration
475475
for the FrameworkBundle is loaded. If you remove the ``framework`` key
476476
from your application configuration file entirely, the core Symfony services
477-
won't be loaded. The point is that you're in control: the Symfony framework
477+
won't be loaded. The point is that you're in control: the Symfony Framework
478478
doesn't contain any magic or perform any actions that you don't have control
479479
over.
480480

book/templating.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ subdirectory.
13771377
Overriding Core Templates
13781378
~~~~~~~~~~~~~~~~~~~~~~~~~
13791379

1380-
Since the Symfony framework itself is just a bundle, core templates can be
1380+
Since the Symfony Framework itself is just a bundle, core templates can be
13811381
overridden in the same way. For example, the core TwigBundle contains
13821382
a number of different "exception" and "error" templates that can be overridden
13831383
by copying each from the ``Resources/views/Exception`` directory of the

book/testing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ Accessing the Container
462462

463463
It's highly recommended that a functional test only tests the Response. But
464464
under certain very rare circumstances, you might want to access some internal
465-
objects to write assertions. In such cases, you can access the dependency
466-
injection container::
465+
objects to write assertions. In such cases, you can access the Dependency
466+
Injection Container::
467467

468468
$container = $client->getContainer();
469469

book/translation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ into the language of the user::
2727
*country* code (e.g. ``fr_FR`` for French/France) is recommended.
2828

2929
In this chapter, you'll learn how to use the Translation component in the
30-
Symfony framework. You can read the
30+
Symfony Framework. You can read the
3131
:doc:`Translation component documentation </components/translation/usage>`
3232
to learn even more. Overall, the process has several steps:
3333

@@ -574,7 +574,7 @@ the framework:
574574
Translating Constraint Messages
575575
-------------------------------
576576

577-
If you're using validation constraints with the form framework, then translating
577+
If you're using validation constraints with the Form component, then translating
578578
the error messages is easy: simply create a translation resource for the
579579
``validators`` :ref:`domain <using-message-domains>`.
580580

components/console/helpers/dialoghelper.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ convenient for passwords::
9696
When you ask for a hidden response, Symfony will use either a binary, change
9797
stty mode or use another trick to hide the response. If none is available,
9898
it will fallback and allow the response to be visible unless you pass ``false``
99-
as the third argument like in the example above. In this case, a RuntimeException
99+
as the third argument like in the example above. In this case, a ``RuntimeException``
100100
would be thrown.
101101

102102
Validating the Answer

components/dependency_injection/compilation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ The XML version of the config would then look like this:
207207
208208
.. note::
209209

210-
In the Symfony full stack framework there is a base Extension class which
210+
In the Symfony full-stack Framework there is a base Extension class which
211211
implements these methods as well as a shortcut method for processing the
212212
configuration. See :doc:`/cookbook/bundles/extension` for more details.
213213

@@ -343,9 +343,9 @@ will then be called when the container is compiled::
343343

344344
.. note::
345345

346-
Compiler passes are registered differently if you are using the full
347-
stack framework, see :doc:`/cookbook/service_container/compiler_passes`
348-
for more details.
346+
Compiler passes are registered differently if you are using the full-stack
347+
framework, see :doc:`/cookbook/service_container/compiler_passes` for
348+
more details.
349349

350350
Controlling the Pass Ordering
351351
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -506,5 +506,5 @@ to see if the files have changed, if they have the cache will be considered stal
506506

507507
.. note::
508508

509-
In the full stack framework the compilation and caching of the container
509+
In the full-stack framework the compilation and caching of the container
510510
is taken care of for you.

components/dependency_injection/tags.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ run when the container is compiled::
173173

174174
.. note::
175175

176-
Compiler passes are registered differently if you are using the full
177-
stack framework. See :doc:`/cookbook/service_container/compiler_passes`
178-
for more details.
176+
Compiler passes are registered differently if you are using the full-stack
177+
framework. See :doc:`/cookbook/service_container/compiler_passes` for
178+
more details.
179179

180180
Adding additional Attributes on Tags
181181
------------------------------------

components/dependency_injection/workflow.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ In the preceding pages of this section, there has been little to say about
88
where the various files and classes should be located. This is because this
99
depends on the application, library or framework in which you want to use
1010
the container. Looking at how the container is configured and built in the
11-
Symfony full stack framework will help you see how this all fits together,
12-
whether you are using the full stack framework or looking to use the service
11+
Symfony full-stack Framework will help you see how this all fits together,
12+
whether you are using the full-stack framework or looking to use the service
1313
container in another application.
1414

15-
The full stack framework uses the HttpKernel component to manage the loading
15+
The full-stack framework uses the HttpKernel component to manage the loading
1616
of the service container configuration from the application and bundles and
1717
also handles the compilation and caching. Even if you are not using HttpKernel,
1818
it should give you an idea of one way of organizing configuration in a modular

0 commit comments

Comments
 (0)