Skip to content

Commit

Permalink
Revert Add DynamicFunctionReturnTypeExtension for array_replace
Browse files Browse the repository at this point in the history
This reverts commit 7114465.
  • Loading branch information
ondrejmirtes committed Aug 30, 2021
1 parent 9660b8d commit d28f785
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 173 deletions.
5 changes: 0 additions & 5 deletions conf/config.neon
Original file line number Diff line number Diff line change
Expand Up @@ -973,11 +973,6 @@ services:
tags:
- phpstan.broker.dynamicFunctionReturnTypeExtension

-
class: PHPStan\Type\Php\ArrayReplaceFunctionDynamicReturnTypeExtension
tags:
- phpstan.broker.dynamicFunctionReturnTypeExtension

-
class: PHPStan\Type\Php\ArrayKeysFunctionDynamicReturnTypeExtension
tags:
Expand Down
99 changes: 0 additions & 99 deletions src/Type/Php/ArrayReplaceFunctionDynamicReturnTypeExtension.php

This file was deleted.

4 changes: 0 additions & 4 deletions tests/PHPStan/Analyser/LegacyNodeScopeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5152,10 +5152,6 @@ public function dataArrayFunctions(): array
'array<int, int>',
'array_values($generalStringKeys)',
],
[
"array('foo' => 'foo', 1 => stdClass, 'bar' => stdClass)",
'array_replace($stringOrIntegerKeys, $stringKeys)',
],
[
"array('foo' => stdClass, 0 => stdClass)",
'array_merge($stringOrIntegerKeys)',
Expand Down
2 changes: 0 additions & 2 deletions tests/PHPStan/Analyser/NodeScopeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ public function dataFileAsserts(): iterable

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

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

yield from $this->gatherAssertTypes(__DIR__ . '/data/non-empty-array.php');

if (PHP_VERSION_ID >= 80000 || self::$useStaticReflectionProvider) {
Expand Down
58 changes: 0 additions & 58 deletions tests/PHPStan/Analyser/data/array-replace.php

This file was deleted.

5 changes: 0 additions & 5 deletions tests/PHPStan/Analyser/data/non-empty-array.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ public function arrayFunctions($array, $list, $stringArray): void
assertType('array&nonEmpty', array_merge($array, []));
assertType('array&nonEmpty', array_merge($array, $array));

assertType('array&nonEmpty', array_replace($array));
assertType('array&nonEmpty', array_replace([], $array));
assertType('array&nonEmpty', array_replace($array, []));
assertType('array&nonEmpty', array_replace($array, $array));

assertType('array<int|string, (int|string)>&nonEmpty', array_flip($array));
assertType('array<string, (int|string)>&nonEmpty', array_flip($stringArray));
}
Expand Down

0 comments on commit d28f785

Please sign in to comment.