diff --git a/bundles/extension.rst b/bundles/extension.rst index 2daefd2fed6..3b77d375985 100644 --- a/bundles/extension.rst +++ b/bundles/extension.rst @@ -29,7 +29,7 @@ following conventions: The Extension class should implement the :class:`Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface`, -but usually you would simply extend the +but usually you would extend the :class:`Symfony\\Component\\DependencyInjection\\Extension\\Extension` class:: // src/Acme/HelloBundle/DependencyInjection/AcmeHelloExtension.php diff --git a/bundles/override.rst b/bundles/override.rst index bf37ee41dd2..ab1541ae530 100644 --- a/bundles/override.rst +++ b/bundles/override.rst @@ -29,8 +29,8 @@ the routes from any bundle, then they must be manually imported from somewhere in your application (e.g. ``app/config/routing.yml``). The easiest way to "override" a bundle's routing is to never import it at -all. Instead of importing a third-party bundle's routing, simply copy -that routing file into your application, modify it, and import it instead. +all. Instead of importing a third-party bundle's routing, copy that +routing file into your application, modify it, and import it instead. Controllers ----------- diff --git a/components/debug.rst b/components/debug.rst index 56706b625be..74f5e2947cd 100644 --- a/components/debug.rst +++ b/components/debug.rst @@ -22,7 +22,7 @@ Usage ----- The Debug component provides several tools to help you debug PHP code. -Enabling them all is as easy as it can get:: +Enabling them all by calling this method:: use Symfony\Component\Debug\Debug; @@ -83,7 +83,7 @@ throw more helpful exceptions when a class isn't found by the registered autoloaders. All autoloaders that implement a ``findFile()`` method are replaced with a ``DebugClassLoader`` wrapper. -Using the ``DebugClassLoader`` is as easy as calling its static +Using the ``DebugClassLoader`` is done by calling its static :method:`Symfony\\Component\\Debug\\DebugClassLoader::enable` method:: use Symfony\Component\Debug\DebugClassLoader; diff --git a/components/http_foundation.rst b/components/http_foundation.rst index c0a2b7eae6b..5da8bfd74b5 100644 --- a/components/http_foundation.rst +++ b/components/http_foundation.rst @@ -245,7 +245,7 @@ the previous requests. Accessing ``Accept-*`` Headers Data ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -You can easily access basic data extracted from ``Accept-*`` headers +You can access basic data extracted from ``Accept-*`` headers by using the following methods: :method:`Symfony\\Component\\HttpFoundation\\Request::getAcceptableContentTypes` @@ -490,8 +490,8 @@ Serving Files ~~~~~~~~~~~~~ When sending a file, you must add a ``Content-Disposition`` header to your -response. While creating this header for basic file downloads is easy, using -non-ASCII filenames is more involving. The +response. While creating this header for basic file downloads is straightforward, +using non-ASCII filenames is more involving. The :method:`Symfony\\Component\\HttpFoundation\\ResponseHeaderBag::makeDisposition` abstracts the hard work behind a simple API:: diff --git a/components/http_kernel.rst b/components/http_kernel.rst index 1a4734f38a2..3ebe457d15b 100644 --- a/components/http_kernel.rst +++ b/components/http_kernel.rst @@ -174,7 +174,7 @@ to the login page or a 403 Access Denied response. If a ``Response`` is returned at this stage, the process skips directly to the :ref:`kernel.response ` event. -Other listeners simply initialize things or add more information to the request. +Other listeners initialize things or add more information to the request. For example, a listener might determine and set the locale on the ``Request`` object. diff --git a/components/stopwatch.rst b/components/stopwatch.rst index 145d55ed43d..4c184c250f0 100644 --- a/components/stopwatch.rst +++ b/components/stopwatch.rst @@ -21,7 +21,7 @@ Alternatively, you can clone the ``_ repos Usage ----- -The Stopwatch component provides an easy and consistent way to measure execution +The Stopwatch component provides an consistent way to measure execution time of certain parts of code so that you don't constantly have to parse microtime by yourself. Instead, use the simple :class:`Symfony\\Component\\Stopwatch\\Stopwatch` class:: diff --git a/components/templating.rst b/components/templating.rst index bd23640d9ad..2f6a29e4792 100644 --- a/components/templating.rst +++ b/components/templating.rst @@ -144,9 +144,8 @@ escaper using the Helpers ------- -The Templating component can be easily extended via helpers. Helpers are PHP objects that -provide features useful in a template context. The component has -one built-in helper: +The Templating component can be extended via helpers. Helpers are PHP objects that +provide features useful in a template context. The component has one built-in helper: * :doc:`/components/templating/slotshelper` diff --git a/console/input.rst b/console/input.rst index 2f570e73d4d..c86a4a46b7f 100644 --- a/console/input.rst +++ b/console/input.rst @@ -119,7 +119,7 @@ Using Command Options Unlike arguments, options are not ordered (meaning you can specify them in any order) and are specified with two dashes (e.g. ``--yell``). Options are *always* optional, and can be setup to accept a value (e.g. ``--dir=src``) or -simply as a boolean flag without a value (e.g. ``--yell``). +as a boolean flag without a value (e.g. ``--yell``). For example, add a new option to the command that can be used to specify how many times in a row the message should be printed:: diff --git a/console/request_context.rst b/console/request_context.rst index 06b8a338b99..130714d4d47 100644 --- a/console/request_context.rst +++ b/console/request_context.rst @@ -72,7 +72,7 @@ will override the defaults. Configuring the Request Context per Command ------------------------------------------- -To change it only in one command you can simply fetch the Request Context +To change it only in one command you need to fetch the Request Context from the ``router`` service and override its settings:: // src/AppBundle/Command/DemoCommand.php diff --git a/create_framework/dependency_injection.rst b/create_framework/dependency_injection.rst index ed8b804718d..50e0a8ad8b3 100644 --- a/create_framework/dependency_injection.rst +++ b/create_framework/dependency_injection.rst @@ -66,15 +66,15 @@ framework more configurable, but at the same time, it introduces a lot of issues: * We are not able to register custom listeners anymore as the dispatcher is - not available outside the Framework class (an easy workaround could be the + not available outside the Framework class (an workaround could be the adding of a ``Framework::getEventDispatcher()`` method); * We have lost the flexibility we had before; you cannot change the implementation of the ``UrlMatcher`` or of the ``ControllerResolver`` anymore; -* Related to the previous point, we cannot test our framework easily anymore - as it's impossible to mock internal objects; +* Related to the previous point, we cannot test our framework without much + effort anymore as it's impossible to mock internal objects; * We cannot change the charset passed to ``ResponseListener`` anymore (a workaround could be to pass it as a constructor argument). @@ -234,7 +234,7 @@ And the related change in the front controller:: $container->setParameter('routes', include __DIR__.'/../src/app.php'); -We have obviously barely scratched the surface of what you can do with the +We have barely scratched the surface of what you can do with the container: from class names as parameters, to overriding existing object definitions, from shared service support to dumping a container to a plain PHP class, and much more. The Symfony dependency injection container is really powerful diff --git a/create_framework/event_dispatcher.rst b/create_framework/event_dispatcher.rst index 7c515da2b15..8577314d797 100644 --- a/create_framework/event_dispatcher.rst +++ b/create_framework/event_dispatcher.rst @@ -3,8 +3,7 @@ The EventDispatcher Component Our framework is still missing a major characteristic of any good framework: *extensibility*. Being extensible means that the developer should be able to -easily hook into the framework life cycle to modify the way the request is -handled. +hook into the framework life cycle to modify the way the request is handled. What kind of hooks are we talking about? Authentication or caching for instance. To be flexible, hooks must be plug-and-play; the ones you "register" diff --git a/create_framework/front_controller.rst b/create_framework/front_controller.rst index 2f271e5b704..8d388c53855 100644 --- a/create_framework/front_controller.rst +++ b/create_framework/front_controller.rst @@ -61,8 +61,8 @@ which name is exposed to the end user via the URL (``http://127.0.0.1:4321/bye.php``): there is a direct mapping between the PHP script name and the client URL. This is because the dispatching of the request is done by the web server directly. It might be a good idea to move this -dispatching to our code for better flexibility. This can be easily achieved by -routing all client requests to a single PHP script. +dispatching to our code for better flexibility. This can be achieved by routing +all client requests to a single PHP script. .. tip:: diff --git a/create_framework/http_kernel_httpkernel_class.rst b/create_framework/http_kernel_httpkernel_class.rst index 07e7820c3df..a607cf1ae86 100644 --- a/create_framework/http_kernel_httpkernel_class.rst +++ b/create_framework/http_kernel_httpkernel_class.rst @@ -4,7 +4,7 @@ The HttpKernel Component: The HttpKernel Class If you were to use our framework right now, you would probably have to add support for custom error messages. We do have 404 and 500 error support but the responses are hardcoded in the framework itself. Making them customizable -is easy enough though: dispatch a new event and listen to it. Doing it right +is straightforward though: dispatch a new event and listen to it. Doing it right means that the listener has to call a regular controller. But what if the error controller throws an exception? You will end up in an infinite loop. There should be an easier way, right? @@ -114,9 +114,8 @@ client; that's what the ``ResponseListener`` does:: $dispatcher->addSubscriber(new HttpKernel\EventListener\ResponseListener('UTF-8')); -This one was easy too! Let's take another one: do you want out of the box -support for streamed responses? Just subscribe to -``StreamedResponseListener``:: +If you want out of the box support for streamed responses, subscribe +to ``StreamedResponseListener``:: $dispatcher->addSubscriber(new HttpKernel\EventListener\StreamedResponseListener()); diff --git a/create_framework/http_kernel_httpkernelinterface.rst b/create_framework/http_kernel_httpkernelinterface.rst index 2d7c2ed053f..3a3f62f5894 100644 --- a/create_framework/http_kernel_httpkernelinterface.rst +++ b/create_framework/http_kernel_httpkernelinterface.rst @@ -46,7 +46,7 @@ Update your framework so that it implements this interface:: } } -Even if this change looks trivial, it brings us a lot! Let's talk about one of +Even if this change looks not to complex, it brings us a lot! Let's talk about one of the most impressive one: transparent :doc:`HTTP caching ` support. The ``HttpCache`` class implements a fully-featured reverse proxy, written in diff --git a/create_framework/routing.rst b/create_framework/routing.rst index ef3307ccd99..de06ebcbddc 100644 --- a/create_framework/routing.rst +++ b/create_framework/routing.rst @@ -189,7 +189,7 @@ more flexible than the previous one. Enjoy! Using the Routing component has one big additional benefit: the ability to generate URLs based on Route definitions. When using both URL matching and URL generation in your code, changing the URL patterns should have no other -impact. Want to know how to use the generator? Insanely easy:: +impact. You can use the generator this way:: use Symfony\Component\Routing; diff --git a/create_framework/separation_of_concerns.rst b/create_framework/separation_of_concerns.rst index 9ed5a65f258..1811ec2e813 100644 --- a/create_framework/separation_of_concerns.rst +++ b/create_framework/separation_of_concerns.rst @@ -171,7 +171,7 @@ a well defined goal: our application; * ``src/Simplex``: The reusable framework code that abstracts the handling of - incoming Requests (by the way, it makes your controllers/templates easily + incoming Requests (by the way, it makes your controllers/templates better testable -- more about that later on); * ``src/Calendar``: Our application specific code (the controllers and the diff --git a/create_framework/unit_testing.rst b/create_framework/unit_testing.rst index 17cf79393be..ce6cfbb86cc 100644 --- a/create_framework/unit_testing.rst +++ b/create_framework/unit_testing.rst @@ -136,7 +136,7 @@ Executing this test is as simple as running ``phpunit`` from the After the test ran, you should see a green bar. If not, you have a bug either in the test or in the framework code! -Adding a unit test for any exception thrown in a controller is just as easy:: +Adding a unit test for any exception thrown in a controller:: public function testErrorHandling() { diff --git a/http_cache.rst b/http_cache.rst index 2f77a314a22..91009f2bf79 100644 --- a/http_cache.rst +++ b/http_cache.rst @@ -77,9 +77,8 @@ but is a great way to start. For details on setting up Varnish, see :doc:`/http_cache/varnish`. -Enabling the proxy is easy: each application comes with a caching kernel (``AppCache``) -that wraps the default one (``AppKernel``). The caching Kernel *is* the reverse -proxy. +Each application comes with a caching kernel (``AppCache``)that wraps the +default one (``AppKernel``). The caching Kernel *is* the reverse proxy. To enable caching, modify the code of your front controller. You can also make these changes to ``app_dev.php`` to add caching to the ``dev`` environment:: @@ -267,7 +266,7 @@ Validation Caching single: Cache; Cache-Control header single: HTTP headers; Cache-Control -With expiration caching, you simply say "cache for 3600 seconds!". But, when someone +With expiration caching, you say "cache for 3600 seconds!". But, when someone updates cached content, you won't see that content on your site until the cache expires. diff --git a/reference/constraints/Collection.rst b/reference/constraints/Collection.rst index 19d8205a107..ccb3538c6ff 100644 --- a/reference/constraints/Collection.rst +++ b/reference/constraints/Collection.rst @@ -163,7 +163,7 @@ following: Presence and Absence of Fields ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -By default, this constraint validates more than simply whether or not the +By default, this constraint validates more than whether or not the individual fields in the collection pass their assigned constraints. In fact, if any keys of a collection are missing or if there are any unrecognized keys in the collection, validation errors will be thrown. diff --git a/reference/constraints/IsNull.rst b/reference/constraints/IsNull.rst index bc174a76255..2a01537f0a0 100644 --- a/reference/constraints/IsNull.rst +++ b/reference/constraints/IsNull.rst @@ -2,7 +2,7 @@ IsNull ====== Validates that a value is exactly equal to ``null``. To force that a property -is simply blank (blank string or ``null``), see the :doc:`/reference/constraints/Blank` +is blank (blank string or ``null``), see the :doc:`/reference/constraints/Blank` constraint. To ensure that a property is not null, see :doc:`/reference/constraints/NotNull`. Also see :doc:`NotNull `. diff --git a/reference/constraints/NotBlank.rst b/reference/constraints/NotBlank.rst index 93f8db220a1..b49f1df73ea 100644 --- a/reference/constraints/NotBlank.rst +++ b/reference/constraints/NotBlank.rst @@ -8,7 +8,7 @@ a blank array, ``null`` or ``false``:: // validation will fail } -To force that a value is simply not equal to ``null``, see the +To force that a value is not equal to ``null``, see the :doc:`/reference/constraints/NotNull` constraint. +----------------+------------------------------------------------------------------------+ diff --git a/security.rst b/security.rst index 09ec5fca3ac..7004107da73 100644 --- a/security.rst +++ b/security.rst @@ -452,7 +452,7 @@ this would deny you access. More on that later (:ref:`security-authorization-acc Loading Users from the Database ............................... -If you'd like to load your users via the Doctrine ORM, that's easy! See +If you'd like to load your users via the Doctrine ORM, see :doc:`/security/entity_provider` for all the details. .. _security-encoding-user-password: @@ -685,8 +685,7 @@ Add Code to Deny Access There are **two** ways to deny access to something: #. :ref:`access_control in security.yml ` - allows you to protect URL patterns (e.g. ``/admin/*``). This is easy, - but less flexible; + allows you to protect URL patterns (e.g. ``/admin/*``). Simpler, but less flexible; #. :ref:`in your code via the security.authorization_checker service `. @@ -808,8 +807,8 @@ matches the URL. ]); Prepending the path with ``^`` means that only URLs *beginning* with the -pattern are matched. For example, a path of simply ``/admin`` (without -the ``^``) would match ``/admin/foo`` but would also match URLs like ``/foo/admin``. +pattern are matched. For example, a path of ``/admin`` (without the ``^``) +would match ``/admin/foo`` but would also match URLs like ``/foo/admin``. .. _security-access-control-explanation: @@ -828,7 +827,7 @@ the ``^``) would match ``/admin/foo`` but would also match URLs like ``/foo/admi Securing Controllers and other Code ................................... -You can easily deny access from inside a controller:: +You can deny access from inside a controller:: // ... diff --git a/session/php_bridge.rst b/session/php_bridge.rst index a52d5ca4779..b36093a7b6e 100644 --- a/session/php_bridge.rst +++ b/session/php_bridge.rst @@ -45,7 +45,7 @@ for the ``handler_id``: ], ]); -Otherwise, if the problem is simply that you cannot avoid the application +Otherwise, if the problem is that you cannot avoid the application starting the session with ``session_start()``, you can still make use of a Symfony based session save handler by specifying the save handler as in the example below: diff --git a/testing/profiling.rst b/testing/profiling.rst index 7f2b815af97..be7b86fcc72 100644 --- a/testing/profiling.rst +++ b/testing/profiling.rst @@ -51,7 +51,7 @@ the ``test`` environment):: If a test fails because of profiling data (too many DB queries for instance), you might want to use the Web Profiler to analyze the request after the tests -finish. It's easy to achieve if you embed the token in the error message:: +finish. It can be achived by embedding the token in the error message:: $this->assertLessThan( 30, diff --git a/validation/raw_values.rst b/validation/raw_values.rst index 85977ce1008..13fb1f08f3e 100644 --- a/validation/raw_values.rst +++ b/validation/raw_values.rst @@ -6,8 +6,7 @@ How to Validate Raw Values (Scalar Values and Arrays) Usually you will be validating entire objects. But sometimes, you just want to validate a simple value - like to verify that a string is a valid email -address. This is actually pretty easy to do. From inside a controller, it -looks like this:: +address. From inside a controller, it looks like this:: // ... use Symfony\Component\Validator\Constraints as Assert; diff --git a/validation/translations.rst b/validation/translations.rst index c3fa2aee3b6..340704dc3a6 100644 --- a/validation/translations.rst +++ b/validation/translations.rst @@ -4,8 +4,8 @@ How to Translate Validation Constraint Messages =============================================== -If you're using validation constraints with the Form component, then translating -the error messages is easy: simply create a translation resource for the +If you're using validation constraints with the Form component, you can translate +the error messages by creating a translation resource for the ``validators`` :ref:`domain `. To start, suppose you've created a plain-old-PHP object that you need to