Skip to content

Commit

Permalink
Work around phpstan thinking strlen returns >0 in all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
rizwanjiwan committed Sep 18, 2024
1 parent 3d244ef commit fd21862
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Propel/Generator/Reverse/MysqlSchemaParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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]) {
Expand Down

0 comments on commit fd21862

Please sign in to comment.