Skip to content

Commit

Permalink
CS: PSR1/2 & removing grumphp
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Jul 29, 2017
1 parent 19ed1ef commit 86e7320
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
12 changes: 9 additions & 3 deletions Repositories/Cache/CachePostDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public function latest($amount = 5)
{
return $this->cache
->tags([$this->entityName, 'global'])
->remember("{$this->locale}.{$this->entityName}.latest.{$amount}", $this->cacheTime,
->remember(
"{$this->locale}.{$this->entityName}.latest.{$amount}",
$this->cacheTime,
function () use ($amount) {
return $this->repository->latest($amount);
}
Expand All @@ -42,7 +44,9 @@ public function getPreviousOf($post)

return $this->cache
->tags([$this->entityName, 'global'])
->remember("{$this->locale}.{$this->entityName}.getPreviousOf.{$postId}", $this->cacheTime,
->remember(
"{$this->locale}.{$this->entityName}.getPreviousOf.{$postId}",
$this->cacheTime,
function () use ($post) {
return $this->repository->getPreviousOf($post);
}
Expand All @@ -60,7 +64,9 @@ public function getNextOf($post)

return $this->cache
->tags([$this->entityName, 'global'])
->remember("{$this->locale}.{$this->entityName}.getNextOf.{$postId}", $this->cacheTime,
->remember(
"{$this->locale}.{$this->entityName}.getNextOf.{$postId}",
$this->cacheTime,
function () use ($post) {
return $this->repository->getNextOf($post);
}
Expand Down
4 changes: 3 additions & 1 deletion Repositories/Cache/CacheTagDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public function findByName($name)
{
return $this->cache
->tags([$this->entityName, 'global'])
->remember("{$this->locale}.{$this->entityName}.findByName.{$name}", $this->cacheTime,
->remember(
"{$this->locale}.{$this->entityName}.findByName.{$name}",
$this->cacheTime,
function () use ($name) {
return $this->repository->findByName($name);
}
Expand Down
8 changes: 4 additions & 4 deletions Widgets/PostsWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ protected function data()
return ['postCount' => $this->post->all()->count()];
}

/**
* Get the widget type
* @return string
*/
/**
* Get the widget type
* @return string
*/
protected function options()
{
return [
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
"phpunit/phpunit": "~4.0",
"orchestra/testbench": "3.4.*",
"fzaninotto/faker": "~1.5",
"phpro/grumphp": "^0.9.1",
"friendsofphp/php-cs-fixer": "^1.11"
"friendsofphp/php-cs-fixer": "^2.4"
},
"autoload-dev": {
"psr-4": {
Expand Down
11 changes: 0 additions & 11 deletions grumphp.yml

This file was deleted.

0 comments on commit 86e7320

Please sign in to comment.