10
10
use Fingerprint \ServerAPI \Configuration ;
11
11
use GuzzleHttp \Psr7 \Request ;
12
12
use GuzzleHttp \RequestOptions ;
13
+ use RuntimeException ;
13
14
14
15
class FingerprintApi
15
16
{
@@ -37,25 +38,25 @@ public function __construct(
37
38
$ this ->config = $ config ?: new Configuration ();
38
39
}
39
40
40
- protected function getSDKVersion ()
41
+ protected function getSDKVersion (): string
41
42
{
42
43
$ string = file_get_contents (dirname (__FILE__ ) . "/../../composer.json " );
43
44
$ jsonData = json_decode ($ string , true );
44
45
45
46
return $ jsonData ['version ' ];
46
47
}
47
48
48
- protected function getEventURL ()
49
+ protected function getEventURL (): string
49
50
{
50
51
return $ this ->config ->getHost () . "/events/{request_id} " ;
51
52
}
52
53
53
- protected function getVisitsURL ()
54
+ protected function getVisitsURL (): string
54
55
{
55
56
return $ this ->config ->getHost () . "/visitors/{visitor_id} " ;
56
57
}
57
58
58
- protected function getClientOptions ()
59
+ protected function getClientOptions (): array
59
60
{
60
61
$ options = [
61
62
'headers ' => [
@@ -81,7 +82,7 @@ protected function getClientOptions()
81
82
if ($ this ->config ->getDebug ()) {
82
83
$ options [RequestOptions::DEBUG ] = fopen ($ this ->config ->getDebugFile (), 'a ' );
83
84
if (!$ options [RequestOptions::DEBUG ]) {
84
- throw new \ RuntimeException ('Failed to open the debug file: ' . $ this ->config ->getDebugFile ());
85
+ throw new RuntimeException ('Failed to open the debug file: ' . $ this ->config ->getDebugFile ());
85
86
}
86
87
}
87
88
0 commit comments