Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 006a29d

Browse filesBrowse files
committed
Merge branch '5.3' into 5.4
* 5.3: Update page_creation.rst Corrected typo in notifier.rst [ExpressionLanguage] Remove array element Document PHP attribute naming convention Rewording when an exception is thrown
2 parents f801108 + c661fb2 commit 006a29d
Copy full SHA for 006a29d

File tree

Expand file treeCollapse file tree

5 files changed

+19
-19
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+19
-19
lines changed

‎components/expression_language/syntax.rst

Copy file name to clipboardExpand all lines: components/expression_language/syntax.rst
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ Examples::
200200
'life == everything',
201201
[
202202
'life' => 10,
203-
'universe' => 10,
204203
'everything' => 22,
205204
]
206205
);
@@ -209,7 +208,6 @@ Examples::
209208
'life > everything',
210209
[
211210
'life' => 10,
212-
'universe' => 10,
213211
'everything' => 22,
214212
]
215213
);

‎contributing/code/standards.rst

Copy file name to clipboardExpand all lines: contributing/code/standards.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ Naming Conventions
220220

221221
* Suffix exceptions with ``Exception``;
222222

223+
* Prefix PHP attributes with ``As`` where applicable (e.g. ``#[AsCommand]``
224+
instead of ``#[Command]``, but ``#[When]`` is kept as-is);
225+
223226
* Use UpperCamelCase for naming PHP files (e.g. ``EnvVarProcessor.php``) and
224227
snake case for naming Twig templates and web assets (``section_layout.html.twig``,
225228
``index.scss``);

‎http_client.rst

Copy file name to clipboardExpand all lines: http_client.rst
+10-11Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,20 +1063,19 @@ There are three types of exceptions, all of which implement the
10631063
are thrown when a content-type cannot be decoded to the expected representation.
10641064

10651065
When the HTTP status code of the response is in the 300-599 range (i.e. 3xx,
1066-
4xx or 5xx) your code is expected to handle it. If you don't do that, the
1067-
``getHeaders()``, ``getContent()`` and ``toArray()`` methods throw an appropriate exception, which will
1068-
implement the :class:`Symfony\\Contracts\\HttpClient\\Exception\\HttpExceptionInterface`::
1066+
4xx or 5xx), the ``getHeaders()``, ``getContent()`` and ``toArray()`` methods
1067+
throw an appropriate exception, all of which implement the
1068+
:class:`Symfony\\Contracts\\HttpClient\\Exception\\HttpExceptionInterface`.
10691069

1070-
// the response of this request will be a 403 HTTP error
1071-
$response = $client->request('GET', 'https://httpbin.org/status/403');
1070+
To opt-out from this exception and deal with 300-599 status codes on your own,
1071+
pass ``false`` as the optional argument to every call of those methods,
1072+
e.g. ``$response->getHeaders(false);``.
10721073

1073-
// this code results in a Symfony\Component\HttpClient\Exception\ClientException
1074-
// because it doesn't check the status code of the response
1075-
$content = $response->getContent();
1074+
If you do not call any of these 3 methods at all, the exception will still be thrown
1075+
when the ``$response`` object is destructed.
10761076

1077-
// pass FALSE as the optional argument to not throw an exception and return
1078-
// instead the original response content (even if it's an error message)
1079-
$content = $response->getContent(false);
1077+
Calling ``$response->getStatusCode()`` is enough to disable this behavior
1078+
(but then don't miss checking the status code yourself).
10801079

10811080
While responses are lazy, their destructor will always wait for headers to come
10821081
back. This means that the following request *will* complete; and if e.g. a 404

‎notifier.rst

Copy file name to clipboardExpand all lines: notifier.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ The
705705
:class:`Symfony\\Component\\Notifier\\Notification\\SmsNotificationInterface`
706706
and
707707
:class:`Symfony\\Component\\Notifier\\Notification\\EmailNotificationInterface`
708-
also exists to modify messages send to those channels.
708+
also exists to modify messages sent to those channels.
709709

710710
Disabling Delivery
711711
------------------

‎page_creation.rst

Copy file name to clipboardExpand all lines: page_creation.rst
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ If you see a lucky number being printed back to you, congratulations! But before
8181
you run off to play the lottery, check out how this works. Remember the two steps
8282
to creating a page?
8383

84+
#. *Create a controller and a method*: This is a function where *you* build the page and ultimately
85+
return a ``Response`` object. You'll learn more about :doc:`controllers </controller>`
86+
in their own section, including how to return JSON responses;
87+
8488
#. *Create a route*: In ``config/routes.yaml``, the route defines the URL to your
8589
page (``path``) and what ``controller`` to call. You'll learn more about :doc:`routing </routing>`
86-
in its own section, including how to make *variable* URLs;
87-
88-
#. *Create a controller*: This is a function where *you* build the page and ultimately
89-
return a ``Response`` object. You'll learn more about :doc:`controllers </controller>`
90-
in their own section, including how to return JSON responses.
90+
in its own section, including how to make *variable* URLs.
9191

9292
.. _annotation-routes:
9393

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.