| Total Complexity | 3 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | abstract class AbstractEndPointTransformerExtension implements ExtensionInterface, EndPointTransformerInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var ClientInterface|null |
||
| 15 | */ |
||
| 16 | private $client; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * {@inheritdoc} |
||
| 20 | */ |
||
| 21 | 33 | final public function configure(ClientInterface $client): void |
|
| 22 | { |
||
| 23 | 33 | $extension = $this->client === null ? $this : clone $this; |
|
| 24 | 33 | $extension->client = $client; |
|
| 25 | |||
| 26 | 33 | $client->endPoints()->register($extension); |
|
| 27 | 33 | } |
|
| 28 | |||
| 29 | /** |
||
| 30 | * Get the configured client |
||
| 31 | * |
||
| 32 | * @return ClientInterface |
||
| 33 | * |
||
| 34 | * @psalm-mutation-free |
||
| 35 | * |
||
| 36 | * @psalm-suppress InvalidNullableReturnType |
||
| 37 | * @psalm-suppress NullableReturnStatement |
||
| 38 | */ |
||
| 39 | 31 | final protected function client(): ClientInterface |
|
| 42 | } |
||
| 43 | } |
||
| 44 |