1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 12:24:49 +01:00

Fix issue where extension_loaded stopped constructor being recognised

This commit is contained in:
Matthew Brown 2019-06-15 18:49:58 -04:00
parent d7f5fa29df
commit c4551bd0df
2 changed files with 10 additions and 1 deletions

View File

@ -288,7 +288,6 @@ class NewAnalyzer extends \Psalm\Internal\Analyzer\Statements\Expression\CallAna
$stmt->inferredType = new Type\Union([new TNamedObject($fq_class_name)]);
if (strtolower($fq_class_name) !== 'stdclass' &&
$context->check_classes &&
$codebase->classlikes->classExists($fq_class_name)
) {
$storage = $codebase->classlike_storage_provider->get($fq_class_name);

View File

@ -387,6 +387,16 @@ class UnusedCodeTest extends TestCase
(new D)->bar();'
],
'usedClassAfterExtensionLoaded' => [
'<?php
class A {
public function __construct() {}
}
if (extension_loaded("fdsfdsfd")) {
new A();
}',
],
];
}