Skip to content

Commit

Permalink
Merge branch 'master' of github.com:signifly/laravel-shopify
Browse files Browse the repository at this point in the history
  • Loading branch information
pactode committed Mar 6, 2019
2 parents 0c220b4 + 01589ad commit 54013fa
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Http/Controllers/WebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ protected function buildWebhook(Request $request)

protected function getEventName(Webhook $webhook)
{
return 'laravel-shopify-webhook.' . str_replace('/', '-', $webhook->topic());
return 'laravel-shopify-webhook.'.str_replace('/', '-', $webhook->topic());
}
}
1 change: 1 addition & 0 deletions src/Providers/DefaultHandlerStackProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public function getHandlerStack() : HandlerStack
{
$handlerStack = HandlerStack::create();
$handlerStack->push(new RateLimiter($this->getRateLimitProvider()));

return $handlerStack;
}

Expand Down
9 changes: 5 additions & 4 deletions src/Providers/DefaultRateLimitProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(RateLimitCalculatorContract $calculator, string $pre
*/
public function getLastRequestTime()
{
return Cache::get($this->prefix . 'last_request_time');
return Cache::get($this->prefix.'last_request_time');
}

/**
Expand All @@ -35,7 +35,7 @@ public function getLastRequestTime()
*/
public function setLastRequestTime()
{
return Cache::forever($this->prefix . 'last_request_time', microtime(true));
return Cache::forever($this->prefix.'last_request_time', microtime(true));
}

/**
Expand Down Expand Up @@ -65,7 +65,7 @@ public function getRequestTime(RequestInterface $request)
*/
public function getRequestAllowance(RequestInterface $request)
{
return Cache::get($this->prefix . 'request_allowance', config('shopify.rate_limit.cycle'));
return Cache::get($this->prefix.'request_allowance', config('shopify.rate_limit.cycle'));
}

/**
Expand All @@ -76,7 +76,7 @@ public function getRequestAllowance(RequestInterface $request)
*/
public function setRequestAllowance(ResponseInterface $response)
{
Cache::forever($this->prefix . 'request_allowance', $this->calculateAllowanceFrom($response));
Cache::forever($this->prefix.'request_allowance', $this->calculateAllowanceFrom($response));
}

/**
Expand All @@ -93,6 +93,7 @@ protected function calculateAllowanceFrom(ResponseInterface $response)

if ($callLimitHeader) {
[$callsMade, $callsLimit] = explode('/', $callLimitHeader);

return $this->calculator->calculate($callsMade, $callsLimit);
}

Expand Down
2 changes: 1 addition & 1 deletion src/ShopifyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function boot()
{
$this->setupConfig($this->app);

/**
/*
* @todo Perhaps allow for options allowing a user to modify aspects of the route...?
*/
Route::macro('shopifyWebhooks', function () {
Expand Down
2 changes: 1 addition & 1 deletion tests/ExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class ExampleTest extends TestCase
{
/** @test */
function it_reaches_the_shopify_api()
public function it_reaches_the_shopify_api()
{
$shopify = $this->app->make(Shopify::class);

Expand Down

0 comments on commit 54013fa

Please sign in to comment.