mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix #1173 - transform const X = true to a true type
This commit is contained in:
parent
930a8b2689
commit
99569e8ee3
@ -987,7 +987,7 @@ class StatementsAnalyzer extends SourceAnalyzer implements StatementsSource
|
||||
if (strtolower($stmt->name->parts[0]) === 'false') {
|
||||
return Type::getFalse();
|
||||
} elseif (strtolower($stmt->name->parts[0]) === 'true') {
|
||||
return Type::getBool();
|
||||
return Type::getTrue();
|
||||
} elseif (strtolower($stmt->name->parts[0]) === 'null') {
|
||||
return Type::getNull();
|
||||
}
|
||||
|
@ -833,6 +833,19 @@ class FunctionCallTest extends TestCase
|
||||
'$a' => 'string',
|
||||
],
|
||||
],
|
||||
'varExportConstFetch' => [
|
||||
'<?php
|
||||
class Foo {
|
||||
const BOOL_VAR_EXPORT_RETURN = true;
|
||||
|
||||
/**
|
||||
* @param mixed $mixed
|
||||
*/
|
||||
public static function Baz($mixed) : string {
|
||||
return var_export($mixed, self::BOOL_VAR_EXPORT_RETURN);
|
||||
}
|
||||
}',
|
||||
],
|
||||
'key' => [
|
||||
'<?php
|
||||
$a = ["one" => 1, "two" => 3];
|
||||
|
Loading…
Reference in New Issue
Block a user