Issues (16)

src/Helpers/Bvn.php (2 issues)

Labels
Severity
1
<?php
2
3
namespace HopekellDev\Confirmident\Helpers;
4
5
use Illuminate\Support\Facades\Log;
0 ignored issues
show
The type Illuminate\Support\Facades\Log was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Illuminate\Support\Facades\Http;
0 ignored issues
show
The type Illuminate\Support\Facades\Http was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
/**
9
 * Confirmident's Identity Verification laravel package
10
 * @author Hope Ezenwa- Hopekell <[email protected]>
11
 * @version 1
12
 **/
13
class Bvn
14
{
15
16
    protected $apiKey;
17
    protected $baseUrl;
18
19
    /**
20
     * Construct
21
     */
22
    function __construct(String $apiKey, String $baseUrl)
23
    {
24
25
        $this->apiKey = $apiKey;
26
        $this->baseUrl = $baseUrl;
27
    }
28
29
        /**
30
     * BVN Verification
31
     *
32
     * @param string $bvn
33
     * @return array|null
34
     */
35
    public function verification(string $bvn): ?array
36
    {
37
        $response = Http::withHeaders([
38
            'api-key' => $this->apiKey,
39
            'Content-Type' => 'application/json',
40
        ])->post("$this->baseUrl/bvn_search", [
41
            'bvn' => $bvn,
42
        ]);
43
44
        return $response->json();
45
    }
46
47
}