diff --git a/src/Client.php b/src/Client.php index d7be436..cccdca9 100644 --- a/src/Client.php +++ b/src/Client.php @@ -64,14 +64,14 @@ public function get(): array } /** - * @return Company + * @return Company|null * @throws Exceptions\LimitExceeded * @throws Exceptions\RequestFailed * @throws Exceptions\ResponseFailed */ - public function first(): Company + public function first(): ?Company { $results = Http::call($this->cifs); - return new Company(new Parser($results[0])); + return $results[0] ? new Company(new Parser($results[0])) : null; } }