chore: code style
This commit is contained in:
@@ -6,21 +6,20 @@ use Illuminate\Support\Facades\Log;
|
||||
|
||||
class FallbackInterface
|
||||
{
|
||||
|
||||
protected string $latest_error;
|
||||
|
||||
public function __call($method, $arguments)
|
||||
{
|
||||
|
||||
$providers = explode(',', config('investbrain.provider', 'yahoo'));
|
||||
|
||||
|
||||
foreach ($providers as $provider) {
|
||||
|
||||
$provider = trim($provider);
|
||||
|
||||
try {
|
||||
|
||||
if (!in_array($provider, array_keys(config('investbrain.interfaces', [])))) {
|
||||
if (! in_array($provider, array_keys(config('investbrain.interfaces', [])))) {
|
||||
|
||||
throw new \Exception("Provider [{$provider}] is not a valid market data interface.");
|
||||
}
|
||||
@@ -30,7 +29,7 @@ class FallbackInterface
|
||||
return app()->make($provider_class_name)->$method(...$arguments);
|
||||
|
||||
} catch (\Throwable $e) {
|
||||
|
||||
|
||||
$this->latest_error = $e->getMessage();
|
||||
|
||||
Log::warning("Failed calling method {$method} ({$provider}): {$this->latest_error}");
|
||||
|
||||
Reference in New Issue
Block a user