Skip to content

Commit f7f5d68

Browse files
committed
fix PHPStan errors
1 parent bb4099f commit f7f5d68

File tree

3 files changed

+0
-14
lines changed

3 files changed

+0
-14
lines changed

src/Map/BaseMap.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ public function getMapArray(): array
7575
public function sort(): MapInterface
7676
{
7777
foreach (array_keys(static::$map) as $k) {
78-
// @phpstan-ignore assign.propertyType
7978
ksort(static::$map[$k]);
8079
foreach (static::$map[$k] as &$sub) {
8180
ksort($sub);
@@ -166,11 +165,9 @@ protected function getMapSubEntry(string $entry, string $entryKey, string $subEn
166165
protected function addMapSubEntry(string $entry, string $entryKey, string $subEntry, string $value): MapInterface
167166
{
168167
if (!isset(static::$map[$entry][$entryKey][$subEntry])) {
169-
// @phpstan-ignore assign.propertyType
170168
static::$map[$entry][$entryKey][$subEntry] = [$value];
171169
} else {
172170
if (array_search($value, static::$map[$entry][$entryKey][$subEntry]) === false) {
173-
// @phpstan-ignore assign.propertyType
174171
static::$map[$entry][$entryKey][$subEntry][] = $value;
175172
}
176173
}
@@ -206,26 +203,22 @@ protected function removeMapSubEntry(string $entry, string $entryKey, string $su
206203
}
207204

208205
// Remove the map sub entry key.
209-
// @phpstan-ignore assign.propertyType
210206
unset(static::$map[$entry][$entryKey][$subEntry][$k]);
211207

212208
// Remove the sub entry if no more values.
213209
if (empty(static::$map[$entry][$entryKey][$subEntry])) {
214-
// @phpstan-ignore assign.propertyType
215210
unset(static::$map[$entry][$entryKey][$subEntry]);
216211
} else {
217212
// Resequence the remaining values.
218213
$tmp = [];
219214
foreach (static::$map[$entry][$entryKey][$subEntry] as $v) {
220215
$tmp[] = $v;
221216
}
222-
// @phpstan-ignore assign.propertyType
223217
static::$map[$entry][$entryKey][$subEntry] = $tmp;
224218
}
225219

226220
// Remove the entry if no more values.
227221
if (empty(static::$map[$entry][$entryKey])) {
228-
// @phpstan-ignore assign.propertyType
229222
unset(static::$map[$entry][$entryKey]);
230223
}
231224

@@ -269,7 +262,6 @@ protected function setValueAsDefault(string $entry, string $entryKey, string $su
269262
}
270263
$tmp[] = $v;
271264
}
272-
// @phpstan-ignore assign.propertyType
273265
static::$map[$entry][$entryKey][$subEntry] = $tmp;
274266

275267
return $this;

tests/src/MapHandlerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public function testSetDefaultMapClass(): void
2828
MapHandler::setDefaultMapClass(EmptyMap::class);
2929
$this->assertInstanceOf(EmptyMap::class, MapHandler::map());
3030
MapHandler::setDefaultMapClass(DefaultMap::class);
31-
// @phpstan-ignore method.impossibleType
3231
$this->assertInstanceOf(DefaultMap::class, MapHandler::map());
3332
}
3433

tests/src/MapUpdaterTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public function testLoadMapFromApacheFile(): void
4949
'txt' => ['t' => ['text/plain']],
5050
],
5151
];
52-
// @phpstan-ignore method.impossibleType
5352
$this->assertSame($expected, $this->newMap->getMapArray());
5453
$this->assertSame(['image/jpeg', 'text/plain'], $this->newMap->listTypes());
5554
$this->assertSame(['jpe', 'jpeg', 'jpg', 'txt'], $this->newMap->listExtensions());
@@ -111,7 +110,6 @@ public function testLoadMapFromFreedesktopFile(): void
111110
'image/pdf' => ['t' => ['application/pdf']],
112111
],
113112
];
114-
// @phpstan-ignore method.impossibleType
115113
$this->assertSame($expected, $this->newMap->getMapArray());
116114
$this->assertSame(['application/pdf', 'application/x-atari-2600-rom', 'application/x-pdf', 'text/plain'], $this->newMap->listTypes());
117115
$this->assertSame(['a26', 'asc', 'pdf', 'txt'], $this->newMap->listExtensions());
@@ -121,7 +119,6 @@ public function testLoadMapFromFreedesktopFile(): void
121119
public function testLoadMapFromFreedesktopFileZeroLines(): void
122120
{
123121
$this->updater->loadMapFromFreedesktopFile(dirname(__FILE__) . '/../fixtures/zero.freedesktop.xml');
124-
// @phpstan-ignore method.impossibleType
125122
$this->assertSame([], $this->newMap->getMapArray());
126123
}
127124

@@ -149,7 +146,6 @@ public function testWriteMapToPhpClassFile(): void
149146
{
150147
$this->fileSystem->copy(__DIR__ . '/../fixtures/MiniMap.php.test', __DIR__ . '/../fixtures/MiniMap.php');
151148
include_once(__DIR__ . '/../fixtures/MiniMap.php');
152-
// @phpstan-ignore class.notFound, argument.type
153149
MapHandler::setDefaultMapClass(MiniMap::class);
154150
$map_a = MapHandler::map();
155151
$this->assertStringContainsString('fixtures/MiniMap.php', $map_a->getFileName());
@@ -171,7 +167,6 @@ public function testWriteMapToPhpClassFileFailure(): void
171167
{
172168
$this->fileSystem->copy(__DIR__ . '/../fixtures/MiniMap.php.test', __DIR__ . '/../fixtures/MiniMap.php');
173169
include_once(__DIR__ . '/../fixtures/MiniMap.php');
174-
// @phpstan-ignore class.notFound, argument.type
175170
MapHandler::setDefaultMapClass(MiniMap::class);
176171
$map_a = MapHandler::map();
177172
$this->assertStringContainsString('fixtures/MiniMap.php', $map_a->getFileName());

0 commit comments

Comments
 (0)