@@ -31,6 +31,6 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function waitTime() |
| 33 | 33 | { |
| 34 | - return (int) $this->reset - time() + 5; /* we add 5 secs for safety !*/ |
|
| 34 | + return (int)$this->reset - time() + 5; /* we add 5 secs for safety !*/ |
|
| 35 | 35 | } |
| 36 | 36 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | public function boot() |
| 13 | 13 | { |
| 14 | 14 | $this->publishes([ |
| 15 | - __DIR__.'/../config/twit.php' => config_path('twit.php'), |
|
| 15 | + __DIR__ . '/../config/twit.php' => config_path('twit.php'), |
|
| 16 | 16 | ]); |
| 17 | 17 | } |
| 18 | 18 | |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function register() |
| 23 | 23 | { |
| 24 | - $this->mergeConfigFrom(__DIR__.'/../config/twit.php', 'twit'); |
|
| 24 | + $this->mergeConfigFrom(__DIR__ . '/../config/twit.php', 'twit'); |
|
| 25 | 25 | |
| 26 | - $this->app->singleton(TwitApps::class, function ($app) { |
|
| 26 | + $this->app->singleton(TwitApps::class, function($app) { |
|
| 27 | 27 | return new TwitApps($app['config']['twit']['apps']); |
| 28 | 28 | }); |
| 29 | 29 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | public function send() |
| 71 | 71 | { |
| 72 | 72 | // No tolorate callback ? |
| 73 | - if (! $this->tolerateTimeoutCallback) { |
|
| 73 | + if (!$this->tolerateTimeoutCallback) { |
|
| 74 | 74 | return $this->execute(); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | try { |
| 79 | 79 | return $this->execute(); |
| 80 | 80 | } catch (\Exception $e) { |
| 81 | - if (! str_contains($e->getMessage(), 'Operation timed out')) { |
|
| 81 | + if (!str_contains($e->getMessage(), 'Operation timed out')) { |
|
| 82 | 82 | throw $e; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | public function __construct($apps) |
| 16 | 16 | { |
| 17 | - $this->pool = collect($apps)->map(function ($config, $key) { |
|
| 17 | + $this->pool = collect($apps)->map(function($config, $key) { |
|
| 18 | 18 | return new TwitApp($key, $config); |
| 19 | 19 | }); |
| 20 | 20 | } |
@@ -22,11 +22,11 @@ discard block |
||
| 22 | 22 | /** @return TwitApp */ |
| 23 | 23 | public function getAvailable() |
| 24 | 24 | { |
| 25 | - $this->current = $this->pool->first(function (TwitApp $app) { |
|
| 25 | + $this->current = $this->pool->first(function(TwitApp $app) { |
|
| 26 | 26 | return $app->available(); |
| 27 | 27 | }); |
| 28 | 28 | |
| 29 | - if (! $this->current) { |
|
| 29 | + if (!$this->current) { |
|
| 30 | 30 | // We will return the first one to get the rate limits so we can sleep |
| 31 | 31 | // and wait for reset |
| 32 | 32 | $this->current = $this->pool->get(0); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | public function waitTime() |
| 39 | 39 | { |
| 40 | - $waitTime = $this->pool->map(function (TwitApp $app) { |
|
| 40 | + $waitTime = $this->pool->map(function(TwitApp $app) { |
|
| 41 | 41 | if ($app->rateLimits) { |
| 42 | 42 | return $app->rateLimits->waitTime(); |
| 43 | 43 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public function resetRateLimits() |
| 50 | 50 | { |
| 51 | - $this->pool->each(function (TwitApp $app) { |
|
| 51 | + $this->pool->each(function(TwitApp $app) { |
|
| 52 | 52 | return $app->rateLimits = null; |
| 53 | 53 | }); |
| 54 | 54 | } |