Skip to content

Commit

Permalink
Revert "Check if matches are empty strings, not if they exist"
Browse files Browse the repository at this point in the history
This reverts commit 43dfc68.
  • Loading branch information
rizwanjiwan committed Sep 17, 2024
1 parent 43dfc68 commit 2a556f5
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 (empty($matches[2])===false) {
if ($matches[2]) {

Check failure on line 240 in src/Propel/Generator/Reverse/MysqlSchemaParser.php

View workflow job for this annotation

GitHub Actions / code-style-and-static-analysis

If condition is always true.
$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 (empty($matches[3])===false) {
if ($matches[3]) {
$sqlType = $row['Type'];
}
if (isset(static::$defaultTypeSizes[$nativeType]) && $scale == null && $size === static::$defaultTypeSizes[$nativeType]) {
Expand Down

0 comments on commit 2a556f5

Please sign in to comment.