From 43dfc68d588268f27eba1cec66039629c35ae37a Mon Sep 17 00:00:00 2001 From: Rizwan Jiwan <33099935+rizwanjiwan@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:54:00 -0400 Subject: [PATCH] Check if matches are empty strings, not if they exist Fix phpstan error. --- 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 0e1350739..8fa9fda51 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 ($matches[2]) { + if (empty($matches[2])===false) { $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 ($matches[3]) { + if (empty($matches[3])===false) { $sqlType = $row['Type']; } if (isset(static::$defaultTypeSizes[$nativeType]) && $scale == null && $size === static::$defaultTypeSizes[$nativeType]) {