diff --git a/best_practices/business-logic.rst b/best_practices/business-logic.rst index 143e1f696a4..d4da19721a8 100644 --- a/best_practices/business-logic.rst +++ b/best_practices/business-logic.rst @@ -176,7 +176,7 @@ This practice is cumbersome and completely unnecessary for your own services. Don't define parameters for the classes of your services. This practice was wrongly adopted from third-party bundles. When Symfony -introduced its service container, some developers used this technique to easily +introduced its service container, some developers used this technique to allow overriding services. However, overriding a service by just changing its class name is a very rare use case because, frequently, the new service has different constructor arguments. diff --git a/best_practices/controllers.rst b/best_practices/controllers.rst index 2be1bf6f01e..22605898357 100644 --- a/best_practices/controllers.rst +++ b/best_practices/controllers.rst @@ -119,7 +119,7 @@ Fetching Services If you extend the base ``Controller`` class, you can access services directly from the container via ``$this->container->get()`` or ``$this->get()``. But instead, you -should use dependency injection to fetch services: most easily done by +should use dependency injection to fetch services by :ref:`type-hinting action method arguments `: .. best-practice:: @@ -208,9 +208,9 @@ flexible:: // ... } -The point is this: the ParamConverter shortcut is great for simple situations. -But you shouldn't forget that querying for entities directly is still very -easy. +The point is this: the ParamConverter shortcut is great for most situations. +However, there is nothing wrong with querying for entities directly if the +ParamConverter would get complicated. Pre and Post Hooks ------------------ diff --git a/best_practices/security.rst b/best_practices/security.rst index 6eef4c6cf43..4536cf14ea0 100644 --- a/best_practices/security.rst +++ b/best_practices/security.rst @@ -108,8 +108,7 @@ The @Security Annotation ------------------------ For controlling access on a controller-by-controller basis, use the ``@Security`` -annotation whenever possible. It's easy to read and is placed consistently -above each action. +annotation whenever possible. Placing it above each action makes it consistent and readable. In our application, you need the ``ROLE_ADMIN`` in order to create a new post. Using ``@Security``, this looks like: @@ -156,7 +155,7 @@ Notice that this requires the use of the `ParamConverter`_, which automatically queries for the ``Post`` object and puts it on the ``$post`` argument. This is what makes it possible to use the ``post`` variable in the expression. -This has one major drawback: an expression in an annotation cannot easily +This has one major drawback: an expression in an annotation cannot be reused in other parts of the application. Imagine that you want to add a link in a template that will only be seen by authors. Right now you'll need to repeat the expression code using Twig syntax: @@ -167,7 +166,7 @@ need to repeat the expression code using Twig syntax: ... {% endif %} -The easiest solution - if your logic is simple enough - is to add a new method +A good solution - if your logic is simple enough - can be to add a new method to the ``Post`` entity that checks if a given user is its author:: // src/AppBundle/Entity/Post.php diff --git a/best_practices/templates.rst b/best_practices/templates.rst index 6d128aa5a13..03d9a6dbc83 100644 --- a/best_practices/templates.rst +++ b/best_practices/templates.rst @@ -58,7 +58,7 @@ scattered through lots of bundles. Use a prefixed underscore for partial templates in template names. You often want to reuse template code using the ``include`` function to avoid -redundant code. To determine those partials easily in the filesystem you should +redundant code. To determine those partials in the filesystem you should prefix partials and any other template without HTML body or ``extends`` tag with a single underscore. diff --git a/best_practices/web-assets.rst b/best_practices/web-assets.rst index 6bed1e11086..04d468cbc0c 100644 --- a/best_practices/web-assets.rst +++ b/best_practices/web-assets.rst @@ -37,11 +37,11 @@ Using Assetic .. include:: /assetic/_standard_edition_warning.rst.inc -These days, you probably can't simply create static CSS and JavaScript files -and include them in your template. Instead, you'll probably want to combine -and minify these to improve client-side performance. You may also want to -use LESS or Sass (for example), which means you'll need some way to process -these into CSS files. +These days, you probably can't create static CSS and JavaScript files and +include them in your template without much effort. Instead, you'll probably +want to combine and minify these to improve client-side performance. You may +also want to use LESS or Sass (for example), which means you'll need some way +to process these into CSS files. A lot of tools exist to solve these problems, including pure-frontend (non-PHP) tools like GruntJS. diff --git a/bundles/best_practices.rst b/bundles/best_practices.rst index b899ef928c7..18a833baf0b 100644 --- a/bundles/best_practices.rst +++ b/bundles/best_practices.rst @@ -9,8 +9,8 @@ There are two types of bundles: * Application-specific bundles: only used to build your application; * Reusable bundles: meant to be shared across many projects. -This article is all about how to structure your **reusable bundles** so that -they're easy to configure and extend. Many of these recommendations do not +This article is all about how to structure your **reusable bundles** to be +configurable and extendable. Many of these recommendations do not apply to application bundles because you'll want to keep those as simple as possible. For application bundles, just follow the practices shown throughout the guides. diff --git a/bundles/inheritance.rst b/bundles/inheritance.rst index 458d1cac92a..201b5f18fec 100644 --- a/bundles/inheritance.rst +++ b/bundles/inheritance.rst @@ -35,8 +35,8 @@ Then, register the third-party FOSUserBundle as the "parent" of your bundle:: } } -By making this simple change, you can now override several parts of the FOSUserBundle -simply by creating a file with the same name. +By making this small change, you can now override several parts of the FOSUserBundle +by creating a file with the same name. .. note:: @@ -82,8 +82,8 @@ original method, and change its functionality:: Overriding Resources: Templates, Routing, etc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Most resources can also be overridden, simply by creating a file in the same -location as your parent bundle. +Most resources can also be overridden by creating a file in the same location +as your parent bundle. For example, it's very common to need to override the FOSUserBundle's ``layout.html.twig`` template so that it uses your application's base layout. diff --git a/configuration/configuration_organization.rst b/configuration/configuration_organization.rst index 5c22dfc2572..9196ca09d02 100644 --- a/configuration/configuration_organization.rst +++ b/configuration/configuration_organization.rst @@ -6,7 +6,7 @@ How to Organize Configuration Files The default Symfony Standard Edition defines three :doc:`execution environments ` called -``dev``, ``prod`` and ``test``. An environment simply represents a way to +``dev``, ``prod`` and ``test``. An environment represents a way to execute the same codebase with different configurations. In order to select the configuration file to load for each environment, Symfony diff --git a/configuration/external_parameters.rst b/configuration/external_parameters.rst index 7c08b001a2d..579bc168a75 100644 --- a/configuration/external_parameters.rst +++ b/configuration/external_parameters.rst @@ -7,8 +7,7 @@ How to Set external Parameters in the Service Container In the article :doc:`/configuration`, you learned how to manage your application configuration. At times, it may benefit your application to store certain credentials outside of your project code. Database configuration is one such -example. The flexibility of the Symfony service container allows you to easily -do this. +example. The flexibility of the Symfony service container allows you to do this. Environment Variables --------------------- diff --git a/configuration/front_controllers_and_kernel.rst b/configuration/front_controllers_and_kernel.rst index 4b361724ca3..6e7cb6966d5 100644 --- a/configuration/front_controllers_and_kernel.rst +++ b/configuration/front_controllers_and_kernel.rst @@ -55,7 +55,7 @@ The front controller can be chosen by requesting URLs like: http://localhost/app_dev.php/some/path/... As you can see, this URL contains the PHP script to be used as the front -controller. You can use that to easily switch the front controller or use +controller. You can use that to switch the front controller or use a custom one by placing it in the ``web/`` directory (e.g. ``app_cache.php``). When using Apache and the `RewriteRule shipped with the Symfony Standard Edition`_, @@ -153,7 +153,7 @@ front controller to the ``AppKernel``'s constructor. This name can then be used in the :method:`Symfony\\Component\\HttpKernel\\KernelInterface::registerContainerConfiguration` method to decide which configuration files to load. -The Symfony Standard Edition's `AppKernel`_ class implements this method by simply +The Symfony Standard Edition's `AppKernel`_ class implements this method by loading the ``app/config/config_*environment*.yml`` file. You are, of course, free to implement this method differently if you need a more sophisticated way of loading your configuration. diff --git a/configuration/micro_kernel_trait.rst b/configuration/micro_kernel_trait.rst index f43a0f1c054..a28cb37e855 100644 --- a/configuration/micro_kernel_trait.rst +++ b/configuration/micro_kernel_trait.rst @@ -350,4 +350,4 @@ Then see webpage in browser: Hey, that looks a lot like a *traditional* Symfony application! You're right: the ``MicroKernelTrait`` *is* still Symfony: but you can control your structure and -features quite easily. +features with less boilerplate configuration and code. diff --git a/configuration/override_dir_structure.rst b/configuration/override_dir_structure.rst index e757cb87b2e..fac0d465b34 100644 --- a/configuration/override_dir_structure.rst +++ b/configuration/override_dir_structure.rst @@ -5,7 +5,7 @@ How to Override Symfony's default Directory Structure ===================================================== Symfony automatically ships with a default directory structure. You can -easily override this directory structure to create your own. The default +override this directory structure to create your own. The default directory structure is: .. code-block:: text @@ -140,9 +140,9 @@ Override the ``web`` Directory If you need to rename or move your ``web`` directory, the only thing you need to guarantee is that the path to the ``var`` directory is still correct -in your ``app.php`` and ``app_dev.php`` front controllers. If you simply -renamed the directory, you're fine. But if you moved it in some way, you -may need to modify these paths inside those files:: +in your ``app.php`` and ``app_dev.php`` front controllers. If you renamed +the directory, you're fine. But if you moved it in some way, you may need +to modify these paths inside those files:: require_once __DIR__.'/../path/to/app/autoload.php'; diff --git a/console/style.rst b/console/style.rst index 9f84081278c..7f8446fbb32 100644 --- a/console/style.rst +++ b/console/style.rst @@ -226,7 +226,7 @@ User Input Methods $io->ask('What is your name?'); - You can pass the default value as the second argument so the user can simply + You can pass the default value as the second argument so the user can hit the key to select that value:: $io->ask('Where are you from?', 'United States'); @@ -262,7 +262,7 @@ User Input Methods $io->confirm('Restart the web server?'); - You can pass the default value as the second argument so the user can simply + You can pass the default value as the second argument so the user can hit the key to select that value:: $io->confirm('Restart the web server?', true); @@ -273,7 +273,7 @@ User Input Methods $io->choice('Select the queue to analyze', ['queue1', 'queue2', 'queue3']); - You can pass the default value as the third argument so the user can simply + You can pass the default value as the third argument so the user can hit the key to select that value:: $io->choice('Select the queue to analyze', ['queue1', 'queue2', 'queue3'], 'queue1'); diff --git a/create_framework/http_foundation.rst b/create_framework/http_foundation.rst index 52d6950c0c3..9342d710576 100644 --- a/create_framework/http_foundation.rst +++ b/create_framework/http_foundation.rst @@ -52,7 +52,7 @@ As you can see for yourself, the simple code we had written first is not that simple anymore if we want to avoid PHP warnings/notices and make the code more secure. -Beyond security, this code is not even easily testable. Even if there is not +Beyond security, this code can be complex to test. Even if there is not much to test, it strikes me that writing unit tests for the simplest possible snippet of PHP code is not natural and feels ugly. Here is a tentative PHPUnit unit test for the above code:: @@ -126,10 +126,10 @@ containing the new requirement. .. sidebar:: Class Autoloading When installing a new dependency, Composer also generates a - ``vendor/autoload.php`` file that allows any class to be easily - `autoloaded`_. Without autoloading, you would need to require the file - where a class is defined before being able to use it. But thanks to - `PSR-4`_, we can just let Composer and PHP do the hard work for us. + ``vendor/autoload.php`` file that allows any class to be `autoloaded`_. + Without autoloading, you would need to require the file where a class + is defined before being able to use it. But thanks to `PSR-4`_, + we can just let Composer and PHP do the hard work for us. Now, let's rewrite our application by using the ``Request`` and the ``Response`` classes:: @@ -201,7 +201,7 @@ You can also simulate a request:: $request = Request::create('/index.php?name=Fabien'); -With the ``Response`` class, you can easily tweak the response:: +With the ``Response`` class, you can tweak the response:: $response = new Response(); diff --git a/deployment.rst b/deployment.rst index 4dd1e865024..9023d5e28a3 100644 --- a/deployment.rst +++ b/deployment.rst @@ -79,7 +79,7 @@ There are also tools to help ease the pain of deployment. Some of them have been specifically tailored to the requirements of Symfony. `EasyDeployBundle`_ - A Symfony bundle that adds easy deploy tools to your application. + A Symfony bundle that adds deploy tools to your application. `Deployer`_ This is another native PHP rewrite of Capistrano, with some ready recipes for diff --git a/email/cloud.rst b/email/cloud.rst index 07a998b7a8f..aacccaf6960 100644 --- a/email/cloud.rst +++ b/email/cloud.rst @@ -12,8 +12,8 @@ option. If setting up and maintaining your own reliable mail server causes you a headache there's a simple solution: Leverage the cloud to send your emails. -This article shows how easy it is to integrate -`Amazon's Simple Email Service (SES)`_ into Symfony. +This article shows how to integrate `Amazon's Simple Email Service (SES)`_ +into Symfony. .. note:: @@ -75,7 +75,7 @@ and complete the configuration with the provided ``username`` and ``password``: ]); The ``port`` and ``encryption`` keys are not present in the Symfony Standard -Edition configuration by default, but you can simply add them as needed. +Edition configuration by default, but you can add them if needed. And that's it, you're ready to start sending emails through the cloud! diff --git a/email/dev_environment.rst b/email/dev_environment.rst index 127e22867aa..7dbef8198f4 100644 --- a/email/dev_environment.rst +++ b/email/dev_environment.rst @@ -7,9 +7,9 @@ How to Work with Emails during Development When developing an application which sends email, you will often not want to actually send the email to the specified recipient during development. If you are using the SwiftmailerBundle with Symfony, you -can easily achieve this through configuration settings without having to -make any changes to your application's code at all. There are two main -choices when it comes to handling email during development: (a) disabling the +can achieve this through configuration settings without having to make +any changes to your application's code at all. There are two main choices +when it comes to handling email during development: (a) disabling the sending of email altogether or (b) sending all email to a specific address (with optional exceptions). @@ -51,7 +51,7 @@ will not be sent when you run tests, but will continue to be sent in the 'disable_delivery' => "true", ]); -If you'd also like to disable deliver in the ``dev`` environment, simply +If you'd also like to disable deliver in the ``dev`` environment, add this same configuration to the ``config_dev.yml`` file. .. _sending-to-a-specified-address: diff --git a/email/gmail.rst b/email/gmail.rst index c8b3362753b..3fed96e3009 100644 --- a/email/gmail.rst +++ b/email/gmail.rst @@ -5,8 +5,8 @@ How to Use Gmail to Send Emails =============================== During development, instead of using a regular SMTP server to send emails, you -might find using Gmail easier and more practical. The SwiftmailerBundle makes -it really easy. +might find using Gmail easier and more practical. You can achieve this with the +SwiftmailerBundle without much effort. In the development configuration file, change the ``transport`` setting to ``gmail`` and set the ``username`` and ``password`` to the Google credentials: @@ -105,7 +105,7 @@ In the development configuration file, change the ``transport`` setting to Redefining the Default Configuration Parameters ----------------------------------------------- -The ``gmail`` transport is simply a shortcut that uses the ``smtp`` transport +The ``gmail`` transport is a shortcut that uses the ``smtp`` transport and sets these options: ============== ================== diff --git a/email/testing.rst b/email/testing.rst index 0e21ff31344..58ba1cebd13 100644 --- a/email/testing.rst +++ b/email/testing.rst @@ -10,7 +10,7 @@ SwiftmailerBundle, which leverages the power of the `Swift Mailer`_ library. To functionally test that an email was sent, and even assert the email subject, content or any other headers, you can use :doc:`the Symfony Profiler `. -Start with an easy controller action that sends an email:: +Start with a controller action that sends an email:: public function sendEmailAction($name, \Swift_Mailer $mailer) { diff --git a/form/create_custom_field_type.rst b/form/create_custom_field_type.rst index 4ae7c294f6c..e409f6b6c2c 100644 --- a/form/create_custom_field_type.rst +++ b/form/create_custom_field_type.rst @@ -249,8 +249,8 @@ link for details), create a ``shipping_widget`` block to handle this: Using the Field Type -------------------- -You can now use your custom field type immediately, simply by creating a -new instance of the type in one of your forms:: +You can now use your custom field type by creating a new instance +of the type in one of your forms:: // src/AppBundle/Form/Type/OrderType.php namespace AppBundle\Form\Type; diff --git a/form/data_transformers.rst b/form/data_transformers.rst index 2218d0660ac..880845163b9 100644 --- a/form/data_transformers.rst +++ b/form/data_transformers.rst @@ -121,8 +121,7 @@ Harder Example: Transforming an Issue Number into an Issue Entity Say you have a many-to-one relation from the Task entity to an Issue entity (i.e. each Task has an optional foreign key to its related Issue). Adding a listbox with all possible issues could eventually get *really* long and take a long time to load. -Instead, you decide you want to add a textbox, where the user can simply enter the -issue number. +Instead, you decide you want to add a textbox, where the user can enter the issue number. Start by setting up the text field like normal:: @@ -300,9 +299,9 @@ know to pass your ``TaskType`` an instance of the ``IssueToNumberTransformer``. For more information about defining form types as services, read :doc:`register your form type as a service `. -Now, you can easily use your ``TaskType``:: +Now, you can use your ``TaskType``:: - // e.g. in a controller somewhere + // e.g. somewhere in a controller $form = $this->createForm(TaskType::class, $task); // ... diff --git a/form/direct_submit.rst b/form/direct_submit.rst index d53d6195f71..e5475a988de 100644 --- a/form/direct_submit.rst +++ b/form/direct_submit.rst @@ -4,8 +4,7 @@ How to Use the submit() Function to Handle Form Submissions =========================================================== -With the ``handleRequest()`` method, it is really easy to handle form -submissions:: +Handle the form submission with the ``handleRequest()`` method:: use Symfony\Component\HttpFoundation\Request; // ... diff --git a/form/dynamic_form_modification.rst b/form/dynamic_form_modification.rst index eef66d03de6..bc2d4ded53c 100644 --- a/form/dynamic_form_modification.rst +++ b/form/dynamic_form_modification.rst @@ -232,8 +232,7 @@ Using an event listener, your form might look like this:: The problem is now to get the current user and create a choice field that contains only this user's friends. -Luckily it is pretty easy to inject a service inside of the form. This can be -done in the constructor:: +The service can be injected into the form via its constructor:: use Symfony\Component\Security\Core\Security; // ... diff --git a/form/embedded.rst b/form/embedded.rst index a5b000727b3..edc20e4a57c 100644 --- a/form/embedded.rst +++ b/form/embedded.rst @@ -6,8 +6,8 @@ How to Embed Forms Often, you'll want to build a form that will include fields from many different objects. For example, a registration form may contain data belonging to -a ``User`` object as well as many ``Address`` objects. Fortunately, this -is easy and natural with the Form component. +a ``User`` object as well as many ``Address`` objects. Fortunately this can +be achieved by the Form component. .. _forms-embedding-single-object: diff --git a/form/events.rst b/form/events.rst index 380db9d1eca..325f25c4816 100644 --- a/form/events.rst +++ b/form/events.rst @@ -11,7 +11,8 @@ Using form events, you may modify information or fields at different steps of the workflow: from the population of the form to the submission of the data from the request. -Registering an event listener is very easy using the Form component. +By utilizing the Symfony event system, event listeners can be registered to +your forms. For example, if you wish to register a function to the ``FormEvents::PRE_SUBMIT`` event, the following code lets you add a field, @@ -262,7 +263,7 @@ Event Listeners An event listener may be any type of valid callable. -Creating and binding an event listener to the form is very easy:: +Creating and binding an event listener to the form:: // ... diff --git a/form/form_collections.rst b/form/form_collections.rst index fa04ac38c8e..f7b75af4870 100644 --- a/form/form_collections.rst +++ b/form/form_collections.rst @@ -511,9 +511,8 @@ you will learn about next!). of the relationship is modified. The trick is to make sure that the single "Task" is set on each "Tag". - One easy way to do this is to add some extra logic to ``addTag()``, - which is called by the form type since ``by_reference`` is set to - ``false``:: + One way to do this is to add some extra logic to ``addTag()``, which + is called by the form type since ``by_reference`` is set to ``false``:: // src/AppBundle/Entity/Task.php diff --git a/form/form_customization.rst b/form/form_customization.rst index e5140506ce7..73121a1d366 100644 --- a/form/form_customization.rst +++ b/form/form_customization.rst @@ -12,9 +12,8 @@ templating engine. Form Rendering Basics --------------------- -Recall that the label, error and HTML widget of a form field can easily -be rendered by using the ``form_row()`` Twig function or the ``row`` PHP helper -method: +Recall that the label, error and HTML widget of a form field can be rendered +by using the ``form_row()`` Twig function or the ``row`` PHP helper method: .. code-block:: twig @@ -206,13 +205,13 @@ Form Theming in Twig When customizing the form field block in Twig, you have two options on *where* the customized form block can live: -+--------------------------------------+-----------------------------------+-------------------------------------------+ -| Method | Pros | Cons | -+======================================+===================================+===========================================+ -| Inside the same template as the form | Quick and easy | Can't be reused in other templates | -+--------------------------------------+-----------------------------------+-------------------------------------------+ -| Inside a separate template | Can be reused by many templates | Requires an extra template to be created | -+--------------------------------------+-----------------------------------+-------------------------------------------+ ++--------------------------------------+------------------------------------+------------------------------------------+ +| Method | Pros | Cons | ++======================================+====================================+==========================================+ +| Inside the same template as the form | No need for an extra template file | Can't be reused in other templates | ++--------------------------------------+------------------------------------+------------------------------------------+ +| Inside a separate template | Can be reused by many templates | Requires an extra template to be created | ++--------------------------------------+------------------------------------+------------------------------------------+ Both methods have the same effect but are better in different situations. diff --git a/form/type_guesser.rst b/form/type_guesser.rst index 489901b2bba..bc1f04b7b28 100644 --- a/form/type_guesser.rst +++ b/form/type_guesser.rst @@ -81,7 +81,7 @@ The ``TypeGuess`` constructor requires three options: ``VERY_HIGH_CONFIDENCE``. After all type guessers have been executed, the type with the highest confidence is used. -With this knowledge, you can easily implement the ``guessType()`` method of the +With this knowledge, you can implement the ``guessType()`` method of the ``PHPDocTypeGuesser``:: namespace AppBundle\Form\TypeGuesser; diff --git a/forms.rst b/forms.rst index 0596254d57e..56e08140f7a 100644 --- a/forms.rst +++ b/forms.rst @@ -10,8 +10,8 @@ Forms Do you prefer video tutorials? Check out the `Symfony Forms screencast series`_. Dealing with HTML forms is one of the most common - and challenging - tasks for -a web developer. Symfony integrates a Form component that makes dealing with -forms easy. In this article, you'll build a complex form from the ground up, +a web developer. Symfony integrates a Form component that helps you dealing +with forms. In this article, you'll build a complex form from the ground up, learning the most important features of the form library along the way. .. note:: @@ -61,8 +61,8 @@ going to need to build a form. But before you begin, first focus on the generic } This class is a "plain-old-PHP-object" because, so far, it has nothing -to do with Symfony or any other library. It's quite simply a normal PHP object -that directly solves a problem inside *your* application (i.e. the need to +to do with Symfony or any other library. It's a normal PHP object that +directly solves a problem inside *your* application (i.e. the need to represent a task in your application). Of course, by the end of this article, you'll be able to submit data to a ``Task`` instance (via an HTML form), validate its data and persist it to the database. diff --git a/frontend.rst b/frontend.rst index f19aeaa08ec..579329b228b 100644 --- a/frontend.rst +++ b/frontend.rst @@ -28,7 +28,8 @@ to solve the most common Webpack use cases. .. tip:: Encore is made by `Symfony`_ and works *beautifully* in Symfony applications. - But it can easily be used in any application... in any language! + But it can be used in any PHP application and even with other server side + programming languages! .. _encore-toc: diff --git a/frontend/assetic/asset_management.rst b/frontend/assetic/asset_management.rst index 748d6f2dbc5..d11b4f77492 100644 --- a/frontend/assetic/asset_management.rst +++ b/frontend/assetic/asset_management.rst @@ -160,7 +160,7 @@ To include JavaScript files, use the ``javascripts`` tag in any template: In this example, all files in the ``Resources/public/js/`` directory of the AppBundle will be loaded and served from a different location. The actual -rendered tag might simply look like: +rendered tag might look like: .. code-block:: html @@ -257,10 +257,10 @@ Combining Assets One feature of Assetic is that it will combine many files into one. This helps to reduce the number of HTTP requests, which is great for front-end performance. -It also allows you to maintain the files more easily by splitting them into -manageable parts. This can help with re-usability as you can easily split -project-specific files from those which can be used in other applications, -but still serve them as a single file: +It also allows you to maintain the files by splitting them into smaller, more +manageable parts. This can help with re-usability as you can split project-specific +files from those which can be used in other applications, but still serve them as a +single file: .. code-block:: html+twig diff --git a/frontend/assetic/yuicompressor.rst b/frontend/assetic/yuicompressor.rst index 0f6eb5820e7..3961887f781 100644 --- a/frontend/assetic/yuicompressor.rst +++ b/frontend/assetic/yuicompressor.rst @@ -14,7 +14,7 @@ How to Minify JavaScripts and Stylesheets with YUI Compressor Yahoo! provides an excellent utility for minifying JavaScripts and stylesheets so they travel over the wire faster, the `YUI Compressor`_. Thanks to Assetic, -you can take advantage of this tool very easily. +you can take advantage of this tool. Download the YUI Compressor JAR ------------------------------- diff --git a/frontend/encore/advanced-config.rst b/frontend/encore/advanced-config.rst index fa3c1685437..4f75b8671af 100644 --- a/frontend/encore/advanced-config.rst +++ b/frontend/encore/advanced-config.rst @@ -1,9 +1,9 @@ Advanced Webpack Config ======================= -Quite simply, Encore generates the Webpack configuration that's used in your +Summarized, Encore generates the Webpack configuration that's used in your ``webpack.config.js`` file. Encore doesn't support adding all of Webpack's -`configuration options`_, because many can be easily added on your own. +`configuration options`_, because many can be added on your own. For example, suppose you need to set `Webpack's watchOptions`_ setting. To do that, modify the config after fetching it from Encore: diff --git a/frontend/encore/cdn.rst b/frontend/encore/cdn.rst index f1bfddfcc48..d03753d6417 100644 --- a/frontend/encore/cdn.rst +++ b/frontend/encore/cdn.rst @@ -1,9 +1,8 @@ Using a CDN =========== -Are you deploying to a CDN? That's awesome :) - and configuring Encore for that is -easy. Once you've made sure that your built files are uploaded to the CDN, configure -it in Encore: +Are you deploying to a CDN? That's awesome :) Once you've made sure that your +built files are uploaded to the CDN, configure it in Encore: .. code-block:: diff diff --git a/logging/formatter.rst b/logging/formatter.rst index f5a0683c549..c40b506378e 100644 --- a/logging/formatter.rst +++ b/logging/formatter.rst @@ -3,9 +3,8 @@ How to Define a Custom Logging Formatter Each logging handler uses a ``Formatter`` to format the record before logging it. All Monolog handlers use an instance of -``Monolog\Formatter\LineFormatter`` by default but you can replace it -easily. Your formatter must implement -``Monolog\Formatter\FormatterInterface``. +``Monolog\Formatter\LineFormatter`` by default but you can replace it. +Your formatter must implement ``Monolog\Formatter\FormatterInterface``. For example, to use the built-in ``JsonFormatter``, register it as a service then configure your handler to use it: diff --git a/logging/monolog_email.rst b/logging/monolog_email.rst index 2a989655be8..37b06a33dc2 100644 --- a/logging/monolog_email.rst +++ b/logging/monolog_email.rst @@ -138,10 +138,10 @@ is then passed onto the ``deduplicated`` handler. set the ``action_level`` to ``error`` instead of ``critical``. See the code above for an example. -The ``deduplicated`` handler simply keeps all the messages for a request and -then passes them onto the nested handler in one go, but only if the records are +The ``deduplicated`` handler keeps all the messages for a request and then +passes them onto the nested handler in one go, but only if the records are unique over a given period of time (60 seconds by default). If the records are -duplicates they are simply discarded. Adding this handler reduces the amount of +duplicates they are discarded. Adding this handler reduces the amount of notifications to a manageable level, specially in critical failure scenarios. You can adjust the time period using the ``time`` option: diff --git a/logging/processors.rst b/logging/processors.rst index 70da931b02e..3ee02764060 100644 --- a/logging/processors.rst +++ b/logging/processors.rst @@ -5,7 +5,7 @@ Monolog allows you to process the record before logging it to add some extra data. A processor can be applied for the whole handler stack or only for a specific handler. -A processor is simply a callable receiving the record as its first argument. +A processor is a callable receiving the record as its first argument. Processors are configured using the ``monolog.processor`` DIC tag. See the :ref:`reference about it `. diff --git a/profiler/data_collector.rst b/profiler/data_collector.rst index 809aaa51b4c..7c4e7d5b773 100644 --- a/profiler/data_collector.rst +++ b/profiler/data_collector.rst @@ -166,8 +166,8 @@ block and set the value of two variables called ``icon`` and ``text``: Another solution is to define the images as SVG files. In addition to being - resolution-independent, these images can be easily embedded in the Twig - template or included from an external file to reuse them in several templates: + resolution-independent, these images can be embedded in the Twig template + or included from an external file to reuse them in several templates: .. code-block:: twig diff --git a/reference/constraints/Bic.rst b/reference/constraints/Bic.rst index 70e1ede1e11..57c0081b568 100644 --- a/reference/constraints/Bic.rst +++ b/reference/constraints/Bic.rst @@ -19,7 +19,7 @@ uniquely identify both financial and non-financial institutions. Basic Usage ----------- -To use the Bic validator, simply apply it to a property on an object that +To use the Bic validator, apply it to a property on an object that will contain a Business Identifier Code (BIC). .. configuration-block:: diff --git a/reference/constraints/Callback.rst b/reference/constraints/Callback.rst index 85c1ce4db30..71854cee1ee 100644 --- a/reference/constraints/Callback.rst +++ b/reference/constraints/Callback.rst @@ -3,9 +3,9 @@ Callback The purpose of the Callback constraint is to create completely custom validation rules and to assign any validation errors to specific fields -on your object. If you're using validation with forms, this means that you -can make these custom errors display next to a specific field, instead of -simply at the top of your form. +on your object. If you're using validation with forms, this means that +instead of displaying custom errors at the top of the form, you can +display them next to the field they apply to. This process works by specifying one or more *callback* methods, each of which will be called during the validation process. Each of those methods diff --git a/reference/constraints/CardScheme.rst b/reference/constraints/CardScheme.rst index 26784173e82..3dac6ce956a 100644 --- a/reference/constraints/CardScheme.rst +++ b/reference/constraints/CardScheme.rst @@ -20,7 +20,7 @@ a payment through a payment gateway. Basic Usage ----------- -To use the ``CardScheme`` validator, simply apply it to a property or method +To use the ``CardScheme`` validator, apply it to a property or method on an object that will contain a credit card number. .. configuration-block:: diff --git a/reference/constraints/Choice.rst b/reference/constraints/Choice.rst index f671e7a36dd..b69e58db32f 100644 --- a/reference/constraints/Choice.rst +++ b/reference/constraints/Choice.rst @@ -128,8 +128,7 @@ Supplying the Choices with a Callback Function You can also use a callback function to specify your options. This is useful if you want to keep your choices in some central location so that, for example, -you can easily access those choices for validation or for building a select -form element:: +you can access those choices for validation or for building a select form element:: // src/AppBundle/Entity/Author.php namespace AppBundle\Entity; diff --git a/reference/constraints/Iban.rst b/reference/constraints/Iban.rst index b4877f6c19f..6da89b75b09 100644 --- a/reference/constraints/Iban.rst +++ b/reference/constraints/Iban.rst @@ -20,7 +20,7 @@ borders with a reduced risk of propagating transcription errors. Basic Usage ----------- -To use the Iban validator, simply apply it to a property on an object that +To use the Iban validator, apply it to a property on an object that will contain an International Bank Account Number. .. configuration-block:: diff --git a/reference/constraints/Isbn.rst b/reference/constraints/Isbn.rst index 9522f209de5..293149c45c0 100644 --- a/reference/constraints/Isbn.rst +++ b/reference/constraints/Isbn.rst @@ -22,7 +22,7 @@ is either a valid ISBN-10 or a valid ISBN-13. Basic Usage ----------- -To use the ``Isbn`` validator, simply apply it to a property or method +To use the ``Isbn`` validator, apply it to a property or method on an object that will contain an ISBN. .. configuration-block:: diff --git a/reference/constraints/Luhn.rst b/reference/constraints/Luhn.rst index d89c2cc7b58..a3df0a7304d 100644 --- a/reference/constraints/Luhn.rst +++ b/reference/constraints/Luhn.rst @@ -19,7 +19,7 @@ card: before communicating with a payment gateway. Basic Usage ----------- -To use the Luhn validator, simply apply it to a property on an object that +To use the Luhn validator, apply it to a property on an object that will contain a credit card number. .. configuration-block:: diff --git a/reference/constraints/NotNull.rst b/reference/constraints/NotNull.rst index df91be24b24..75d0c0fd9cb 100644 --- a/reference/constraints/NotNull.rst +++ b/reference/constraints/NotNull.rst @@ -2,7 +2,7 @@ NotNull ======= Validates that a value is not strictly equal to ``null``. To ensure that -a value is simply not blank (not a blank string), see the :doc:`/reference/constraints/NotBlank` +a value is not blank (not a blank string), see the :doc:`/reference/constraints/NotBlank` constraint. +----------------+-----------------------------------------------------------------------+ diff --git a/reference/forms/types/collection.rst b/reference/forms/types/collection.rst index 71865153f57..8b06ee518fe 100644 --- a/reference/forms/types/collection.rst +++ b/reference/forms/types/collection.rst @@ -235,9 +235,9 @@ allow_delete If set to ``true``, then if an existing item is not contained in the submitted data, it will be correctly absent from the final array of items. This means -that you can implement a "delete" button via JavaScript which simply removes -a form element from the DOM. When the user submits the form, its absence -from the submitted data will mean that it's removed from the final array. +that you can implement a "delete" button via JavaScript which removes a form +element from the DOM. When the user submits the form, its absence from the +submitted data will mean that it's removed from the final array. For more information, see :ref:`form-collections-remove`. diff --git a/reference/forms/types/date.rst b/reference/forms/types/date.rst index 373c5e7b7b6..fd64e63a9b9 100644 --- a/reference/forms/types/date.rst +++ b/reference/forms/types/date.rst @@ -48,8 +48,8 @@ and can understand a number of different input formats via the `input`_ option. Basic Usage ----------- -This field type is highly configurable, but easy to use. The most important -options are ``input`` and ``widget``. +This field type is highly configurable. The most important options +are ``input`` and ``widget``. Suppose that you have a ``publishedAt`` field whose underlying date is a ``DateTime`` object. The following configures the ``date`` type for that diff --git a/reference/forms/types/dateinterval.rst b/reference/forms/types/dateinterval.rst index d37874e8f43..75ad7091a1d 100644 --- a/reference/forms/types/dateinterval.rst +++ b/reference/forms/types/dateinterval.rst @@ -56,8 +56,7 @@ or an array (see `input`_). Basic Usage ----------- -This field type is highly configurable, but easy to use. The most important -options are `input`_ and `widget`_. +This field type is highly configurable. The most important options are `input`_ and `widget`_. You can configure *a lot* of different options, including exactly *which* range options to show (e.g. don't show "months", but *do* show "days"):: diff --git a/reference/forms/types/options/error_mapping.rst.inc b/reference/forms/types/options/error_mapping.rst.inc index ce50f2f1126..5b1122dd5ab 100644 --- a/reference/forms/types/options/error_mapping.rst.inc +++ b/reference/forms/types/options/error_mapping.rst.inc @@ -26,12 +26,12 @@ Here are the rules for the left and the right side of the mapping: * The left side contains property paths; * If the violation is generated on a property or method of a class, its - path is simply ``propertyName``; + path is the ``propertyName``; * If the violation is generated on an entry of an ``array`` or ``ArrayAccess`` object, the property path is ``[indexName]``; * You can construct nested property paths by concatenating them, separating properties by dots. For example: ``addresses[work].matchingCityAndZipCode``; -* The right side contains simply the names of fields in the form. +* The right side contains the names of fields in the form. By default, errors for any property that is not mapped will bubble up to the parent form. You can use the dot (``.``) on the left side to map errors of all diff --git a/reference/forms/types/password.rst b/reference/forms/types/password.rst index b2491a31015..6506f4c8605 100644 --- a/reference/forms/types/password.rst +++ b/reference/forms/types/password.rst @@ -41,9 +41,8 @@ If set to true, the field will *always* render blank, even if the corresponding field has a value. When set to false, the password field will be rendered with the ``value`` attribute set to its true value only upon submission. -Put simply, if for some reason you want to render your password field -*with* the password value already entered into the box, set this to false -and submit the form. +If you want to render your password field *with* the password value already +entered into the box, set this to false and submit the form. Overridden Options ------------------ diff --git a/reference/forms/types/time.rst b/reference/forms/types/time.rst index 9636dc30ba0..75b9fd00c7f 100644 --- a/reference/forms/types/time.rst +++ b/reference/forms/types/time.rst @@ -49,8 +49,7 @@ stored as a ``DateTime`` object, a string, a timestamp or an array. Basic Usage ----------- -This field type is highly configurable, but easy to use. The most important -options are ``input`` and ``widget``. +The most important options are ``input`` and ``widget``. Suppose that you have a ``startTime`` field whose underlying time data is a ``DateTime`` object. The following configures the ``TimeType`` for that diff --git a/routing/optional_placeholders.rst b/routing/optional_placeholders.rst index 5fa7a81d31c..792dd0bce5e 100644 --- a/routing/optional_placeholders.rst +++ b/routing/optional_placeholders.rst @@ -121,7 +121,7 @@ be available inside your controller. Its value can be used to determine which set of blog posts to display for the given page. But hold on! Since placeholders are required by default, this route will -no longer match on simply ``/blog``. Instead, to see page 1 of the blog, +no longer match on ``/blog`` alone. Instead, to see page 1 of the blog, you'd need to use the URL ``/blog/1``! Since that's no way for a rich web app to behave, modify the route to make the ``{page}`` parameter optional. This is done by including it in the ``defaults`` collection: @@ -196,7 +196,7 @@ URL Route Parameters Of course, you can have more than one optional placeholder (e.g. ``/blog/{slug}/{page}``), but everything after an optional placeholder must be optional. For example, ``/{page}/blog`` is a valid path, but ``page`` will always be required - (i.e. simply ``/blog`` will not match this route). + (i.e. ``/blog`` will not match this route). .. tip:: diff --git a/security/entity_provider.rst b/security/entity_provider.rst index d09f765eaf9..ed393fe517e 100644 --- a/security/entity_provider.rst +++ b/security/entity_provider.rst @@ -337,7 +337,7 @@ Forbid Inactive Users (AdvancedUserInterface) If a User's ``isActive`` property is set to ``false`` (i.e. ``is_active`` is 0 in the database), the user will still be able to login to the site -normally. This is easily fixable. +normally. To exclude inactive users, change your ``User`` class to implement :class:`Symfony\\Component\\Security\\Core\\User\\AdvancedUserInterface`. diff --git a/security/impersonating_user.rst b/security/impersonating_user.rst index 95da6165606..c32555094a5 100644 --- a/security/impersonating_user.rst +++ b/security/impersonating_user.rst @@ -16,8 +16,8 @@ to understand a bug a user sees that you can't reproduce). server-side, but pre-authenticated information (``SSL_CLIENT_S_DN_Email``, ``REMOTE_USER`` or other) is sent in each request. -Impersonating the user can be easily done by activating the ``switch_user`` -firewall listener: +Impersonating the user can be done by activating the ``switch_user`` firewall +listener: .. configuration-block:: diff --git a/security/remember_me.rst b/security/remember_me.rst index 3524ac8f69c..4b4c6fe7d21 100644 --- a/security/remember_me.rst +++ b/security/remember_me.rst @@ -179,9 +179,9 @@ before accessing certain resources. For example, you might allow "remember me" users to see basic account information, but then require them to actually re-authenticate before modifying that information. -The Security component provides an easy way to do this. In addition to roles -explicitly assigned to them, users are automatically given one of the following -roles depending on how they are authenticated: +The Security component provides a way to do this. In addition to roles explicitly +assigned to them, users are automatically given one of the following roles depending +on how they are authenticated: ``IS_AUTHENTICATED_ANONYMOUSLY`` Automatically assigned to a user who is in a firewall protected part of the diff --git a/service_container/3.3-di-changes.rst b/service_container/3.3-di-changes.rst index a31e4e4e340..395f58f631b 100644 --- a/service_container/3.3-di-changes.rst +++ b/service_container/3.3-di-changes.rst @@ -531,9 +531,9 @@ Start by adding a ``_defaults`` section with ``autowire`` and ``autoconfigure``. # ... -This step is easy: you're already *explicitly* configuring all of your services. -So, ``autowire`` does nothing. You're also already tagging your services, so -``autoconfigure`` also doesn't change any existing services. +You're already *explicitly* configuring all of your services. So, ``autowire`` +does nothing. You're also already tagging your services, so ``autoconfigure`` +also doesn't change any existing services. You have not added ``public: false`` yet. That will come in a minute. diff --git a/service_container/autowiring.rst b/service_container/autowiring.rst index e16c2077b85..c37d9358ed7 100644 --- a/service_container/autowiring.rst +++ b/service_container/autowiring.rst @@ -162,7 +162,7 @@ Autowiring works by reading the ``Rot13Transformer`` *type-hint* in ``TwitterCli The autowiring system **looks for a service whose id exactly matches the type-hint**: so ``AppBundle\Util\Rot13Transformer``. In this case, that exists! When you configured the ``Rot13Transformer`` service, you used its fully-qualified class name as its -id. Autowiring isn't magic: it simply looks for a service whose id matches the type-hint. +id. Autowiring isn't magic: it looks for a service whose id matches the type-hint. If you :ref:`load services automatically `, each service's id is its class name. This is the main way to control autowiring. @@ -263,8 +263,7 @@ Working with Interfaces ----------------------- You might also find yourself type-hinting abstractions (e.g. interfaces) instead -of concrete classes as it makes it easy to replace your dependencies with other -objects. +of concrete classes as it replaces your dependencies with other objects. To follow this best practice, suppose you decide to create a ``TransformerInterface``:: @@ -368,7 +367,7 @@ Suppose you create a second class - ``UppercaseTransformer`` that implements If you register this as a service, you now have *two* services that implement the ``AppBundle\Util\TransformerInterface`` type. Autowiring subsystem can not decide -which one to use. Remember, autowiring isn't magic; it simply looks for a service +which one to use. Remember, autowiring isn't magic; it looks for a service whose id matches the type-hint. So you need to choose one by creating an alias from the type to the correct service id (see :ref:`autowiring-interface-alias`). diff --git a/service_container/lazy_services.rst b/service_container/lazy_services.rst index da91903ac05..26f830d1d25 100644 --- a/service_container/lazy_services.rst +++ b/service_container/lazy_services.rst @@ -85,8 +85,7 @@ same happens when calling ``Container::get()`` directly. The actual class will be instantiated as soon as you try to interact with the service (e.g. call one of its methods). -To check if your proxy works you can simply check the interface of the -received object:: +To check if your proxy works you can check the interface of the received object:: dump(class_implements($service)); // the output should include "ProxyManager\Proxy\LazyLoadingInterface" @@ -95,7 +94,7 @@ received object:: If you don't install the `ProxyManager bridge`_ and the `ocramius/proxy-manager`_, the container will just skip over the ``lazy`` - flag and simply instantiate the service as it would normally do. + flag and instantiate the service as it would normally do. Additional Resources -------------------- diff --git a/service_container/parent_services.rst b/service_container/parent_services.rst index b0172da052a..6bc926bd14b 100644 --- a/service_container/parent_services.rst +++ b/service_container/parent_services.rst @@ -162,8 +162,8 @@ Overriding Parent Dependencies ------------------------------ There may be times where you want to override what service is injected for -one child service only. You can override most settings by simply specifying it -in the child class: +one child service only. You can override most settings by specifying it in +the child class: .. configuration-block:: diff --git a/setup/new_project_svn.rst b/setup/new_project_svn.rst index c4e022bc736..f7f4a577913 100644 --- a/setup/new_project_svn.rst +++ b/setup/new_project_svn.rst @@ -21,8 +21,7 @@ to manage your project using `SVN`_ in a similar manner you would do with .. tip:: This is **a** method to tracking your Symfony project in a Subversion - repository. There are several ways to do and this one is simply one that - works. + repository. There are several ways to do and this one is one that works. The Subversion Repository ------------------------- diff --git a/validation/custom_constraint.rst b/validation/custom_constraint.rst index b5fcb3f17a5..3406529cd08 100644 --- a/validation/custom_constraint.rst +++ b/validation/custom_constraint.rst @@ -97,7 +97,7 @@ The ``addViolation()`` method call finally adds the violation to the context. Using the new Validator ----------------------- -Using custom validators is very easy, just as the ones provided by Symfony itself: +You can use custom validators just as the ones provided by Symfony itself: .. configuration-block::