1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Fix assertion generation

This commit is contained in:
Brown 2020-02-10 17:27:39 -05:00
parent 5eabc2e6a9
commit 2abe76d3c2
2 changed files with 4 additions and 3 deletions

View File

@ -32,7 +32,10 @@ class GetClassT extends TString
public function getId(bool $nested = false)
{
return $this->as_type->isMixed() ? 'class-string' : 'class-string<' . $this->as_type->getId() . '>';
return $this->as_type->isMixed()
|| $this->as_type->hasObject()
? 'class-string'
: 'class-string<' . $this->as_type->getId() . '>';
}
/**

View File

@ -1125,7 +1125,6 @@ class AnalyzedMethodTest extends \Psalm\Tests\TestCase
public function __construct(int $a, string $b) {
echo $this->arr[$a];
$this->b = $b;
parent::__construct($a, $b);
}
}',
getcwd() . DIRECTORY_SEPARATOR . 'AChild.php' => '<?php
@ -1147,7 +1146,6 @@ class AnalyzedMethodTest extends \Psalm\Tests\TestCase
public function __construct(int $a, string $b) {
echo $this->arr[$a];
$this->b = $b;
parent::__construct($a, $b);
}
}',
getcwd() . DIRECTORY_SEPARATOR . 'AChild.php' => '<?php