Skip to content

Commit

Permalink
refactor: add return for methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Orkuncakilkaya committed Jul 15, 2024
1 parent a3157a8 commit d62eac6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Api/FingerprintApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Fingerprint\ServerAPI\Configuration;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\RequestOptions;
use RuntimeException;

class FingerprintApi
{
Expand Down Expand Up @@ -37,25 +38,25 @@ public function __construct(
$this->config = $config ?: new Configuration();
}

protected function getSDKVersion()
protected function getSDKVersion(): string
{
$string = file_get_contents(dirname(__FILE__) . "/../../composer.json");
$jsonData = json_decode($string, true);

return $jsonData['version'];
}

protected function getEventURL()
protected function getEventURL(): string
{
return $this->config->getHost() . "/events/{request_id}";
}

protected function getVisitsURL()
protected function getVisitsURL(): string
{
return $this->config->getHost() . "/visitors/{visitor_id}";
}

protected function getClientOptions()
protected function getClientOptions(): array
{
$options = [
'headers' => [
Expand All @@ -81,7 +82,7 @@ protected function getClientOptions()
if ($this->config->getDebug()) {
$options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
if (!$options[RequestOptions::DEBUG]) {
throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
throw new RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
}
}

Expand Down

0 comments on commit d62eac6

Please sign in to comment.