1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Fix minor boop

This commit is contained in:
Matthew Brown 2016-11-13 15:55:06 -05:00
parent fa2209719b
commit f2ce83c8e5
2 changed files with 11 additions and 8 deletions

View File

@ -806,14 +806,16 @@ class ExpressionChecker
) {
if ($left_type && !$left_type->isMixed()) {
if ($left_type->hasNumericType()) {
if ($left_type->isInt() && $right_type->isInt()) {
$result_type = Type::getInt();
return;
}
if ($right_type) {
if ($left_type->isInt() && $right_type->isInt()) {
$result_type = Type::getInt();
return;
}
if ($left_type->hasNumericType() && $right_type->hasNumericType()) {
$result_type = Type::getFloat();
return;
if ($left_type->hasNumericType() && $right_type->hasNumericType()) {
$result_type = Type::getFloat();
return;
}
}
} elseif ($left_type->hasArray()) {
if (!$right_type || $right_type->isMixed()) {

View File

@ -38,7 +38,8 @@ class Atomic extends Type
public function toNamespacedString(array $aliased_classes, $this_class)
{
if ($this->value === $this_class) {
return $this_class;
$class_parts = explode('\\', $this_class);
return array_pop($class_parts);
}
if (isset($aliased_classes[$this->value])) {