diff --git a/Repositories/Cache/CachePostDecorator.php b/Repositories/Cache/CachePostDecorator.php index 1a7e084..749685d 100644 --- a/Repositories/Cache/CachePostDecorator.php +++ b/Repositories/Cache/CachePostDecorator.php @@ -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); } @@ -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); } @@ -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); } diff --git a/Repositories/Cache/CacheTagDecorator.php b/Repositories/Cache/CacheTagDecorator.php index 4341ebe..af66515 100644 --- a/Repositories/Cache/CacheTagDecorator.php +++ b/Repositories/Cache/CacheTagDecorator.php @@ -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); } diff --git a/Widgets/PostsWidget.php b/Widgets/PostsWidget.php index 558d667..cb2caa4 100644 --- a/Widgets/PostsWidget.php +++ b/Widgets/PostsWidget.php @@ -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 [ diff --git a/composer.json b/composer.json index 9ae47b2..1f84c34 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/grumphp.yml b/grumphp.yml deleted file mode 100644 index 4acc97f..0000000 --- a/grumphp.yml +++ /dev/null @@ -1,11 +0,0 @@ -parameters: - git_dir: . - bin_dir: vendor/bin - stop_on_failure: true - tasks: - phpcsfixer: - config_file: .php_cs - composer: - file: ./composer.json - jsonlint: - ignore_patterns: []