Skip to content

Commit

Permalink
Bump zing/coding-standard to ^6.1 (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingimmick authored Feb 21, 2022
1 parent 67a7d99 commit 9178962
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"nunomaduro/larastan": "^1.0 || ^2.0",
"orchestra/testbench": "^6.0 || ^7.0",
"phpunit/phpunit": "^8.0,<8.5.12 || ^9.3.3",
"zing/coding-standard": "^5.3 || ^6.0"
"zing/coding-standard": "^6.1"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/HasMoreRelationships.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ protected function guessBelongsToOneRelation(): ?string
{
/** @phpstan-var array{function: string}|null $caller */
$caller = Arr::first(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), function ($trace): bool {
return ! in_array(
return ! \in_array(
$trace['function'],
array_merge(static::$oneMethods, ['guessBelongsToOneRelation']),
true
Expand Down
2 changes: 1 addition & 1 deletion src/Relations/BelongsToOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
*/
class BelongsToOne extends BelongsToMany implements SupportsPartialRelations
{
use SupportsDefaultModels;
use CanBeOneOfMany;
use ComparesRelatedModels;
use SupportsDefaultModels;

/**
* Initialize the relation on a set of models.
Expand Down
2 changes: 1 addition & 1 deletion src/Relations/MorphToOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
*/
class MorphToOne extends MorphToMany implements SupportsPartialRelations
{
use SupportsDefaultModels;
use CanBeOneOfMany;
use ComparesRelatedModels;
use SupportsDefaultModels;

/**
* Initialize the relation on a set of models.
Expand Down
14 changes: 7 additions & 7 deletions tests/BelongsToOneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function testRetrievedTimes(): void

Group::query()->with('leader')->get();

$this->assertSame(2, $retrievedLogins);
self::assertSame(2, $retrievedLogins);
}

public function testReceivingModel(): void
Expand All @@ -157,8 +157,8 @@ public function testReceivingModel(): void

/** @var \Zing\LaravelEloquentRelationships\Tests\Models\User $leader */
$leader = $group->leader;
$this->assertNotNull($leader);
$this->assertSame($user->getKey(), $leader->getKey());
self::assertNotNull($leader);
self::assertSame($user->getKey(), $leader->getKey());
}

public function testExists(): void
Expand All @@ -179,12 +179,12 @@ public function testExists(): void
$exists = Group::query()->whereHas('leader', function ($q) use ($previousUser): void {
$q->whereKey($previousUser->getKey());
})->exists();
$this->assertFalse($exists);
self::assertFalse($exists);

$exists = Group::query()->whereHas('leader', function ($q) use ($currentUser): void {
$q->whereKey($currentUser->getKey());
})->exists();
$this->assertTrue($exists);
self::assertTrue($exists);
}

public function testIs(): void
Expand All @@ -202,8 +202,8 @@ public function testIs(): void
'status' => 1,
]);

$this->assertFalse($group->leader()->is($previousImage));
self::assertFalse($group->leader()->is($previousImage));

$this->assertTrue($group->leader()->is($currentImage));
self::assertTrue($group->leader()->is($currentImage));
}
}
14 changes: 7 additions & 7 deletions tests/MorphToOneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function testRetrievedTimes(): void

Product::query()->with('cover')->get();

$this->assertSame(2, $retrievedLogins);
self::assertSame(2, $retrievedLogins);
}

public function testReceivingModel(): void
Expand All @@ -157,8 +157,8 @@ public function testReceivingModel(): void

/** @var \Zing\LaravelEloquentRelationships\Tests\Models\Image $cover */
$cover = $product->cover;
$this->assertNotNull($cover);
$this->assertSame('test', $cover->url);
self::assertNotNull($cover);
self::assertSame('test', $cover->url);
}

public function testMorphType(): void
Expand Down Expand Up @@ -186,8 +186,8 @@ public function testMorphType(): void

/** @var \Zing\LaravelEloquentRelationships\Tests\Models\Image $cover */
$cover = $product->cover;
$this->assertNotNull($cover);
$this->assertSame('test', $cover->url);
self::assertNotNull($cover);
self::assertSame('test', $cover->url);
}

public function testExists(): void
Expand All @@ -207,12 +207,12 @@ public function testExists(): void
$exists = Product::query()->whereHas('cover', function ($q) use ($previousImage): void {
$q->whereKey($previousImage->getKey());
})->exists();
$this->assertFalse($exists);
self::assertFalse($exists);

$exists = Product::query()->whereHas('cover', function ($q) use ($currentImage): void {
$q->whereKey($currentImage->getKey());
})->exists();
$this->assertTrue($exists);
self::assertTrue($exists);
}

public function testGetResults(): void
Expand Down
14 changes: 7 additions & 7 deletions tests/MorphedByOneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function testRetrievedTimes(): void

Image::query()->with('bestProduct')->get();

$this->assertSame(2, $retrievedLogins);
self::assertSame(2, $retrievedLogins);
}

public function testReceivingModel(): void
Expand All @@ -148,8 +148,8 @@ public function testReceivingModel(): void

/** @var \Zing\LaravelEloquentRelationships\Tests\Models\Product $product */
$product = $image->bestProduct;
$this->assertNotNull($product);
$this->assertSame('test', $product->name);
self::assertNotNull($product);
self::assertSame('test', $product->name);
}

public function testMorphType(): void
Expand Down Expand Up @@ -177,8 +177,8 @@ public function testMorphType(): void

/** @var \Zing\LaravelEloquentRelationships\Tests\Models\Product $product */
$product = $image->bestProduct;
$this->assertNotNull($product);
$this->assertSame('test', $product->name);
self::assertNotNull($product);
self::assertSame('test', $product->name);
}

public function testExists(): void
Expand All @@ -198,11 +198,11 @@ public function testExists(): void
$exists = Image::query()->whereHas('bestProduct', function ($q) use ($previousProduct): void {
$q->whereKey($previousProduct->getKey());
})->exists();
$this->assertFalse($exists);
self::assertFalse($exists);

$exists = Image::query()->whereHas('bestProduct', function ($q) use ($currentProduct): void {
$q->whereKey($currentProduct->getKey());
})->exists();
$this->assertTrue($exists);
self::assertTrue($exists);
}
}

0 comments on commit 9178962

Please sign in to comment.