| Total Complexity | 3 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class Validation |
||
| 8 | { |
||
| 9 | protected string $apiKey; |
||
| 10 | protected string $baseUrl; |
||
| 11 | |||
| 12 | public function __construct(string $apiKey, string $baseUrl) |
||
| 13 | { |
||
| 14 | $this->apiKey = $apiKey; |
||
| 15 | $this->baseUrl = $baseUrl; |
||
| 16 | } |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Validate ID - Instantly |
||
| 20 | * |
||
| 21 | * @param string $nin |
||
| 22 | * @return array|null |
||
| 23 | */ |
||
| 24 | public function validate(string $nin): ?array |
||
| 25 | { |
||
| 26 | $response = Http::withHeaders([ |
||
| 27 | 'Authorization' => "Bearer {$this->apiKey}", |
||
| 28 | 'Content-Type' => 'application/json', |
||
| 29 | ])->post("{$this->baseUrl}/val/", [ |
||
| 30 | 'number' => $nin, |
||
| 31 | ]); |
||
| 32 | |||
| 33 | return $response->json() ?? null; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Check validation status |
||
| 38 | * |
||
| 39 | * @param string $nin |
||
| 40 | * @return array|null |
||
| 41 | */ |
||
| 42 | public function validateStatus(string $nin): ?array |
||
| 52 | } |
||
| 53 | } |
||
| 54 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths