Skip to content

Commit bd3716f

Browse files
committed
refactor: fix function.alreadyNarrowedType errors
1 parent bd60f50 commit bd3716f

File tree

4 files changed

+4
-20
lines changed

4 files changed

+4
-20
lines changed

system/HTTP/Files/FileCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ protected function getValueDotNotationSyntax(array $index, array $value)
253253
{
254254
$currentIndex = array_shift($index);
255255

256-
if (isset($currentIndex) && is_array($index) && $index !== [] && array_key_exists($currentIndex, $value) && is_array($value[$currentIndex])) {
256+
if (isset($currentIndex) && $index !== [] && array_key_exists($currentIndex, $value) && is_array($value[$currentIndex])) {
257257
return $this->getValueDotNotationSyntax($index, $value[$currentIndex]);
258258
}
259259

system/Test/DOMParser.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,8 @@ protected function doXPath(?string $search, string $element, array $paths = [])
233233

234234
// $paths might contain a number of different
235235
// ready to go xpath portions to tack on.
236-
if ($paths !== [] && is_array($paths)) {
237-
foreach ($paths as $extra) {
238-
$path .= $extra;
239-
}
236+
foreach ($paths as $extra) {
237+
$path .= $extra;
240238
}
241239

242240
if ($search !== null) {

utils/phpstan-baseline/function.alreadyNarrowedType.neon

-13
This file was deleted.

utils/phpstan-baseline/loader.neon

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# total 3760 errors
1+
# total 3758 errors
22
includes:
33
- argument.type.neon
44
- assign.propertyType.neon
@@ -11,7 +11,6 @@ includes:
1111
- deadCode.unreachable.neon
1212
- empty.notAllowed.neon
1313
- empty.property.neon
14-
- function.alreadyNarrowedType.neon
1514
- generator.valueType.neon
1615
- isset.property.neon
1716
- method.alreadyNarrowedType.neon

0 commit comments

Comments
 (0)