fix: strongly type symbol for market data and quote
This commit is contained in:
@@ -28,17 +28,21 @@ class FinnhubMarketData implements MarketDataInterface
|
||||
public function exists(string $symbol): bool
|
||||
{
|
||||
|
||||
return $this->quote($symbol)->isNotEmpty();
|
||||
try {
|
||||
$this->quote($symbol);
|
||||
|
||||
return true;
|
||||
|
||||
} catch (\Throwable $e) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function quote(string $symbol): Quote
|
||||
{
|
||||
$quote = $this->client->quote($symbol);
|
||||
|
||||
if (empty($quote)) {
|
||||
return new Quote;
|
||||
}
|
||||
|
||||
$fundamental = cache()->remember(
|
||||
'fh-symbol-'.$symbol,
|
||||
1440,
|
||||
|
||||
Reference in New Issue
Block a user