Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mringler committed Nov 17, 2022
1 parent 5df70ef commit 1dad2e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions src/Propel/Generator/Model/PropelTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ public static function isTemporalType(string $type): bool
self::TIMESTAMP,
self::BU_DATE,
self::BU_TIMESTAMP,
]);
], true);
}

/**
Expand All @@ -579,7 +579,7 @@ public static function isTextType(string $mappingType): bool
self::BU_DATE,
self::BU_TIMESTAMP,
self::JSON,
]);
], true);
}

/**
Expand All @@ -601,7 +601,7 @@ public static function isNumericType(string $mappingType): bool
self::NUMERIC,
self::DECIMAL,
self::REAL,
]);
], true);
}

/**
Expand All @@ -613,7 +613,7 @@ public static function isNumericType(string $mappingType): bool
*/
public static function isBooleanType(string $mappingType): bool
{
return in_array($mappingType, [self::BOOLEAN, self::BOOLEAN_EMU]);
return in_array($mappingType, [self::BOOLEAN, self::BOOLEAN_EMU], true);
}

/**
Expand All @@ -625,7 +625,7 @@ public static function isBooleanType(string $mappingType): bool
*/
public static function isLobType(string $mappingType): bool
{
return in_array($mappingType, [self::VARBINARY, self::LONGVARBINARY, self::BLOB, self::OBJECT, self::GEOMETRY]);
return in_array($mappingType, [self::VARBINARY, self::LONGVARBINARY, self::BLOB, self::OBJECT, self::GEOMETRY], true);
}

/**
Expand All @@ -639,7 +639,7 @@ public static function isUuidType(string $type): bool
{
return in_array($type, [
self::UUID,
]);
], true);
}

/**
Expand All @@ -651,7 +651,7 @@ public static function isUuidType(string $type): bool
*/
public static function isPhpPrimitiveType(string $phpType): bool
{
return in_array($phpType, ['boolean', 'int', 'double', 'float', 'string']);
return in_array($phpType, ['boolean', 'int', 'double', 'float', 'string'], true);
}

/**
Expand All @@ -663,7 +663,7 @@ public static function isPhpPrimitiveType(string $phpType): bool
*/
public static function isPhpPrimitiveNumericType(string $phpType): bool
{
return in_array($phpType, ['boolean', 'int', 'double', 'float']);
return in_array($phpType, ['boolean', 'int', 'double', 'float'], true);
}

/**
Expand All @@ -675,7 +675,7 @@ public static function isPhpPrimitiveNumericType(string $phpType): bool
*/
public static function isPhpObjectType(string $phpType): bool
{
return !self::isPhpPrimitiveType($phpType) && !in_array($phpType, ['resource', 'array']);
return !self::isPhpPrimitiveType($phpType) && !in_array($phpType, ['resource', 'array'], true);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Propel/Generator/Platform/PgsqlPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ public function supportsSchemas(): bool
*/
public function hasSize(string $sqlType): bool
{
return !in_array($sqlType, ['BYTEA', 'TEXT', 'DOUBLE PRECISION']);
return !in_array(strtoupper($sqlType), ['BYTEA', 'TEXT', 'DOUBLE PRECISION'], true);
}

/**
Expand Down Expand Up @@ -737,7 +737,7 @@ public function isUuid(string $type): bool
{
$strings = ['UUID'];

return in_array(strtoupper($type), $strings);
return in_array(strtoupper($type), $strings, true);
}

/**
Expand All @@ -749,7 +749,7 @@ public function isString(string $type): bool
{
$strings = ['VARCHAR'];

return in_array(strtoupper($type), $strings);
return in_array(strtoupper($type), $strings, true);
}

/**
Expand All @@ -761,7 +761,7 @@ public function isNumber(string $type): bool
{
$numbers = ['INTEGER', 'INT4', 'INT2', 'NUMBER', 'NUMERIC', 'SMALLINT', 'BIGINT', 'DECIMAL', 'REAL', 'DOUBLE PRECISION', 'SERIAL', 'BIGSERIAL'];

return in_array(strtoupper($type), $numbers);
return in_array(strtoupper($type), $numbers, true);
}

/**
Expand Down

0 comments on commit 1dad2e8

Please sign in to comment.