8000 Merge branch '6.3' into 6.4 · symfony/symfony-docs@e5febf8 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

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 e5febf8

Browse files
committed
Merge branch '6.3' into 6.4
* 6.3: [HttpClient] Remove mentions to RequestFactory Fix a diff example in Page Creation article
2 parents d95143e + 9b6a012 commit e5febf8

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

http_client.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,26 +1661,24 @@ Let's say you want to instantiate a class with the following constructor,
16611661
that requires HTTPlug dependencies::
16621662

16631663
use Http\Client\HttpClient;
1664-
use Http\Message\RequestFactory;
16651664
use Http\Message\StreamFactory;
16661665

16671666
class SomeSdk
16681667
{
16691668
public function __construct(
16701669
HttpClient $httpClient,
1671-
RequestFactory $requestFactory,
16721670
StreamFactory $streamFactory
16731671
)
16741672
// [...]
16751673
}
16761674

1677-
Because :class:`Symfony\\Component\\HttpClient\\HttplugClient` implements the
1678-
three interfaces, you can use it this way::
1675+
Because :class:`Symfony\\Component\\HttpClient\\HttplugClient` implements these
1676+
interfaces,you can use it this way::
16791677

16801678
use Symfony\Component\HttpClient\HttplugClient;
16811679

16821680
$httpClient = new HttplugClient();
1683-
$apiClient = new SomeSdk($httpClient, $httpClient, $httpClient);
1681+
$apiClient = new SomeSdk($httpClient, $httpClient);
16841682

16851683
If you'd like to work with promises, :class:`Symfony\\Component\\HttpClient\\HttplugClient`
16861684
also implements the ``HttpAsyncClient`` interface. To use it, you need to install the

page_creation.rst

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,21 @@ so that the ``number()`` method is called when a user browses to it. This associ
6262
is defined with the ``#[Route]`` attribute (in PHP, `attributes`_ are used to add
6363
metadata to code):
6464

65-
.. configuration-block::
66-
67-
.. code-block:: php-attributes
65+
.. code-block:: diff
6866
69-
// src/Controller/LuckyController.php
67+
// src/Controller/LuckyController.php
7068
71-
// ...
72-
+ use Symfony\Component\Routing\Annotation\Route;
69+
// ...
70+
+ use Symfony\Component\Routing\Annotation\Route;
7371
74-
class LuckyController
75-
{
76-
+ #[Route('/lucky/number')]
77-
public function number(): Response
78-
{
79-
// this looks exactly the same
80-
}
81-
}
72+
class LuckyController
73+
{
74+
+ #[Route('/lucky/number')]
75+
public function number(): Response
76+
{
77+
// this looks exactly the same
78+
}
79+
}
8280
8381
That's it! If you are using Symfony web server, try it out by going to: http://localhost:8000/lucky/number
8482

0 commit comments

Comments
 (0)
0