Skip to content

Commit a253bb0

Browse files
authored
Merge pull request #79 from renoki-co/feature/3.x-cleanup
[3.x] Formatting
2 parents 5ad9752 + 36449d9 commit a253bb0

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
laravel:
2424
- 7.*
2525
- 8.*
26-
prefer:
26+
prefer:
2727
- 'prefer-lowest'
2828
- 'prefer-stable'
2929
include:

src/Traits/QueryCacheModule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function flushQueryCache(array $tags = []): bool
178178
}
179179

180180
foreach ($tags as $tag) {
181-
self::flushQueryCacheWithTag($tag);
181+
$this->flushQueryCacheWithTag($tag);
182182
}
183183

184184
return true;

src/Traits/QueryCacheable.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ protected static function getFlushQueryCacheObserver()
4646
return FlushQueryCacheObserver::class;
4747
}
4848

49+
/**
50+
* Set the base cache tags that will be present
51+
* on all queries.
52+
*
53+
* @return array
54+
*/
55+
protected function getCacheBaseTags(): array
56+
{
57+
return [
58+
(string) self::class,
59+
];
60+
}
61+
4962
/**
5063
* When invalidating automatically on update, you can specify
5164
* which tags to invalidate.
@@ -96,17 +109,4 @@ protected function newBaseQueryBuilder()
96109

97110
return $builder->cacheBaseTags($this->getCacheBaseTags());
98111
}
99-
100-
/**
101-
* Set the base cache tags that will be present
102-
* on all queries.
103-
*
104-
* @return array
105-
*/
106-
protected function getCacheBaseTags(): array
107-
{
108-
return [
109-
(string) self::class,
110-
];
111-
}
112112
}

tests/MethodsTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ public function test_multiple_append_cache_tags()
153153
public function test_append_cache_tags_with_sub_query()
154154
{
155155
$user = factory(User::class)->create();
156+
156157
factory(Post::class)->createMany([
157158
['user_id' => $user->id, 'name' => 'Post 1 on topic 1'],
158159
['user_id' => $user->id, 'name' => 'Post 2 on topic 1'],

tests/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function getEnvironmentSetUp($app)
4343
$app['config']->set('database.default', 'sqlite');
4444
$app['config']->set('database.connections.sqlite', [
4545
'driver' => 'sqlite',
46-
'database' => __DIR__.'/database.sqlite',
46+
'database' => __DIR__.'/database/database.sqlite',
4747
'prefix' => '',
4848
]);
4949
$app['config']->set(
@@ -64,7 +64,7 @@ public function getEnvironmentSetUp($app)
6464
*/
6565
protected function resetDatabase()
6666
{
67-
file_put_contents(__DIR__.'/database.sqlite', null);
67+
file_put_contents(__DIR__.'/database/database.sqlite', null);
6868
}
6969

7070
/**

0 commit comments

Comments
 (0)