mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 12:24:49 +01:00
Simplify assertion when mixed
This commit is contained in:
parent
d31dc663b9
commit
7665778b56
@ -83,6 +83,10 @@ class TArray extends \Psalm\Type\Atomic
|
||||
|
||||
public function getAssertionString(): string
|
||||
{
|
||||
if ($this->type_params[1]->isMixed()) {
|
||||
return 'array';
|
||||
}
|
||||
|
||||
return 'array<'
|
||||
. $this->type_params[0]->getAssertionString() . ', ' . $this->type_params[1]->getAssertionString()
|
||||
. '>' ;
|
||||
|
@ -192,6 +192,10 @@ class TList extends \Psalm\Type\Atomic
|
||||
|
||||
public function getAssertionString(): string
|
||||
{
|
||||
if ($this->type_param->isMixed()) {
|
||||
return 'list';
|
||||
}
|
||||
|
||||
return 'list<' . $this->type_param->getAssertionString() . '>';
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user