Skip to content

Commit 50135a9

Browse files
committed
[BCB] Remove ConstantArrayType::generalizeToArray()
1 parent d5a0ddb commit 50135a9

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

UPGRADING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,3 +250,4 @@ Instead of `PHPStanTestCase::createBroker()`, call `PHPStanTestCase::createRefle
250250
* Remove `ConstantArrayType::getNextAutoIndex()`
251251
* Removed methods from `ConstantArrayType` - `getFirst*Type` and `getLast*Type`
252252
* Use `getFirstIterable*Type` and `getLastIterable*Type` instead
253+
* Remove `ConstantArrayType::generalizeToArray()`

src/Type/Constant/ConstantArrayType.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,26 +1305,6 @@ public function generalizeValues(): ArrayType
13051305
return new self($this->keyTypes, $valueTypes, $this->nextAutoIndexes, $this->optionalKeys, $this->isList);
13061306
}
13071307

1308-
/** @deprecated */
1309-
public function generalizeToArray(): Type
1310-
{
1311-
$isIterableAtLeastOnce = $this->isIterableAtLeastOnce();
1312-
if ($isIterableAtLeastOnce->no()) {
1313-
return $this;
1314-
}
1315-
1316-
$arrayType = new ArrayType($this->getIterableKeyType(), $this->getItemType());
1317-
1318-
if ($isIterableAtLeastOnce->yes()) {
1319-
$arrayType = TypeCombinator::intersect($arrayType, new NonEmptyArrayType());
1320-
}
1321-
if ($this->isList->yes()) {
1322-
$arrayType = TypeCombinator::intersect($arrayType, new AccessoryArrayListType());
1323-
}
1324-
1325-
return $arrayType;
1326-
}
1327-
13281308
/**
13291309
* @return self
13301310
*/

0 commit comments

Comments
 (0)