Skip to content
Permalink
Browse files

Add better string detection

  • Loading branch information
muglug committed Jan 7, 2020
1 parent b351df0 commit ce5917c6fb3d62a1779d3055330b579fd146c7b9
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOpAnalyzer.php
@@ -575,7 +575,11 @@ function ($c) {
if ($stmt_left_type
&& $stmt_right_type
&& ($stmt_left_type->getId() === 'non-empty-string'
|| $stmt_right_type->getId() === 'non-empty-string')
|| $stmt_right_type->getId() === 'non-empty-string'
|| ($stmt_left_type->isSingleStringLiteral()
&& $stmt_left_type->getSingleStringLiteral()->value)
|| ($stmt_right_type->isSingleStringLiteral()
&& $stmt_right_type->getSingleStringLiteral()->value))
) {
$stmt_type = new Type\Union([new Type\Atomic\TNonEmptyString()]);
} else {

0 comments on commit ce5917c

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