Use procedural code for example snippet

This commit is contained in:
Stefan Blanke 2020-10-12 17:37:44 +02:00
parent a34302c88a
commit 362f895668

View file

@ -89,19 +89,8 @@ fetch("http://localhost:8080", requestOptions)
* `PHP` (Symfony HttpClient)
```php
use Symfony\Contracts\HttpClient\HttpClientInterface;
$httpClient = HttpClient::create();
class XrechnungValidator
{
private $httpClient;
public function __construct(HttpClientInterface $httpClient)
{
$this->httpClient = $httpClient;
}
public function validate()
{
$response = $this->httpClient->request('POST', 'http://localhost:8080', [
'headers' => [
'Content-Type' => 'application/xml',
@ -110,8 +99,7 @@ class XrechnungValidator
]);
echo $response->getContent();
}
}
```
## Status codes