Skip to content

Commit 9178962

Browse files
authored
Bump zing/coding-standard to ^6.1 (#8)
1 parent 67a7d99 commit 9178962

7 files changed

+25
-25
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"nunomaduro/larastan": "^1.0 || ^2.0",
2727
"orchestra/testbench": "^6.0 || ^7.0",
2828
"phpunit/phpunit": "^8.0,<8.5.12 || ^9.3.3",
29-
"zing/coding-standard": "^5.3 || ^6.0"
29+
"zing/coding-standard": "^6.1"
3030
},
3131
"autoload": {
3232
"psr-4": {

src/HasMoreRelationships.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ protected function guessBelongsToOneRelation(): ?string
278278
{
279279
/** @phpstan-var array{function: string}|null $caller */
280280
$caller = Arr::first(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), function ($trace): bool {
281-
return ! in_array(
281+
return ! \in_array(
282282
$trace['function'],
283283
array_merge(static::$oneMethods, ['guessBelongsToOneRelation']),
284284
true

src/Relations/BelongsToOne.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
*/
2121
class BelongsToOne extends BelongsToMany implements SupportsPartialRelations
2222
{
23-
use SupportsDefaultModels;
2423
use CanBeOneOfMany;
2524
use ComparesRelatedModels;
25+
use SupportsDefaultModels;
2626

2727
/**
2828
* Initialize the relation on a set of models.

src/Relations/MorphToOne.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
*/
2121
class MorphToOne extends MorphToMany implements SupportsPartialRelations
2222
{
23-
use SupportsDefaultModels;
2423
use CanBeOneOfMany;
2524
use ComparesRelatedModels;
25+
use SupportsDefaultModels;
2626

2727
/**
2828
* Initialize the relation on a set of models.

tests/BelongsToOneTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function testRetrievedTimes(): void
137137

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

140-
$this->assertSame(2, $retrievedLogins);
140+
self::assertSame(2, $retrievedLogins);
141141
}
142142

143143
public function testReceivingModel(): void
@@ -157,8 +157,8 @@ public function testReceivingModel(): void
157157

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

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

184184
$exists = Group::query()->whereHas('leader', function ($q) use ($currentUser): void {
185185
$q->whereKey($currentUser->getKey());
186186
})->exists();
187-
$this->assertTrue($exists);
187+
self::assertTrue($exists);
188188
}
189189

190190
public function testIs(): void
@@ -202,8 +202,8 @@ public function testIs(): void
202202
'status' => 1,
203203
]);
204204

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

207-
$this->assertTrue($group->leader()->is($currentImage));
207+
self::assertTrue($group->leader()->is($currentImage));
208208
}
209209
}

tests/MorphToOneTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function testRetrievedTimes(): void
137137

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

140-
$this->assertSame(2, $retrievedLogins);
140+
self::assertSame(2, $retrievedLogins);
141141
}
142142

143143
public function testReceivingModel(): void
@@ -157,8 +157,8 @@ public function testReceivingModel(): void
157157

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

164164
public function testMorphType(): void
@@ -186,8 +186,8 @@ public function testMorphType(): void
186186

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

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

212212
$exists = Product::query()->whereHas('cover', function ($q) use ($currentImage): void {
213213
$q->whereKey($currentImage->getKey());
214214
})->exists();
215-
$this->assertTrue($exists);
215+
self::assertTrue($exists);
216216
}
217217

218218
public function testGetResults(): void

tests/MorphedByOneTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function testRetrievedTimes(): void
128128

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

131-
$this->assertSame(2, $retrievedLogins);
131+
self::assertSame(2, $retrievedLogins);
132132
}
133133

134134
public function testReceivingModel(): void
@@ -148,8 +148,8 @@ public function testReceivingModel(): void
148148

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

155155
public function testMorphType(): void
@@ -177,8 +177,8 @@ public function testMorphType(): void
177177

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

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

203203
$exists = Image::query()->whereHas('bestProduct', function ($q) use ($currentProduct): void {
204204
$q->whereKey($currentProduct->getKey());
205205
})->exists();
206-
$this->assertTrue($exists);
206+
self::assertTrue($exists);
207207
}
208208
}

0 commit comments

Comments
 (0)