Skip to content

Commit 175ea76

Browse files
committed
fix phpstan:check
1 parent 1afa001 commit 175ea76

5 files changed

Lines changed: 26 additions & 26 deletions

File tree

system/Filters/Filters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ public function getRequiredFilters(string $position = 'before'): array
375375
{
376376
// For backward compatibility. For users who do not update Config\Filters.
377377
if (! isset($this->config->required[$position])) {
378-
$baseConfig = config(BaseFiltersConfig::class); // @phpstan-ignore-line
378+
$baseConfig = config(BaseFiltersConfig::class);
379379
$filters = $baseConfig->required[$position];
380380
$aliases = $baseConfig->aliases;
381381
} else {

tests/system/CommonSingleServiceTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public function testSingleServiceWithNoParamsSupplied(string $service): void
3434
{
3535
Services::injectMock('security', new MockSecurity(new SecurityConfig()));
3636

37-
$service1 = single_service($service); // @phpstan-ignore codeigniter.unknownServiceMethod
38-
$service2 = single_service($service); // @phpstan-ignore codeigniter.unknownServiceMethod
37+
$service1 = single_service($service);
38+
$service2 = single_service($service);
3939

4040
$this->assertNotNull($service1);
4141

@@ -62,8 +62,8 @@ public function testSingleServiceWithAtLeastOneParamSupplied(string $service): v
6262

6363
$params[] = $method->getNumberOfParameters() === 1 ? true : $method->getParameters()[0]->getDefaultValue();
6464

65-
$service1 = single_service($service, ...$params); // @phpstan-ignore codeigniter.unknownServiceMethod
66-
$service2 = single_service($service, ...$params); // @phpstan-ignore codeigniter.unknownServiceMethod
65+
$service1 = single_service($service, ...$params);
66+
$service2 = single_service($service, ...$params);
6767

6868
$this->assertNotNull($service1);
6969

tests/system/Config/DotEnvTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public static function provideLoadsVars(): iterable
9393
public function testLoadsHex2Bin(): void
9494
{
9595
putenv('encryption.key');
96-
unset($_ENV['encryption.key'], $_SERVER['encryption.key']); // @phpstan-ignore codeigniter.superglobalAccess
96+
unset($_ENV['encryption.key'], $_SERVER['encryption.key']);
9797

9898
$dotenv = new DotEnv($this->fixturesFolder, 'encryption.env');
9999
$dotenv->load();
@@ -108,7 +108,7 @@ public function testLoadsHex2Bin(): void
108108
public function testLoadsBase64(): void
109109
{
110110
putenv('encryption.key');
111-
unset($_ENV['encryption.key'], $_SERVER['encryption.key']); // @phpstan-ignore codeigniter.superglobalAccess
111+
unset($_ENV['encryption.key'], $_SERVER['encryption.key']);
112112

113113
$dotenv = new DotEnv($this->fixturesFolder, 'base64encryption.env');
114114
$dotenv->load();

tests/system/Models/DataConverterModelTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testFindAsArray(): void
3636

3737
$user = $this->model->find($id);
3838

39-
$this->assertIsInt($user['id']); // @phpstan-ignore offsetAccess.notFound
39+
$this->assertIsInt($user['id']);
4040
$this->assertInstanceOf(Time::class, $user['created_at']);
4141
$this->assertSame('John Smith', $user['name']);
4242
// `name` is cast by custom CastBase64 handler.
@@ -128,9 +128,9 @@ public function testFindAllAsArray(): void
128128

129129
$users = $this->model->findAll();
130130

131-
$this->assertIsInt($users[0]['id']); // @phpstan-ignore offsetAccess.notFound
131+
$this->assertIsInt($users[0]['id']);
132132
$this->assertInstanceOf(Time::class, $users[0]['created_at']);
133-
$this->assertIsInt($users[1]['id']); // @phpstan-ignore offsetAccess.notFound
133+
$this->assertIsInt($users[1]['id']);
134134
$this->assertInstanceOf(Time::class, $users[1]['created_at']);
135135
}
136136

@@ -208,7 +208,7 @@ public function testFirstAsArray(): void
208208

209209
$user = $this->model->first();
210210

211-
$this->assertIsInt($user['id']); // @phpstan-ignore offsetAccess.notFound
211+
$this->assertIsInt($user['id']);
212212
$this->assertInstanceOf(Time::class, $user['created_at']);
213213
}
214214

@@ -265,7 +265,7 @@ public function testInsertArray(): void
265265

266266
$user = $this->model->find($id);
267267

268-
$this->assertSame(['joe@example.com'], $user['email']); // @phpstan-ignore offsetAccess.notFound
268+
$this->assertSame(['joe@example.com'], $user['email']);
269269
}
270270

271271
public function testInsertObject(): void
@@ -281,7 +281,7 @@ public function testInsertObject(): void
281281

282282
$user = $this->model->find($id);
283283

284-
$this->assertSame(['joe@example.com'], $user['email']); // @phpstan-ignore offsetAccess.notFound
284+
$this->assertSame(['joe@example.com'], $user['email']);
285285
}
286286

287287
public function testUpdateArray(): void
@@ -290,14 +290,14 @@ public function testUpdateArray(): void
290290
$user = $this->model->find($id);
291291

292292
$user['email'][] = 'private@example.org';
293-
$this->model->update($user['id'], $user); // @phpstan-ignore offsetAccess.notFound
293+
$this->model->update($user['id'], $user);
294294

295295
$user = $this->model->find($id);
296296

297297
$this->assertSame([
298298
'john@example.com',
299299
'private@example.org',
300-
], $user['email']); // @phpstan-ignore offsetAccess.notFound
300+
], $user['email']);
301301
}
302302

303303
public function testUpdateObject(): void
@@ -313,7 +313,7 @@ public function testUpdateObject(): void
313313
$this->assertSame([
314314
'john@example.com',
315315
'private@example.org',
316-
], $user['email']); // @phpstan-ignore offsetAccess.notFound
316+
], $user['email']);
317317
}
318318

319319
public function testUpdateCustomObject(): void
@@ -365,7 +365,7 @@ public function testSaveArray(): void
365365
$this->assertSame([
366366
'john@example.com',
367367
'private@example.org',
368-
], $user['email']); // @phpstan-ignore offsetAccess.notFound
368+
], $user['email']);
369369
}
370370

371371
public function testSaveObject(): void
@@ -381,7 +381,7 @@ public function testSaveObject(): void
381381
$this->assertSame([
382382
'john@example.com',
383383
'private@example.org',
384-
], $user['email']); // @phpstan-ignore offsetAccess.notFound
384+
], $user['email']);
385385
}
386386

387387
public function testSaveCustomObject(): void

tests/system/Models/TimestampModelTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function testDoNotAllowDatesInsertArrayWithoutDatesSetsTimestamp(): void
9898
$expected .= '.000';
9999
}
100100

101-
$this->assertSame($expected, $user['created_at']); // @phpstan-ignore offsetAccess.notFound
101+
$this->assertSame($expected, $user['created_at']);
102102
$this->assertSame($expected, $user['updated_at']);
103103
}
104104

@@ -123,7 +123,7 @@ public function testDoNotAllowDatesInsertArrayWithDatesSetsTimestamp(): void
123123
$expected .= '.000';
124124
}
125125

126-
$this->assertSame($expected, $user['created_at']); // @phpstan-ignore offsetAccess.notFound
126+
$this->assertSame($expected, $user['created_at']);
127127
$this->assertSame($expected, $user['updated_at']);
128128
}
129129

@@ -143,7 +143,7 @@ public function testDoNotAllowDatesUpdateArrayUpdatesUpdatedAt(): void
143143
$user = $this->model->find($id);
144144

145145
$user['country'] = 'CA';
146-
$this->model->update($user['id'], $user); // @phpstan-ignore offsetAccess.notFound
146+
$this->model->update($user['id'], $user);
147147

148148
$user = $this->model->find($id);
149149

@@ -153,7 +153,7 @@ public function testDoNotAllowDatesUpdateArrayUpdatesUpdatedAt(): void
153153
$expected .= '.000';
154154
}
155155

156-
$this->assertSame($expected, $user['created_at']); // @phpstan-ignore offsetAccess.notFound
156+
$this->assertSame($expected, $user['created_at']);
157157
$this->assertSame($expected, $user['updated_at']);
158158
}
159159

@@ -208,7 +208,7 @@ public function testAllowDatesInsertArrayWithoutDatesSetsTimestamp(): void
208208
$expected .= '.000';
209209
}
210210

211-
$this->assertSame($expected, $user['created_at']); // @phpstan-ignore offsetAccess.notFound
211+
$this->assertSame($expected, $user['created_at']);
212212
$this->assertSame($expected, $user['updated_at']);
213213
}
214214

@@ -237,7 +237,7 @@ public function testAllowDatesInsertArrayWithDatesSetsTimestamp(): void
237237
$expected .= '.000';
238238
}
239239

240-
$this->assertSame($expected, $user['created_at']); // @phpstan-ignore offsetAccess.notFound
240+
$this->assertSame($expected, $user['created_at']);
241241
$this->assertSame($expected, $user['updated_at']);
242242
}
243243

@@ -261,7 +261,7 @@ public function testAllowDatesUpdateArrayUpdatesUpdatedAt(): void
261261
$user = $this->model->find($id);
262262

263263
$user['country'] = 'CA';
264-
$this->model->update($user['id'], $user); // @phpstan-ignore offsetAccess.notFound
264+
$this->model->update($user['id'], $user);
265265

266266
$user = $this->model->find($id);
267267

@@ -271,7 +271,7 @@ public function testAllowDatesUpdateArrayUpdatesUpdatedAt(): void
271271
$expected .= '.000';
272272
}
273273

274-
$this->assertSame($expected, $user['created_at']); // @phpstan-ignore offsetAccess.notFound
274+
$this->assertSame($expected, $user['created_at']);
275275
$this->assertSame($expected, $user['updated_at']);
276276
}
277277

0 commit comments

Comments
 (0)