Skip to content

Commit bc7da62

Browse files
johnkaryweaverryan
authored andcommitted
[Book][HTTP Foundation] Improve grammar and readability
1 parent 163be39 commit bc7da62

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

book/http_fundamentals.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Symfony is architected to match this reality.
145145
Requests and Responses in Symfony
146146
---------------------------------
147147

148-
PHP comes packaged with an array variables and methods that allow the developer
148+
PHP comes packaged with array variables and methods that allow the developer
149149
to understand each request and send a response. For request information,
150150
PHP prepares superglobal variables such as ``$_SERVER`` and ``$_GET``.
151151
Recall that each raw request is simply an HTTP-formatted block of text.
@@ -221,8 +221,8 @@ The Journey from the Request to the Response
221221
We know now that the end goal of any application is to use the HTTP
222222
request to create and return the appropriate HTTP response. Symfony provides
223223
``Request`` and ``Response`` classes that allow this to be done through
224-
an object-oriented interface. Though, so far, we're only leveraging a small
225-
piece of Symfony, we already have the tools to write a simple application!
224+
an object-oriented interface. So far, we're only leveraging a small
225+
piece of Symfony. But we already have the tools to write a simple application!
226226
Let's dive in:
227227

228228
.. code-block:: php
@@ -241,14 +241,14 @@ Let's dive in:
241241
$response->send();
242242
243243
In this simple example, the application correctly processes the request and
244-
returns an appropriate response. From a very technical standpoint, then, our
244+
returns an appropriate response. From a very technical standpoint, our
245245
application does exactly what it should.
246246

247247
An Application without a Framework
248248
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
249249

250250
But what if the application needs to grow? Imagine this same application if it
251-
were forced now to handle hundreds or even thousands of different pages! In
251+
were now forced to handle hundreds or even thousands of different pages! In
252252
order to keep things maintainable (i.e. not all in one file), we'd need to do
253253
some reorganization. For starters, we might move the work of creating the
254254
``Response`` into a set of different functions. These functions are commonly
@@ -280,7 +280,8 @@ known as *controllers* and allow us to further organize our code::
280280
Next, our growing application still contains a long ``if`` ``elseif`` block
281281
that routes the creation of the ``Response`` object to a different controller
282282
(i.e. PHP method). We might consider building a configuration-based routing
283-
system that maps each request (by URI and HTTP method) to a specific controller.
283+
system that maps each request to a specific controller based on the URI and
284+
HTTP method of the request.
284285

285286
Obvious or not, the application is beginning to spin out of control. Recall
286287
that the goal of any application is to apply the custom application logic and
@@ -309,15 +310,15 @@ for use.
309310
Introducing the Symfony Kernel
310311
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
311312

312-
Symfony is based around a ``Kernel`` object whose only job is to facilitate
313+
Symfony is based around a ``Kernel`` object whose single responsibility is to facilitate
313314
the journey from the ``Request`` object to the final ``Response`` object.
314315
The ``Kernel`` is what handles each request and actually executes your application
315316
code.
316317

317-
The "application code" that's executed by the ``Kernel`` is called a "controller",
318+
The "application code" executed by the ``Kernel`` is called a "controller",
318319
a special term for what's actually a basic PHP callable (most commonly,
319320
an object method). The controller is where your application code lives -
320-
it's where you create the final ``Response`` object. The Kernel works by
321+
it's where you create the final ``Response`` object. The ``Kernel`` works by
321322
determining and then calling a "Controller" for each request:
322323

323324
.. code-block:: text
@@ -384,7 +385,7 @@ In reality, everything we've talked about so far (the ``Request``, ``Response``,
384385
used by Symfony. In fact, each feature in Symfony2 belongs to one of over
385386
twenty independent libraries (called the "Symfony Components")! Even if you
386387
decided to build your own PHP framework (an unwise idea), you could use the
387-
Symfony2 Components as the building blocks for many layers of functionality.
388+
Symfony Components as the building blocks for many layers of functionality.
388389
And if you do use Symfony2, but need to replace a component entirely, you have
389390
the ability to do that. Symfony2 is decoupled and relies on interface-driven
390391
dependency injection. In other words, the developer has complete control.
@@ -395,7 +396,7 @@ a PHP framework that accomplishes two distinct tasks:
395396
#. Provides a selection of components (i.e. the Symfony2 Components) and
396397
third-party libraries.
397398

398-
#. Provides sensible configuration that ties everything together nicely.
399+
#. Provides sensible configuration that nicely ties everything together.
399400

400401
The goal of the framework is to integrate many independent tools in order
401402
to provide a consistent experience for the developer. Even the framework

0 commit comments

Comments
 (0)