| Total Complexity | 3 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | class EnvAuthProvider implements ProviderInterface, SetContextInterface |
||
| 19 | { |
||
| 20 | private string $context; |
||
| 21 | |||
| 22 | /** @var array<string, string> */ |
||
| 23 | private array $envAuth; |
||
| 24 | |||
| 25 | /** @param string $context */ |
||
| 26 | public function setContext($context): void |
||
| 27 | { |
||
| 28 | $this->context = $context; |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param array<string, string> $envAuth |
||
| 33 | * |
||
| 34 | * @EnvAuth |
||
| 35 | */ |
||
| 36 | #[EnvAuth] |
||
| 37 | public function __construct(array $envAuth) |
||
| 38 | { |
||
| 39 | $this->envAuth = $envAuth; |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * {@inheritdoc} |
||
| 44 | */ |
||
| 45 | public function get(): string |
||
| 51 | } |
||
| 52 | } |
||
| 53 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: