@@ -82,7 +82,7 @@ Use Environment Variables for Infrastructure Configuration
8282~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8383
8484The values of these options change from one machine to another (e.g. from your
85- development machine to the production server) but they don't modify the
85+ development machine to the production server), but they don't modify the
8686application behavior.
8787
8888:ref: `Use env vars in your project <config-env-vars >` to define these options
@@ -93,7 +93,7 @@ and create multiple ``.env`` files to :ref:`configure env vars per environment <
9393Use Secrets for Sensitive Information
9494~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9595
96- When your application has sensitive configuration - like an API key - you should
96+ When your application has sensitive configuration, like an API key, you should
9797store those securely via :doc: `Symfony’s secrets management system </configuration/secrets >`.
9898
9999Use Parameters for Application Configuration
@@ -119,7 +119,7 @@ Then, use just one or two words to describe the purpose of the parameter:
119119
120120 # config/services.yaml
121121 parameters :
122- # don't do this: 'dir' is too generic and it doesn't convey any meaning
122+ # don't do this: 'dir' is too generic, and it doesn't convey any meaning
123123 app.dir : ' ...'
124124 # do this: short but easy to understand names
125125 app.contents_dir : ' ...'
@@ -164,7 +164,7 @@ InvoiceBundle, etc. However, a bundle is meant to be something that can be
164164reused as a stand-alone piece of software.
165165
166166If you need to reuse some feature in your projects, create a bundle for it (in a
167- private repository, to not make it publicly available). For the rest of your
167+ private repository, do not make it publicly available). For the rest of your
168168application code, use PHP namespaces to organize code instead of bundles.
169169
170170Use Autowiring to Automate the Configuration of Application Services
@@ -186,14 +186,14 @@ Services Should be Private Whenever Possible
186186those services via ``$container->get() ``. Instead, you will need to use proper
187187dependency injection.
188188
189- Use the YAML Format to Configure your Own Services
189+ Use the YAML Format to Configure your own Services
190190~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
191191
192192If you use the :ref: `default services.yaml configuration <service-container-services-load-example >`,
193193most services will be configured automatically. However, in some edge cases
194194you'll need to configure services (or parts of them) manually.
195195
196- YAML is the format recommended to configure services because it's friendly to
196+ YAML is the format recommended configuring services because it's friendly to
197197newcomers and concise, but Symfony also supports XML and PHP configuration.
198198
199199Use Attributes to Define the Doctrine Entity Mapping
@@ -228,13 +228,13 @@ important parts of your application.
228228
229229.. _best-practice-controller-annotations :
230230
231- Use Attributes or Annotations to Configure Routing, Caching and Security
231+ Use Attributes or Annotations to Configure Routing, Caching, and Security
232232~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
233233
234- Using attributes or annotations for routing, caching and security simplifies
234+ Using attributes or annotations for routing, caching, and security simplifies
235235configuration. You don't need to browse several files created with different
236- formats (YAML, XML, PHP): all the configuration is just where you need it and
237- it only uses one format.
236+ formats (YAML, XML, PHP): all the configuration is just where you require it,
237+ and it only uses one format.
238238
239239Don't Use Attributes to Configure the Controller Template
240240~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -271,7 +271,7 @@ Templates
271271Use Snake Case for Template Names and Variables
272272~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
273273
274- Use lowercase snake_case for template names, directories and variables (e.g.
274+ Use lowercase snake_case for template names, directories, and variables (e.g.
275275``user_profile `` instead of ``userProfile `` and ``product/edit_form.html.twig ``
276276instead of ``Product/EditForm.html.twig ``).
277277
@@ -289,7 +289,7 @@ Forms
289289Define your Forms as PHP Classes
290290~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
291291
292- Creating :ref: `forms in classes <creating-forms-in-classes >` allows to reuse
292+ Creating :ref: `forms in classes <creating-forms-in-classes >` allows reusing
293293them in different parts of the application. Besides, not creating forms in
294294controllers simplifies the code and maintenance of the controllers.
295295
@@ -301,7 +301,7 @@ button of a form used to both create and edit items should change from "Add new"
301301to "Save changes" depending on where it's used.
302302
303303Instead of adding buttons in form classes or the controllers, it's recommended
304- to add buttons in the templates. This also improves the separation of concerns,
304+ to add buttons in the templates. This also improves the separation of concerns
305305because the button styling (CSS class and other attributes) is defined in the
306306template instead of in a PHP class.
307307
@@ -323,7 +323,7 @@ Use a Single Action to Render and Process the Form
323323
324324:ref: `Rendering forms <rendering-forms >` and :ref: `processing forms <processing-forms >`
325325are two of the main tasks when handling forms. Both are too similar (most of the
326- times , almost identical), so it's much simpler to let a single controller action
326+ time , almost identical), so it's much simpler to let a single controller action
327327handle both.
328328
329329.. _best-practice-internationalization :
@@ -347,8 +347,8 @@ Use Keys for Translations Instead of Content Strings
347347~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
348348
349349Using keys simplifies the management of the translation files because you can
350- change the original contents in templates, controllers and services without
351- having to update all of the translation files.
350+ change the original contents in templates, controllers, and services without
351+ having to update all the translation files.
352352
353353Keys should always describe their *purpose * and *not * their location. For
354354example, if a form has a field with the label "Username", then a nice key
@@ -388,13 +388,13 @@ Web Assets
388388Use Webpack Encore to Process Web Assets
389389~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
390390
391- Web assets are things like CSS, JavaScript and image files that make the
391+ Web assets are things like CSS, JavaScript, and image files that make the
392392frontend of your site look and work great. `Webpack `_ is the leading JavaScript
393393module bundler that compiles, transforms and packages assets for usage in a browser.
394394
395395:doc: `Webpack Encore </frontend >` is a JavaScript library that gets rid of most
396396of Webpack complexity without hiding any of its features or distorting its usage
397- and philosophy. It was originally created for Symfony applications, but it works
397+ and philosophy. It was created for Symfony applications, but it works
398398for any application using any technology.
399399
400400Tests
@@ -452,7 +452,7 @@ public URL changes, users won't be able to browse it unless you set up a
452452redirection to the new URL.
453453
454454That's why it's recommended to use raw URLs in tests instead of generating them
455- from routes. Whenever a route changes, tests will fail and you'll know that
455+ from routes. Whenever a route changes, tests will fail, and you'll know that
456456you must set up a redirection.
457457
458458.. _`Symfony Demo` : https://github.com/symfony/demo
0 commit comments