8000 Be keen to newcomers · symfony/symfony-docs@04d727d · GitHub
[go: up one dir, main page]

Skip to content

Commit 04d727d

Browse files
OskarStarkjaviereguiluz
authored andcommitted
Be keen to newcomers
1 parent 7d89756 commit 04d727d

File tree

27 files changed

+55
-58
lines changed

27 files changed

+55
-58
lines changed

best_practices/business-logic.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ post URL. Let's create a new ``Slugger`` class inside ``src/Utils/``::
5757
}
5858

5959
If you're using the :ref:`default services.yaml configuration <service-container-services-load-example>`,
60-
this class is auto-registered as a service whose ID is ``App\Utils\Slugger`` (or
61-
simply ``Slugger::class`` if the class is already imported in your code).
60+
this class is auto-registered as a service with the ID ``App\Utils\Slugger`` (to
61+
prevent against typos, import the class and write ``Slugger::class`` in your code).
6262

6363
.. best-practice::
6464

bundles/configuration.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Using the Bundle Extension
4848
--------------------------
4949

5050
Imagine you are creating a new bundle - AcmeSocialBundle - which provides
51-
integration with Twitter, etc. To make your bundle easy to use, you want to
52-
allow users to configure it with some configuration that looks like this:
51+
integration with Twitter. To make your bundle configurable to the user, you
52+
can add some configuration that looks like this:
5353

5454
.. configuration-block::
5555

components/dom_crawler.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The :class:`Symfony\\Component\\DomCrawler\\Crawler` class provides methods
3636
to query and manipulate HTML and XML documents.
3737

3838
An instance of the Crawler represents a set of :phpclass:`DOMElement` objects,
39-
which are basically nodes that you can traverse easily::
39+
which are basically nodes that you can traverse::
4040

4141
use Symfony\Component\DomCrawler\Crawler;
4242

components/expression_language/extending.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ or by using the second argument of the constructor::
127127
{
128128
public function __construct(CacheItemPoolInterface $parser = null, array $providers = [])
129129
{
130-
// prepends the default provider to let users override it easily
130+
// prepends the default provider to let users override it
131131
array_unshift($providers, new StringExpressionLanguageProvider());
132132

133133
parent::__construct($parser, $providers);

components/http_foundation/sessions.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ store it again::
226226
],
227227
];
228228

229-
So any processing of this might quickly get ugly, even simply adding a token to
230-
the array::
229+
So any processing of this might quickly get ugly, even adding a token to the array::
231230

232231
$tokens = $session->get('tokens');
233232
$tokens['c'] = $value;

components/http_kernel.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ This is a simplified overview of the request workflow in Symfony applications:
4747
#. The **browser** displays the **resource** to the **user**.
4848

4949
Typically, some sort of framework or system is built to handle all the repetitive
50-
tasks (e.g. routing, security, etc) so that a developer can easily build
51-
each *page* of the application. Exactly *how* these systems are built varies
52-
greatly. The HttpKernel component provides an interface that formalizes
53-
the process of starting with a request and creating the appropriate response.
54-
The component is meant to be the heart of any application or framework, no
55-
matter how varied the architecture of that system::
50+
tasks (e.g. routing, security, etc) so that a developer can build each *page* of
51+
the application. Exactly *how* these systems are built varies greatly. The HttpKernel
52+
component provides an interface that formalizes the process of starting with a
53+
request and creating the appropriate response. The component is meant to be the
54+
heart of any application or framework, no matter how varied the architecture of
55+
that system::
5656

5757
namespace Symfony\Component\HttpKernel;
5858

components/options_resolver.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,8 @@ Options without Default Values
522522
In some cases, it is useful to define an option without setting a default value.
523523
This is useful if you need to know whether or not the user *actually* set
524524
an option or not. For example, if you set the default value for an option,
525-
it's not possible to know whether the user passed this value or if it simply
526-
comes from the default::
525+
it's not possible to know whether the user passed this value or if it comes
526+
from the default::
527527

528528
// ...
529529
class Mailer

components/yaml/yaml_format.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ Comments can be added in YAML by prefixing them with a hash mark (``#``):
286286
287287
.. note::
288288

289-
Comments are simply ignored by the YAML parser and do not need to be
290-
indented according to the current level of nesting in a collection.
289+
Comments are ignored by the YAML parser and do not need to be indented
290+
according to the current level of nesting in a collection.
291291

292292
Explicit Typing
293293
---------------

configuration/environments.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ Every application is the combination of code and a set of configuration that
88
dictates how that code should function. The configuration may define the database
99
being used, if something should be cached or how verbose logging should be.
1010

11-
In Symfony, the idea of "environments" is the idea that the same codebase can be
12-
run using multiple different configurations. For example, the ``dev`` environment
13-
should use configuration that makes development easy and friendly, while the
14-
``prod`` environment should use a set of configuration optimized for speed.
11+
In Symfony, the idea of "environments" is that the same codebase can be run using
12+
multiple different configurations. For example, the ``dev`` environment should use
13+
configuration that makes development comfortable and friendly, while the ``prod``
14+
environment should use a set of configuration optimized for speed and security.
1515

1616
.. index::
1717
single: Environments; Configuration files

contributing/code/bc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ method signature.
2222

2323
Also, not every BC break has the same impact on application code. While some BC
2424
breaks require you to make significant changes to your classes or your
25-
architecture, others are fixed as easily as changing the name of a method.
25+
architecture, others are fixed by changing the name of a method.
2626

2727
That's why we created this page for you. The section "Using Symfony Code" will
2828
tell you how you can ensure that your application won't break completely when

contributing/code/conventions.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ Deprecations
8585
From time to time, some classes and/or methods are deprecated in the
8686
framework; that happens when a feature implementation cannot be changed
8787
because of backward compatibility issues, but we still want to propose a
88-
"better" alternative. In that case, the old implementation can simply be
89-
**deprecated**.
88+
"better" alternative. In that case, the old implementation can be **deprecated**.
9089

9190
A feature is marked as deprecated by adding a ``@deprecated`` phpdoc to
9291
relevant classes, methods, properties, ...::

contributing/code/experimental.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ All Symfony features benefit from our :doc:`Backward Compatibility Promise
55
</contributing/code/bc>` to give developers the confidence to upgrade to new
66
versions safely and more often.
77

8-
But sometimes, a new feature is controversial. Or finding a good API is not
9-
easy. In such cases, we prefer to gather feedback from real-world usage, adapt
8+
But sometimes, a new feature is controversial or you cannot find a convincing API.
9+
In such cases, we prefer to gather feedback from real-world usage, adapt
1010
the API, or remove it altogether. Doing so is not possible with a no BC-break
1111
approach.
1212

controller.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Controller
77
A controller is a PHP function you create that reads information from the
88
``Request`` object and creates and returns a ``Response`` object. The response could
99
be an HTML page, JSON, XML, a file download, a redirect, a 404 error or anything
10-
else you can dream up. The controller executes whatever arbitrary logic
11-
*your application* needs to render the content of a page.
10+
else. The controller executes whatever arbitrary logic *your application* needs
11+
to render the content of a page.
1212

1313
.. tip::
1414

doctrine/associations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ you.
398398
.. image:: /_images/doctrine/mapping_relations_proxy.png
399399
:align: center
400400

401-
What's important is the fact that you have easy access to the product's related
401+
What's important is the fact that you have access to the product's related
402402
category, but the category data isn't actually retrieved until you ask for
403403
the category (i.e. it's "lazily loaded").
404404

doctrine/dbal.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ How to Use Doctrine DBAL
1313

1414
The `Doctrine`_ Database Abstraction Layer (DBAL) is an abstraction layer that
1515
sits on top of `PDO`_ and offers an intuitive and flexible API for communicating
16-
with the most popular relational databases. In other words, the DBAL library
17-
makes it easy to execute queries and perform other database actions.
16+
with the most popular relational databases. The DBAL library allows you to write
17+
queries independently of your ORM models, e.g. for building reports or direct
18+
data manipulations.
1819

1920
.. tip::
2021

email.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ setting up a regular SMTP server. To do that, update the ``MAILER_URL`` of your
122122
# username is your full Gmail or Google Apps email address
123123
MAILER_URL=gmail://username:password@localhost
124124
125-
The ``gmail`` transport is simply a shortcut that uses the ``smtp`` transport,
126-
``ssl`` encryption, ``login`` auth mode and ``smtp.gmail.com`` host. If your app
127-
uses other encryption or auth mode, you must override those values
125+
The ``gmail`` transport is a shortcut that uses the ``smtp`` transport, ``ssl``
126+
encryption, ``login`` auth mode and ``smtp.gmail.com`` host. If your app uses
127+
other encryption or auth mode, you must override those values
128128
(:doc:`see mailer config reference </reference/configuration/swiftmailer>`):
129129

130130
.. code-block:: bash

http_cache/esi.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,6 @@ The ``render_esi`` helper supports two other useful options:
250250
``ignore_errors``
251251
If set to true, an ``onerror`` attribute will be added to the ESI with a value
252252
of ``continue`` indicating that, in the event of a failure, the gateway cache
253-
will simply remove the ESI tag silently.
253+
will remove the ESI tag silently.
254254

255255
.. _`ESI`: http://www.w3.org/TR/esi-lang

messenger/handler_results.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ buses are central pieces of the application. Read Martin Fowler's
3636
As queries are usually synchronous and expected to be handled once,
3737
getting the result from the handler is a common need.
3838

39-
To make this easy, you can leverage the ``HandleTrait`` in any class that has
40-
a ``$messageBus`` property::
39+
To avoid boilerplate code, you can leverage the ``HandleTrait`` in any class
40+
that has a ``$messageBus`` property::
4141

4242
// src/Action/ListItems.php
4343
namespace App\Action;

security.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ See :doc:`/security/securing_services`.
619619
Checking to see if a User is Logged In (IS_AUTHENTICATED_FULLY)
620620
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
621621

622-
If you *only* want to check if a user is simply logged in (you don't care about roles),
622+
If you *only* want to check if a user is logged in (you don't care about roles),
623623
you have two options. First, if you've given *every* user ``ROLE_USER``, you can
624624
just check for that role. Otherwise, you can use a special "attribute" in place
625625
of a role::

security/guard_authentication.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ Custom Authentication System with Guard (API Token Example)
66

77
Whether you need to build a traditional login form, an API token authentication system
88
or you need to integrate with some proprietary single-sign-on system, the Guard
9-
component can make it easy... and fun!
9+
component will be the right choice!
1010

1111
Guard authentication can be used to:
1212

1313
* :doc:`Build a Login Form </security/form_login_setup>`,
1414
* Create an API token authentication system (done on this page!)
1515
* `Social Authentication`_ (or use `HWIOAuthBundle`_ for a robust, but non-Guard solution)
1616

17-
or anything else you dream up. In this example, we'll build an API token authentication
17+
or anything else. In this example, we'll build an API token authentication
1818
system so we can learn more about Guard in detail.
1919

2020
Step 1) Prepare your User Class

service_container/service_subscribers_locators.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ provides an implementation for
380380
:class:`Symfony\\Component\\DependencyInjection\\ServiceSubscriberInterface`
381381
that looks through all methods in your class that have no arguments and a return
382382
type. It provides a ``ServiceLocator`` for the services of those return types.
383-
The service id is ``__METHOD__``. This allows you to easily add dependencies
384-
to your services based on type-hinted helper methods::
383+
The service id is ``__METHOD__``. This allows you to add dependencies to your
384+
services based on type-hinted helper methods::
385385

386386
// src/Service/MyService.php
387387
namespace App\Service;

templating.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ code.
2323
Templates
2424
---------
2525

26-
A template is simply a text file that can generate any text-based format
26+
A template is a text file that can generate any text-based format
2727
(HTML, XML, CSV, LaTeX ...). The most familiar type of template is a *PHP*
2828
template - a text file parsed by PHP that contains a mix of text and PHP code:
2929

@@ -386,10 +386,9 @@ the last part of the extension (e.g. ``.twig`` or ``.php``) specifies which
386386
of these two *engines* should be used. The first part of the extension,
387387
(e.g. ``.html``, ``.css``, etc) is the final format that the template will
388388
generate. Unlike the engine, which determines how Symfony parses the template,
389-
this is simply an organizational tactic used in case the same resource needs
390-
to be rendered as HTML (``index.html.twig``), XML (``index.xml.twig``),
391-
or any other format. For more information, read the :doc:`/templating/formats`
392-
section.
389+
this is an organizational tactic used in case the same resource needs to be
390+
rendered as HTML (``index.html.twig``), XML (``index.xml.twig``), or any other
391+
format. For more information, read the :doc:`/templating/formats` section.
393392

394393
.. index::
395394
single: Templating; Tags and helpers

templating/PHP.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ Next, enable the php engine:
6666
],
6767
]);
6868
69-
You can now render a PHP template instead of a Twig one simply by using the
70-
``.php`` extension in the template name instead of ``.twig``. The controller
71-
below renders the ``index.html.php`` template::
69+
You can now render a PHP template instead of a Twig one by using the ``.php``
70+
extension in the template name instead of ``.twig``. The controller below
71+
renders the ``index.html.php`` template::
7272

7373
// src/Controller/HelloController.php
7474

templating/formats.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ How to Work with Different Output Formats in Templates
66

77
Templates are a generic way to render content in *any* format. While in
88
most cases you'll use templates to render HTML content, a template can just
9-
as easily generate JavaScript, CSS, XML or any other format you can dream of.
9+
generate JavaScript, CSS, XML or any other format.
1010

1111
For example, the same "resource" is often rendered in several formats.
1212
To render an article index page in XML, include the format in the

templating/inheritance.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ Notice that this template extends the section template (``blog/layout.html.twig`
4747
which in turn extends the base application layout (``base.html.twig``). This is
4848
the common three-level inheritance model.
4949

50-
When building your application, you may choose to follow this method or simply
50+
When building your application, you may choose to follow this method or
5151
make each page template extend the base application template directly
5252
(e.g. ``{% extends 'base.html.twig' %}``). The three-template model is a
5353
best-practice method used by vendor bundles so that the base template for a
54-
bundle can be easily overridden to properly extend your application's base
55-
layout.
54+
bundle can be overridden to properly extend your application's base layout.

templating/render_without_controller.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ can do this without creating a controller:
5454
5555
return $routes;
5656
57-
The ``TemplateController`` will simply render whatever template you've passed as
58-
the ``template`` default value.
57+
The ``TemplateController`` will render whatever template you've passed as the
58+
``template`` default value.
5959

6060
You can also use this trick when rendering embedded controllers
6161
from within a template. But since the purpose of rendering a controller from

testing/database.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Suppose the class you want to test looks like this::
6767
}
6868

6969
Since the ``EntityManagerInterface`` gets injected into the class through the constructor,
70-
it's easy to pass a mock object within a test::
70+
you can pass a mock object within a test::
7171

7272
// tests/Salary/SalaryCalculatorTest.php
7373
namespace App\Tests\Salary;

0 commit comments

Comments
 (0)
0