Skip to content

Commit cd5ddb0

Browse files
committed
feat: added OptionsResolver
1 parent 3d62474 commit cd5ddb0

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
"php-http/discovery": "^1.19",
1919
"php-http/logger-plugin": "^1.3",
2020
"php-http/message": "^1.16",
21-
"programmatordev/yet-another-php-validator": "^0.6.0",
2221
"psr/cache": "^2.0 || ^3.0",
2322
"psr/http-client": "^1.0",
2423
"psr/http-factory": "^1.0",
2524
"psr/log": "^2.0 || ^3.0",
26-
"symfony/event-dispatcher": "^6.4"
25+
"symfony/event-dispatcher": "^6.4",
26+
"symfony/options-resolver": "^6.4"
2727
},
2828
"require-dev": {
2929
"monolog/monolog": "^3.5",

src/Api.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Psr\Http\Message\RequestInterface;
2121
use Psr\Http\Message\StreamInterface;
2222
use Symfony\Component\EventDispatcher\EventDispatcher;
23+
use Symfony\Component\OptionsResolver\OptionsResolver;
2324

2425
class Api
2526
{
@@ -41,10 +42,13 @@ class Api
4142

4243
private EventDispatcher $eventDispatcher;
4344

45+
private OptionsResolver $optionsResolver;
46+
4447
public function __construct()
4548
{
4649
$this->clientBuilder ??= new ClientBuilder();
4750
$this->eventDispatcher = new EventDispatcher();
51+
$this->optionsResolver = new OptionsResolver();
4852
}
4953

5054
/**

src/Builder/ClientBuilder.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public function addPlugin(Plugin $plugin, int $priority): self
8080
}
8181

8282
$this->plugins[$priority] = $plugin;
83-
8483
// sort plugins by priority (key) in descending order
8584
\krsort($this->plugins);
8685

0 commit comments

Comments
 (0)