From fd21862c54fab75fa57844dc062f30e080b6763a Mon Sep 17 00:00:00 2001 From: Rizwan Jiwan <33099935+rizwanjiwan@users.noreply.github.com> Date: Wed, 18 Sep 2024 09:02:54 -0400 Subject: [PATCH] Work around phpstan thinking strlen returns >0 in all cases --- src/Propel/Generator/Reverse/MysqlSchemaParser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Propel/Generator/Reverse/MysqlSchemaParser.php b/src/Propel/Generator/Reverse/MysqlSchemaParser.php index 43e7df8a6..07f1f370d 100644 --- a/src/Propel/Generator/Reverse/MysqlSchemaParser.php +++ b/src/Propel/Generator/Reverse/MysqlSchemaParser.php @@ -237,7 +237,7 @@ public function getColumnFromRow(array $row, Table $table): Column $/x'; if (preg_match($regexp, $row['Type'], $matches)) { $nativeType = $matches[1]; - if (strlen($matches[2])>0) { + if (strlen(trim($matches[2])) > 0) { $cpos = strpos($matches[2], ','); if ($cpos !== false) { $size = (int)substr($matches[2], 0, $cpos); @@ -246,7 +246,7 @@ public function getColumnFromRow(array $row, Table $table): Column $size = (int)$matches[2]; } } - if (strlen($matches[3])>0) { + if (strlen($matches[3]) > 0) { $sqlType = $row['Type']; } if (isset(static::$defaultTypeSizes[$nativeType]) && $scale == null && $size === static::$defaultTypeSizes[$nativeType]) {