You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewShouldNotHappenException(sprintf('Expected string for variable in %s, please open an issue on GitHub https://github.com/mglaman/phpstan-drupal/issues', get_called_class()));
57
+
}
58
+
$type = $scope->getVariableType($var_name);
59
+
assert($typeinstanceof ObjectType);
60
+
if (!class_exists($type->getClassName()) && !interface_exists($type->getClassName())) {
61
+
thrownewShouldNotHappenException(sprintf('Could not find class for %s from reflection.', get_called_class()));
62
+
}
41
63
42
64
try {
43
-
$method_name = $node->name;
44
-
if ($method_nameinstanceofNode\Identifier) {
45
-
$method_name = $method_name->name;
46
-
}
47
-
if ($method_name !== 'loadInclude') {
48
-
return [];
49
-
}
50
-
$var_name = $node->var->name;
51
-
if ($var_nameinstanceofNode\Identifier) {
52
-
$var_name = $var_name->name;
53
-
}
54
-
if (!$var_name) {
55
-
return [];
56
-
}
57
-
$type = $scope->getVariableType($var_name);
58
65
$reflected = new \ReflectionClass($type->getClassName());
$this->assertEquals('If condition is always false.', $error->getMessage());
47
47
$error = array_shift($errors);
48
48
$this->assertEquals('Function phpstan_fixtures_MissingReturnRule() should return string but return statement is missing.', $error->getMessage());
49
+
$error = array_shift($errors);
50
+
$this->assertStringContainsString('phpstan_fixtures/phpstan_fixtures.fetch.inc could not be loaded from Drupal\\Core\\Extension\\ModuleHandlerInterface::loadInclude', $error->getMessage());
0 commit comments