Skip to content

Commit dcf7952

Browse files
Merge remote-tracking branch 'origin/1.x' into 1.x
2 parents 3a58a2f + 77c68df commit dcf7952

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

src/CacheAwareProxy.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ public function __construct(
4040
protected bool $executingCallback = false,
4141
protected ?Lock $lockInstance = null,
4242
protected bool $bypassCacheCheck = false,
43-
)
44-
{
43+
) {
4544
// This callback interrupts the query execution on cache hit.
4645
$this->queryBuilder->beforeQuery(function (): void {
4746
// We will avoid looping this callback if it's executing.

src/CacheQueryServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
use Closure;
66
use DateInterval;
77
use DateTimeInterface;
8+
use function func_get_args;
89
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
910
use Illuminate\Database\Query\Builder;
1011
use Illuminate\Support\ServiceProvider;
11-
use function func_get_args;
1212

1313
/**
1414
* @internal
@@ -35,11 +35,11 @@ public function register(): void
3535
*/
3636
public function boot(): void
3737
{
38-
if (!Builder::hasMacro('cache')) {
38+
if (! Builder::hasMacro('cache')) {
3939
Builder::macro('cache', $this->macro());
4040
}
4141

42-
if (!EloquentBuilder::hasGlobalMacro('cache')) {
42+
if (! EloquentBuilder::hasGlobalMacro('cache')) {
4343
EloquentBuilder::macro('cache', function () {
4444
/** @var \Illuminate\Contracts\Database\Eloquent\Builder $this */
4545
$this->setQuery($this->getQuery()->cache(...func_get_args()));

src/Helpers.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
namespace Laragear\CacheQuery;
44

5-
use Illuminate\Contracts\Cache\LockProvider;
6-
use Illuminate\Contracts\Cache\Repository;
7-
use Illuminate\Contracts\Database\Query\Builder;
8-
use LogicException;
95
use function base64_encode;
106
use function cache;
117
use function config;
8+
use Illuminate\Contracts\Cache\LockProvider;
9+
use Illuminate\Contracts\Cache\Repository;
10+
use Illuminate\Contracts\Database\Query\Builder;
1211
use function implode;
12+
use LogicException;
1313
use function md5;
1414
use function str;
1515

@@ -30,7 +30,7 @@ public static function store(?string $store, bool $lockable = false): Repository
3030
{
3131
$repository = cache()->store($store ?? config('cache-query.store'));
3232

33-
if ($lockable && !$repository->getStore() instanceof LockProvider) {
33+
if ($lockable && ! $repository->getStore() instanceof LockProvider) {
3434
$store ??= cache()->getDefaultDriver();
3535

3636
throw new LogicException("The [$store] cache does not support atomic locks.");

tests/CacheAwareProxyTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected function setUp(): void
2626
{
2727
parent::setUp();
2828

29-
for ($i = 0; $i < 10; ++$i) {
29+
for ($i = 0; $i < 10; $i++) {
3030
$users[] = [
3131
'email' => $this->faker->freeEmail,
3232
'name' => $this->faker->name,
@@ -37,7 +37,7 @@ protected function setUp(): void
3737

3838
$this->app->make('db')->table('users')->insert($users);
3939

40-
for ($i = 0; $i < 6; ++$i) {
40+
for ($i = 0; $i < 6; $i++) {
4141
$posts[] = [
4242
'title' => $this->faker->text(20),
4343
'user_id' => (int) floor(max(1, $i / 2)),

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ protected function getPackageProviders($app): array
1111
{
1212
return [CacheQueryServiceProvider::class];
1313
}
14-
}
14+
}

0 commit comments

Comments
 (0)