1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Type::getString already respects maxStringLength config, there is no need to additional checks (#3069)

This commit is contained in:
m0003r 2020-04-05 21:27:02 +03:00 committed by GitHub
parent e34a3a9281
commit c8e7e43bb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1645,9 +1645,7 @@ class StatementsAnalyzer extends SourceAnalyzer implements StatementsSource
) {
$result = $left->getSingleStringLiteral()->value . $right->getSingleStringLiteral()->value;
if (strlen($result) < 50) {
return Type::getString($result);
}
return Type::getString($result);
}
return Type::getString();
@ -1823,7 +1821,7 @@ class StatementsAnalyzer extends SourceAnalyzer implements StatementsSource
}
if ($stmt instanceof PhpParser\Node\Scalar\String_) {
return Type::getString(strlen($stmt->value) < 30 ? $stmt->value : null);
return Type::getString($stmt->value);
}
if ($stmt instanceof PhpParser\Node\Scalar\LNumber) {