Skip to content

Commit 0225889

Browse files
author
Ca-Jou
committed
spotted minor EN mistakes and coherence issues between the different chapters
1 parent 76d6493 commit 0225889

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

create_framework/dependency_injection.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Now, here is how you can register a custom listener in the front controller::
201201
->addMethodCall('addSubscriber', [new Reference('listener.string_response')])
202202
;
203203

204-
Beside describing your objects, the dependency injection container can also be
204+
Besides describing your objects, the dependency injection container can also be
205205
configured via parameters. Let's create one that defines if we are in debug
206206
mode or not::
207207

create_framework/event_dispatcher.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ version of this pattern:
2323
How does it work? The *dispatcher*, the central object of the event dispatcher
2424
system, notifies *listeners* of an *event* dispatched to it. Put another way:
2525
your code dispatches an event to the dispatcher, the dispatcher notifies all
26-
registered listeners for the event, and each listener do whatever it wants
26+
registered listeners for the event, and each listener does whatever it wants
2727
with the event.
2828

2929
As an example, let's create a listener that transparently adds the Google
@@ -45,6 +45,9 @@ the Response instance::
4545

4646
class Framework
4747
{
48+
49+
/* all properties are now declared as private, they were protected until this chapter -> either there is a good reason and it might be useful to explain this change, or there could be better coherence by keeping them protected *or* private in the entire book */
50+
4851
private $dispatcher;
4952
private $matcher;
5053
private $controllerResolver;

create_framework/front_controller.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ its sub-directories (only if needed -- see above tip).
132132
like ``$request = Request::create('/hello?name=Fabien');`` where the
133133
argument is the URL path you want to simulate.
134134

135-
Now that the web server always access the same script (``front.php``) for all
135+
Now that the web server always accesses the same script (``front.php``) for all
136136
pages, we can secure the code further by moving all other PHP files outside the
137137
web root directory:
138138

create_framework/http_foundation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ cases by yourself. Why not using a technology that already works?
273273
a look at the ``Symfony\Component\HttpFoundation`` API or read
274274
its dedicated :doc:`documentation </components/http_foundation>`.
275275

276-
Believe or not but we have our first framework. You can stop now if you want.
276+
Believe it or not but we have our first framework. You can stop now if you want.
277277
Using just the Symfony HttpFoundation component already allows you to write
278278
better and more testable code. It also allows you to write code faster as many
279279
day-to-day problems have already been solved for you.
@@ -282,7 +282,7 @@ As a matter of fact, projects like Drupal have adopted the HttpFoundation
282282
component; if it works for them, it will probably work for you. Don't reinvent
283283
the wheel.
284284

285-
I've almost forgot to talk about one added benefit: using the HttpFoundation
285+
I've almost forgotten to talk about one added benefit: using the HttpFoundation
286286
component is the start of better interoperability between all frameworks and
287287
`applications using it`_ (like `Symfony`_, `Drupal 8`_, `phpBB 3`_, `Laravel`_
288288
and `ezPublish 5`_, and `more`_).

create_framework/http_kernel_controller_resolver.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The move is pretty straightforward and makes a lot of sense as soon as you
3131
create more pages but you might have noticed a non-desirable side effect...
3232
The ``LeapYearController`` class is *always* instantiated, even if the
3333
requested URL does not match the ``leap_year`` route. This is bad for one main
34-
reason: performance wise, all controllers for all routes must now be
34+
reason: performance-wise, all controllers for all routes must now be
3535
instantiated for every request. It would be better if controllers were
3636
lazy-loaded so that only the controller associated with the matched route is
3737
instantiated.

create_framework/http_kernel_httpkernelinterface.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ Update your framework so that it implements this interface::
4646
}
4747
}
4848

49-
Even if this change looks not too complex, it brings us a lot! Let's talk about one of
50-
the most impressive one: transparent :doc:`HTTP caching </http_cache>` support.
49+
Even if this change doesn't look like much, it brings us a lot! Let's talk about one of
50+
the most impressive ones: transparent :doc:`HTTP caching </http_cache>` support.
5151

5252
The ``HttpCache`` class implements a fully-featured reverse proxy, written in
5353
PHP; it implements ``HttpKernelInterface`` and wraps another
@@ -64,6 +64,7 @@ PHP; it implements ``HttpKernelInterface`` and wraps another
6464
new HttpKernel\HttpCache\Store(__DIR__.'/../cache')
6565
);
6666

67+
/* $response variable used before and after this chapter -> keep it in this chapter for more global coherence? */
6768
$framework->handle($request)->send();
6869

6970
That's all it takes to add HTTP caching support to our framework. Isn't it

0 commit comments

Comments
 (0)