Skip to content

Commit

Permalink
Check if matches are empty strings, not if they exist
Browse files Browse the repository at this point in the history
Pass php stan?
  • Loading branch information
rizwanjiwan committed Sep 17, 2024
1 parent 2a556f5 commit 3d244ef
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 ($matches[2]) {
if (strlen($matches[2])>0) {

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

Comparison operation ">" between int<1, max> and 0 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 ($matches[3]) {
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 3d244ef

Please sign in to comment.