10000 be keen to newcomers by OskarStark · Pull Request #11036 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

be keen to newcomers #11036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundles/extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bundles/override.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------
Expand Down
4 changes: 2 additions & 2 deletions components/debug.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions components/http_foundation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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::

Expand Down
2 changes: 1 addition & 1 deletion components/http_kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <component-http-kernel-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.

Expand Down
2 changes: 1 addition & 1 deletion components/stopwatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Alternatively, you can clone the `<https://github.com/symfony/stopwatch>`_ 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::
Expand Down
5 changes: 2 additions & 3 deletions components/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
2 changes: 1 addition & 1 deletion console/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
2 changes: 1 addition & 1 deletion console/request_context.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions create_framework/dependency_injection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions create_framework/event_dispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions create_framework/front_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down
7 changes: 3 additions & 4 deletions create_framework/http_kernel_httpkernel_class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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());

Expand Down
2 changes: 1 addition & 1 deletion create_framework/http_kernel_httpkernelinterface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 </http_cache>` support.

The ``HttpCache`` class implements a fully-featured reverse proxy, written in
Expand Down
2 changes: 1 addition & 1 deletion create_framework/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion create_framework/separation_of_concerns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion create_framework/unit_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
7 changes: 3 additions & 4 deletions http_cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion reference/constraints/Collection.rst
D96B
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion reference/constraints/IsNull.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <NotNull>`.
Expand Down
2 changes: 1 addition & 1 deletion reference/constraints/NotBlank.rst
Original file line number Diff line number Diff l 325D ine change
Expand Up @@ -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.

+----------------+------------------------------------------------------------------------+
Expand Down
11 changes: 5 additions & 6 deletions security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -685,8 +685,7 @@ Add Code to Deny Access
There are **two** ways to deny access to something:

#. :ref:`access_control in security.yml <security-authorization-access-control>`
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 <security-securing-controller>`.

Expand Down Expand Up @@ -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:

Expand All @@ -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::

// ...

Expand Down
2 changes: 1 addition & 1 deletion session/php_bridge.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion testing/profiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions validation/raw_values.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions validation/translations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <using-message-domains>`.

To start, suppose you've created a plain-old-PHP object that you need to
Expand Down
0