Skip to content
Permalink
Browse files

Refine class string after callable array check

  • Loading branch information
muglug committed Jan 2, 2020
1 parent 25e7039 commit e68fd02e805dffd503f2ce578a2ecae12c11b8af
Showing with 10 additions and 2 deletions.
  1. +2 −2 src/Psalm/Internal/Type/AssertionReconciler.php
  2. +8 −0 tests/CallableTest.php
@@ -1634,7 +1634,7 @@ private static function reconcileArray(
$array_types[] = $type;
} elseif ($type instanceof TCallable) {
$array_types[] = new TCallableObjectLikeArray([
new Union([new TString, new TObject]),
new Union([new TClassString, new TObject]),
Type::getString()
]);

@@ -1722,7 +1722,7 @@ private static function reconcileList(
$did_remove_type = true;
} elseif ($type instanceof TCallable) {
$array_types[] = new TCallableObjectLikeArray([
new Union([new TString, new TObject]),
new Union([new TClassString, new TObject]),
Type::getString()
]);

@@ -705,6 +705,14 @@ public static function fromStrings(array $ids): self
}
}'
],
'offsetOnCallable' => [
'<?php
function c(callable $c) : void {
if (is_array($c)) {
new ReflectionClass($c[0]);
}
}'
],
];
}

0 comments on commit e68fd02

Please sign in to comment.
You can’t perform that action at this time.