Skip to content
Permalink
Browse files

Ignore union types for now

  • Loading branch information
muglug committed Nov 27, 2019
1 parent d1fbd1f commit 2c083216031ce5946c93a9bde16ab1180bca7d22
Showing with 10 additions and 1 deletion.
  1. +1 −1 composer.json
  2. +9 −0 src/Psalm/Internal/Visitor/ReflectorVisitor.php
@@ -11,7 +11,7 @@
],
"require": {
"php": "^7.1.3",
"nikic/php-parser": "^4.2.3||^4.3",
"nikic/php-parser": "^4.3",
"openlss/lib-array2xml": "^1.0",
"ocramius/package-versions": "^1.2",
"composer/xdebug-handler": "^1.1",
@@ -1945,6 +1945,9 @@ private function registerFunctionLike(PhpParser\Node\FunctionLike $stmt, $fake_m
if ($parser_return_type instanceof PhpParser\Node\Identifier) {
$return_type_string = $parser_return_type->name . $suffix;
} elseif ($parser_return_type instanceof PhpParser\Node\UnionType) {
// for now unsupported
$return_type_string = 'mixed';
} else {
$return_type_fq_classlike_name = ClassLikeAnalyzer::getFQCLNFromNameObject(
$parser_return_type,
@@ -2691,6 +2694,9 @@ public function getTranslatedFunctionParam(
$this->codebase->scanner->queueClassLikeForScanning($param_type_string, $this->file_path);
$this->file_storage->referenced_classlikes[strtolower($param_type_string)] = $param_type_string;
} elseif ($param_typehint instanceof PhpParser\Node\UnionType) {
// not yet supported
$param_type_string = 'mixed';
} else {
if ($this->classlike_storages
&& strtolower($param_typehint->parts[0]) === 'self'
@@ -3060,6 +3066,9 @@ private function visitPropertyDeclaration(
if ($parser_property_type instanceof PhpParser\Node\Identifier) {
$property_type_string = $parser_property_type->name . $suffix;
} elseif ($parser_property_type instanceof PhpParser\Node\UnionType) {
// not yet supported
$property_type_string = 'mixed';
} else {
$property_type_fq_classlike_name = ClassLikeAnalyzer::getFQCLNFromNameObject(
$parser_property_type,

0 comments on commit 2c08321

Please sign in to comment.
You can’t perform that action at this time.