Skip to content

Commit

Permalink
Merge branch '2.8'
Browse files Browse the repository at this point in the history
* 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"
  ...
  • Loading branch information
weaverryan committed May 22, 2015
2 parents 25c9705 + 3fddd4a commit 12d8531
Show file tree
Hide file tree
Showing 90 changed files with 523 additions and 236 deletions.
10 changes: 5 additions & 5 deletions best_practices/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
The Symfony Framework Best Practices
====================================

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

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

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

This guide is **specially suited** for:

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

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

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

The Application
Expand Down
2 changes: 1 addition & 1 deletion book/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Databases and Doctrine

One of the most common and challenging tasks for any application
involves persisting and reading information to and from a database. Although
the Symfony full-stack framework doesn't integrate any ORM by default,
the Symfony full-stack Framework doesn't integrate any ORM by default,
the Symfony Standard Edition, which is the most widely used distribution,
comes integrated with `Doctrine`_, a library whose sole goal is to give
you powerful tools to make this easy. In this chapter, you'll learn the
Expand Down
6 changes: 3 additions & 3 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ it into a format that's suitable for being rendered in an HTML form.
``task`` property via the ``getTask()`` and ``setTask()`` methods on the
``Task`` class. Unless a property is public, it *must* have a "getter" and
"setter" method so that the Form component can get and put data onto the
property. For a Boolean property, you can use an "isser" or "hasser" method
property. For a boolean property, you can use an "isser" or "hasser" method
(e.g. ``isPublished()`` or ``hasReminder()``) instead of a getter (e.g.
``getPublished()`` or ``getReminder()``).

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

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

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

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

Adding Validation
~~~~~~~~~~~~~~~~~
Expand Down
10 changes: 5 additions & 5 deletions book/http_fundamentals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ the user is connecting via a secured connection (i.e. HTTPS).

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

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions book/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ you can create Symfony applications using the alternative installation method
based on `Composer`_.

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

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

Expand Down
26 changes: 14 additions & 12 deletions book/internals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ On top of HttpFoundation is the :namespace:`Symfony\\Component\\HttpKernel`
component. HttpKernel handles the dynamic part of HTTP; it is a thin wrapper
on top of the Request and Response classes to standardize the way requests are
handled. It also provides extension points and tools that makes it the ideal
starting point to create a Web framework without too much overhead.
starting point to create a web framework without too much overhead.

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

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

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

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

.. tip::

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

.. index::
Expand Down Expand Up @@ -354,7 +354,7 @@ The FrameworkBundle registers several listeners:
Collects data for the current request.

:class:`Symfony\\Bundle\\WebProfilerBundle\\EventListener\\WebDebugToolbarListener`
Injects the Web Debug Toolbar.
Injects the web debug toolbar.

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

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

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

The EventDispatcher
-------------------
.. _the-eventdispatcher:

The EventDispatcher Component
-----------------------------

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

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

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

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

.. note::
Expand Down
4 changes: 2 additions & 2 deletions book/page_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ of the most common elements of a bundle:
Contains the controllers of the bundle (e.g. ``RandomController.php``).

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

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

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

* The **configuration** for each bundle lives in the ``Resources/config``
Expand Down
2 changes: 1 addition & 1 deletion book/performance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ your ``php.ini`` configuration.
Use Composer's Class Map Functionality
--------------------------------------

By default, the Symfony standard edition uses Composer's autoloader
By default, the Symfony Standard Edition uses Composer's autoloader
in the `autoload.php`_ file. This autoloader is easy to use, as it will
automatically find any new classes that you've placed in the registered
directories.
Expand Down
4 changes: 2 additions & 2 deletions book/propel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ from cheapest to most expensive. From inside a controller, do the following::
->orderByPrice()
->find();

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

Expand Down
2 changes: 1 addition & 1 deletion book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,7 @@ In an upcoming section, you'll learn how to generate URLs from inside templates.

.. tip::

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

Expand Down
4 changes: 2 additions & 2 deletions book/service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ In other words, a service container extension configures the services for
a bundle on your behalf. And as you'll see in a moment, the extension provides
a sensible, high-level interface for configuring the bundle.

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

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

Expand Down
2 changes: 1 addition & 1 deletion book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ subdirectory.
Overriding Core Templates
~~~~~~~~~~~~~~~~~~~~~~~~~

Since the Symfony framework itself is just a bundle, core templates can be
Since the Symfony Framework itself is just a bundle, core templates can be
overridden in the same way. For example, the core TwigBundle contains
a number of different "exception" and "error" templates that can be overridden
by copying each from the ``Resources/views/Exception`` directory of the
Expand Down
4 changes: 2 additions & 2 deletions book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,8 @@ Accessing the Container

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

$container = $client->getContainer();

Expand Down
4 changes: 2 additions & 2 deletions book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ into the language of the user::
*country* code (e.g. ``fr_FR`` for French/France) is recommended.

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

Expand Down Expand Up @@ -574,7 +574,7 @@ the framework:
Translating Constraint Messages
-------------------------------

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

Expand Down
2 changes: 1 addition & 1 deletion components/console/helpers/dialoghelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ convenient for passwords::
When you ask for a hidden response, Symfony will use either a binary, change
stty mode or use another trick to hide the response. If none is available,
it will fallback and allow the response to be visible unless you pass ``false``
as the third argument like in the example above. In this case, a RuntimeException
as the third argument like in the example above. In this case, a ``RuntimeException``
would be thrown.

Validating the Answer
Expand Down
10 changes: 5 additions & 5 deletions components/dependency_injection/compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ The XML version of the config would then look like this:
.. note::

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

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

.. note::

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

Controlling the Pass Ordering
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -506,5 +506,5 @@ to see if the files have changed, if they have the cache will be considered stal

.. note::

In the full stack framework the compilation and caching of the container
In the full-stack framework the compilation and caching of the container
is taken care of for you.
6 changes: 3 additions & 3 deletions components/dependency_injection/tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ run when the container is compiled::

.. note::

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

Adding additional Attributes on Tags
------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions components/dependency_injection/workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ In the preceding pages of this section, there has been little to say about
where the various files and classes should be located. This is because this
depends on the application, library or framework in which you want to use
the container. Looking at how the container is configured and built in the
Symfony full stack framework will help you see how this all fits together,
whether you are using the full stack framework or looking to use the service
Symfony full-stack Framework will help you see how this all fits together,
whether you are using the full-stack framework or looking to use the service
container in another application.

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

0 comments on commit 12d8531

Please sign in to comment.