Skip to content

Commit d28f785

Browse files
committed
Revert Add DynamicFunctionReturnTypeExtension for array_replace
This reverts commit 7114465.
1 parent 9660b8d commit d28f785

File tree

6 files changed

+0
-173
lines changed

6 files changed

+0
-173
lines changed

conf/config.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -973,11 +973,6 @@ services:
973973
tags:
974974
- phpstan.broker.dynamicFunctionReturnTypeExtension
975975

976-
-
977-
class: PHPStan\Type\Php\ArrayReplaceFunctionDynamicReturnTypeExtension
978-
tags:
979-
- phpstan.broker.dynamicFunctionReturnTypeExtension
980-
981976
-
982977
class: PHPStan\Type\Php\ArrayKeysFunctionDynamicReturnTypeExtension
983978
tags:

src/Type/Php/ArrayReplaceFunctionDynamicReturnTypeExtension.php

Lines changed: 0 additions & 99 deletions
This file was deleted.

tests/PHPStan/Analyser/LegacyNodeScopeResolverTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5152,10 +5152,6 @@ public function dataArrayFunctions(): array
51525152
'array<int, int>',
51535153
'array_values($generalStringKeys)',
51545154
],
5155-
[
5156-
"array('foo' => 'foo', 1 => stdClass, 'bar' => stdClass)",
5157-
'array_replace($stringOrIntegerKeys, $stringKeys)',
5158-
],
51595155
[
51605156
"array('foo' => stdClass, 0 => stdClass)",
51615157
'array_merge($stringOrIntegerKeys)',

tests/PHPStan/Analyser/NodeScopeResolverTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ public function dataFileAsserts(): iterable
136136

137137
yield from $this->gatherAssertTypes(__DIR__ . '/data/array-merge.php');
138138

139-
yield from $this->gatherAssertTypes(__DIR__ . '/data/array-replace.php');
140-
141139
yield from $this->gatherAssertTypes(__DIR__ . '/data/non-empty-array.php');
142140

143141
if (PHP_VERSION_ID >= 80000 || self::$useStaticReflectionProvider) {

tests/PHPStan/Analyser/data/array-replace.php

Lines changed: 0 additions & 58 deletions
This file was deleted.

tests/PHPStan/Analyser/data/non-empty-array.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ public function arrayFunctions($array, $list, $stringArray): void
4949
assertType('array&nonEmpty', array_merge($array, []));
5050
assertType('array&nonEmpty', array_merge($array, $array));
5151

52-
assertType('array&nonEmpty', array_replace($array));
53-
assertType('array&nonEmpty', array_replace([], $array));
54-
assertType('array&nonEmpty', array_replace($array, []));
55-
assertType('array&nonEmpty', array_replace($array, $array));
56-
5752
assertType('array<int|string, (int|string)>&nonEmpty', array_flip($array));
5853
assertType('array<string, (int|string)>&nonEmpty', array_flip($stringArray));
5954
}

0 commit comments

Comments
 (0)