diff --git a/src/Type/Accessory/AccessoryArrayListType.php b/src/Type/Accessory/AccessoryArrayListType.php index 6042d14ced..ff3536f473 100644 --- a/src/Type/Accessory/AccessoryArrayListType.php +++ b/src/Type/Accessory/AccessoryArrayListType.php @@ -162,10 +162,6 @@ public function setOffsetValueType(?Type $offsetType, Type $valueType, bool $uni public function setExistingOffsetValueType(Type $offsetType, Type $valueType): Type { - if ($this->hasOffsetValueType($offsetType)->no()) { - return new ErrorType(); - } - return $this; } diff --git a/tests/PHPStan/Analyser/nsrt/bug-13629.php b/tests/PHPStan/Analyser/nsrt/bug-13629.php deleted file mode 100644 index 621b4169bb..0000000000 --- a/tests/PHPStan/Analyser/nsrt/bug-13629.php +++ /dev/null @@ -1,37 +0,0 @@ -> $xsdFiles - * @param array> $groupedByNamespace - * @param array> $extraNamespaces - */ -function test(array $xsdFiles, array $groupedByNamespace, array $extraNamespaces): void { - foreach ($extraNamespaces as $mergedNamespace) { - if (count($mergedNamespace) < 2) { - continue; - } - - $targetNamespace = end($mergedNamespace); - if (!isset($groupedByNamespace[$targetNamespace])) { - continue; - } - $xmlNamespace = $groupedByNamespace[$targetNamespace][0]['xmlNamespace']; - - assertType('string', $xmlNamespace); - assertType('non-empty-list&hasOffsetValue(1, string)', $mergedNamespace); - - $xsdFiles[$xmlNamespace] = []; - foreach ($mergedNamespace as $namespace) { - foreach ($groupedByNamespace[$namespace] ?? [] as $viewHelper) { - $xsdFiles[$xmlNamespace][$viewHelper['name']] = $viewHelper; - } - } - // After assigning with string keys ($viewHelper['name']), $xsdFiles[$xmlNamespace] should NOT be a list - assertType('array, array{xmlNamespace: string, namespace: string, name: string}>', $xsdFiles[$xmlNamespace]); - $xsdFiles[$xmlNamespace] = array_values($xsdFiles[$xmlNamespace]); - } -} diff --git a/tests/PHPStan/Rules/Functions/ArrayValuesRuleTest.php b/tests/PHPStan/Rules/Functions/ArrayValuesRuleTest.php index 37cb87b0f0..1f3e273b16 100644 --- a/tests/PHPStan/Rules/Functions/ArrayValuesRuleTest.php +++ b/tests/PHPStan/Rules/Functions/ArrayValuesRuleTest.php @@ -89,9 +89,4 @@ public function testFile(): void $this->analyse([__DIR__ . '/data/array_values_list.php'], $expectedErrors); } - public function testBug13629(): void - { - $this->analyse([__DIR__ . '/../../Analyser/nsrt/bug-13629.php'], []); - } - }