Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9b6a012

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

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
@@ -1656,26 +1656,24 @@ Let's say you want to instantiate a class with the following constructor,
16561656
that requires HTTPlug dependencies::
16571657

16581658
use Http\Client\HttpClient;
1659-
use Http\Message\RequestFactory;
16601659
use Http\Message\StreamFactory;
16611660

16621661
class SomeSdk
16631662
{
16641663
public function __construct(
16651664
HttpClient $httpClient,
1666-
RequestFactory $requestFactory,
16671665
StreamFactory $streamFactory
16681666
)
16691667
// [...]
16701668
}
16711669

1672-
Because :class:`Symfony\\Component\\HttpClient\\HttplugClient` implements the
1673-
three interfaces, you can use it this way::
1670+
Because :class:`Symfony\\Component\\HttpClient\\HttplugClient` implements these
1671+
interfaces,you can use it this way::
16741672

16751673
use Symfony\Component\HttpClient\HttplugClient;
16761674

16771675
$httpClient = new HttplugClient();
1678-
$apiClient = new SomeSdk($httpClient, $httpClient, $httpClient);
1676+
$apiClient = new SomeSdk($httpClient, $httpClient);
16791677

16801678
If you'd like to work with promises, :class:`Symfony\\Component\\HttpClient\\HttplugClient`
16811679
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)