diff --git a/src/Propel/Generator/Builder/Om/ObjectBuilder.php b/src/Propel/Generator/Builder/Om/ObjectBuilder.php index 6914982a5..ec0fe5365 100644 --- a/src/Propel/Generator/Builder/Om/ObjectBuilder.php +++ b/src/Propel/Generator/Builder/Om/ObjectBuilder.php @@ -200,7 +200,7 @@ protected function getDefaultValueString(Column $column): string } $defaultValue = (string)array_search($val, $valueSet); } elseif ($column->isSetType()) { - $defaultValue = (string)SetColumnConverter::convertToInt($val, $column->getValueSet()); + $defaultValue = SetColumnConverter::convertToInt($val, $column->getValueSet()); } elseif ($column->isPhpPrimitiveType()) { settype($val, $column->getPhpType()); $defaultValue = var_export($val, true); diff --git a/src/Propel/Generator/Command/TestPrepareCommand.php b/src/Propel/Generator/Command/TestPrepareCommand.php index 03803a699..76f5aa3d9 100644 --- a/src/Propel/Generator/Command/TestPrepareCommand.php +++ b/src/Propel/Generator/Command/TestPrepareCommand.php @@ -151,7 +151,7 @@ protected function buildFixtures(string $fixturesDir, array $connections, InputI $command->run($in, $output); } - if (0 < count((array)$this->getSchemas('.'))) { + if (0 < count($this->getSchemas('.'))) { $in = new ArrayInput([ 'command' => 'model:build', '--schema-dir' => '.', diff --git a/src/Propel/Generator/Manager/AbstractManager.php b/src/Propel/Generator/Manager/AbstractManager.php index 9a52f8cbf..8f892de7c 100644 --- a/src/Propel/Generator/Manager/AbstractManager.php +++ b/src/Propel/Generator/Manager/AbstractManager.php @@ -234,7 +234,7 @@ public function getDatabase(string $name): ?Database */ public function setValidate(bool $validate): void { - $this->validate = (bool)$validate; + $this->validate = $validate; } /** diff --git a/src/Propel/Generator/Manager/ReverseManager.php b/src/Propel/Generator/Manager/ReverseManager.php index 27b51ff68..e67da557b 100644 --- a/src/Propel/Generator/Manager/ReverseManager.php +++ b/src/Propel/Generator/Manager/ReverseManager.php @@ -150,7 +150,7 @@ public function setDatabaseName(string $databaseName): void */ public function setSamePhpName(bool $samePhpName): void { - $this->samePhpName = (bool)$samePhpName; + $this->samePhpName = $samePhpName; } /** @@ -162,7 +162,7 @@ public function setSamePhpName(bool $samePhpName): void */ public function setAddVendorInfo(bool $addVendorInfo): void { - $this->addVendorInfo = (bool)$addVendorInfo; + $this->addVendorInfo = $addVendorInfo; } /** diff --git a/src/Propel/Generator/Manager/SqlManager.php b/src/Propel/Generator/Manager/SqlManager.php index a56b1836d..85d1ea930 100644 --- a/src/Propel/Generator/Manager/SqlManager.php +++ b/src/Propel/Generator/Manager/SqlManager.php @@ -79,7 +79,7 @@ public function isOverwriteSqlMap(): bool */ public function setOverwriteSqlMap(bool $overwriteSqlMap): void { - $this->overwriteSqlMap = (bool)$overwriteSqlMap; + $this->overwriteSqlMap = $overwriteSqlMap; } /** diff --git a/src/Propel/Generator/Model/Column.php b/src/Propel/Generator/Model/Column.php index aba5005ca..16ee82c91 100644 --- a/src/Propel/Generator/Model/Column.php +++ b/src/Propel/Generator/Model/Column.php @@ -928,7 +928,7 @@ public function getNotNullString(): string */ public function setPrimaryString(bool $isPrimaryString): void { - $this->isPrimaryString = (bool)$isPrimaryString; + $this->isPrimaryString = $isPrimaryString; } /** @@ -973,7 +973,7 @@ public function isPrimaryKey(): bool */ public function setNodeKey(bool $isNodeKey): void { - $this->isNodeKey = (bool)$isNodeKey; + $this->isNodeKey = $isNodeKey; } /** @@ -995,7 +995,7 @@ public function isNodeKey(): bool */ public function setNodeKeySep(string $sep): void { - $this->nodeKeySep = (string)$sep; + $this->nodeKeySep = $sep; } /** @@ -1017,7 +1017,7 @@ public function getNodeKeySep(): string */ public function setNestedSetLeftKey(bool $isNestedSetLeftKey): void { - $this->isNestedSetLeftKey = (bool)$isNestedSetLeftKey; + $this->isNestedSetLeftKey = $isNestedSetLeftKey; } /** @@ -1039,7 +1039,7 @@ public function isNestedSetLeftKey(): bool */ public function setNestedSetRightKey(bool $isNestedSetRightKey): void { - $this->isNestedSetRightKey = (bool)$isNestedSetRightKey; + $this->isNestedSetRightKey = $isNestedSetRightKey; } /** @@ -1061,7 +1061,7 @@ public function isNestedSetRightKey(): bool */ public function setTreeScopeKey(bool $isTreeScopeKey): void { - $this->isTreeScopeKey = (bool)$isTreeScopeKey; + $this->isTreeScopeKey = $isTreeScopeKey; } /** diff --git a/src/Propel/Generator/Model/ForeignKey.php b/src/Propel/Generator/Model/ForeignKey.php index ea7c8cba7..ac7c5c25c 100644 --- a/src/Propel/Generator/Model/ForeignKey.php +++ b/src/Propel/Generator/Model/ForeignKey.php @@ -1025,7 +1025,7 @@ public function isLocalPrimaryKey(): bool */ public function setSkipSql(bool $skip): void { - $this->skipSql = (bool)$skip; + $this->skipSql = $skip; } /** diff --git a/src/Propel/Generator/Model/Index.php b/src/Propel/Generator/Model/Index.php index a025f9ef5..a63dd5a2c 100644 --- a/src/Propel/Generator/Model/Index.php +++ b/src/Propel/Generator/Model/Index.php @@ -190,7 +190,7 @@ public function addColumn($data): void { if ($data instanceof Column) { $column = $data; - $this->columns[] = (string)$column->getName(); + $this->columns[] = $column->getName(); if ($column->getSize()) { $this->columnsSize[$column->getName()] = (int)$column->getSize(); } diff --git a/src/Propel/Generator/Model/Table.php b/src/Propel/Generator/Model/Table.php index 15604640b..303cb640c 100644 --- a/src/Propel/Generator/Model/Table.php +++ b/src/Propel/Generator/Model/Table.php @@ -205,7 +205,7 @@ public function setupObject(): void // retrieves the method for converting from specified name to a PHP name. $this->phpNamingMethod = $this->getAttribute('phpNamingMethod', $this->database->getDefaultPhpNamingMethod()); - $this->phpName = $this->getAttribute('phpName', $this->buildPhpName((string)$this->getStdSeparatedName())); + $this->phpName = $this->getAttribute('phpName', $this->buildPhpName($this->getStdSeparatedName())); if ($this->database->getTablePrefix()) { $this->commonName = $this->database->getTablePrefix() . $this->commonName; @@ -944,7 +944,7 @@ public function getOtherRequiredPrimaryKeys(array $primaryKeys): array */ public function setContainsForeignPK(bool $containsForeignPK): void { - $this->containsForeignPK = (bool)$containsForeignPK; + $this->containsForeignPK = $containsForeignPK; } /** @@ -1248,7 +1248,7 @@ public function setDescription(string $description): void public function getPhpName(): string { if ($this->phpName === null) { - $this->phpName = $this->buildPhpName((string)$this->getStdSeparatedName()); + $this->phpName = $this->buildPhpName($this->getStdSeparatedName()); } return $this->phpName; @@ -1416,7 +1416,7 @@ public function isSkipSql(): bool */ public function setSkipSql(bool $skip): void { - $this->skipSql = (bool)$skip; + $this->skipSql = $skip; } /** diff --git a/src/Propel/Runtime/ActiveQuery/Criteria.php b/src/Propel/Runtime/ActiveQuery/Criteria.php index 26c0503f7..c082f5010 100644 --- a/src/Propel/Runtime/ActiveQuery/Criteria.php +++ b/src/Propel/Runtime/ActiveQuery/Criteria.php @@ -652,7 +652,7 @@ public function hasWhereClause(): bool */ public function setUseTransaction(bool $v) { - $this->useTransaction = (bool)$v; + $this->useTransaction = $v; return $this; } @@ -1442,7 +1442,7 @@ public function withoutLock() */ public function setIgnoreCase(bool $b) { - $this->ignoreCase = (bool)$b; + $this->ignoreCase = $b; return $this; } @@ -1472,7 +1472,7 @@ public function isIgnoreCase(): bool */ public function setSingleRecord(bool $b) { - $this->singleRecord = (bool)$b; + $this->singleRecord = $b; return $this; } diff --git a/src/Propel/Runtime/ActiveQuery/Criterion/BasicCriterion.php b/src/Propel/Runtime/ActiveQuery/Criterion/BasicCriterion.php index a541bf726..a04ba047a 100644 --- a/src/Propel/Runtime/ActiveQuery/Criterion/BasicCriterion.php +++ b/src/Propel/Runtime/ActiveQuery/Criterion/BasicCriterion.php @@ -44,7 +44,7 @@ public function __construct(Criteria $outer, $column, $value, ?string $compariso */ public function setIgnoreCase(bool $b) { - $this->ignoreStringCase = (bool)$b; + $this->ignoreStringCase = $b; return $this; } diff --git a/src/Propel/Runtime/ActiveQuery/Criterion/CustomCriterion.php b/src/Propel/Runtime/ActiveQuery/Criterion/CustomCriterion.php index 896ce81b8..5e8122697 100644 --- a/src/Propel/Runtime/ActiveQuery/Criterion/CustomCriterion.php +++ b/src/Propel/Runtime/ActiveQuery/Criterion/CustomCriterion.php @@ -38,7 +38,7 @@ public function __construct(Criteria $outer, string $value) protected function appendPsForUniqueClauseTo(string &$sb, array &$params): void { if ($this->value !== '') { - $sb .= (string)$this->value; + $sb .= $this->value; } } } diff --git a/src/Propel/Runtime/ActiveQuery/Criterion/LikeCriterion.php b/src/Propel/Runtime/ActiveQuery/Criterion/LikeCriterion.php index a91b8d4f5..4cfcb1c8e 100644 --- a/src/Propel/Runtime/ActiveQuery/Criterion/LikeCriterion.php +++ b/src/Propel/Runtime/ActiveQuery/Criterion/LikeCriterion.php @@ -44,7 +44,7 @@ public function __construct(Criteria $outer, $column, $value, string $comparison */ public function setIgnoreCase(bool $b) { - $this->ignoreStringCase = (bool)$b; + $this->ignoreStringCase = $b; return $this; } diff --git a/src/Propel/Runtime/ActiveQuery/Criterion/LikeModelCriterion.php b/src/Propel/Runtime/ActiveQuery/Criterion/LikeModelCriterion.php index 8bb92fb11..795e594c4 100644 --- a/src/Propel/Runtime/ActiveQuery/Criterion/LikeModelCriterion.php +++ b/src/Propel/Runtime/ActiveQuery/Criterion/LikeModelCriterion.php @@ -31,7 +31,7 @@ class LikeModelCriterion extends BasicModelCriterion */ public function setIgnoreCase(bool $b) { - $this->ignoreStringCase = (bool)$b; + $this->ignoreStringCase = $b; return $this; } diff --git a/src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php b/src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php index d62bbe62c..11f8f0cf3 100644 --- a/src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php +++ b/src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php @@ -128,9 +128,6 @@ public function quoteIdentifierTable(string $table): string */ public function applyLimit(string &$sql, int $offset, int $limit, ?Criteria $criteria = null): void { - $offset = (int)$offset; - $limit = (int)$limit; - if ($limit >= 0) { $sql .= ' LIMIT ' . ($offset > 0 ? $offset . ', ' : '') . $limit; } elseif ($offset > 0) { diff --git a/src/Propel/Runtime/Collection/Collection.php b/src/Propel/Runtime/Collection/Collection.php index ed2262f2f..50b5a2d62 100644 --- a/src/Propel/Runtime/Collection/Collection.php +++ b/src/Propel/Runtime/Collection/Collection.php @@ -648,7 +648,7 @@ public function __call(string $name, $params) */ public function __toString(): string { - return (string)$this->exportTo($this->getTableMapClass()::DEFAULT_STRING_FORMAT, false); + return $this->exportTo($this->getTableMapClass()::DEFAULT_STRING_FORMAT, false); } /** diff --git a/src/Propel/Runtime/Collection/OnDemandIterator.php b/src/Propel/Runtime/Collection/OnDemandIterator.php index acd3da405..619cbcb2b 100644 --- a/src/Propel/Runtime/Collection/OnDemandIterator.php +++ b/src/Propel/Runtime/Collection/OnDemandIterator.php @@ -162,6 +162,6 @@ public function rewind(): void */ public function valid(): bool { - return (bool)$this->isValid; + return $this->isValid; } } diff --git a/src/Propel/Runtime/Connection/ConnectionManagerPrimaryReplica.php b/src/Propel/Runtime/Connection/ConnectionManagerPrimaryReplica.php index f81a50591..c5b6e2268 100644 --- a/src/Propel/Runtime/Connection/ConnectionManagerPrimaryReplica.php +++ b/src/Propel/Runtime/Connection/ConnectionManagerPrimaryReplica.php @@ -90,7 +90,7 @@ public function isForcePrimaryConnection(): bool */ public function setForcePrimaryConnection(bool $isForceMasterConnection): void { - $this->isForcePrimaryConnection = (bool)$isForceMasterConnection; + $this->isForcePrimaryConnection = $isForceMasterConnection; } /** diff --git a/src/Propel/Runtime/Connection/ConnectionWrapper.php b/src/Propel/Runtime/Connection/ConnectionWrapper.php index d76550362..76d60331b 100644 --- a/src/Propel/Runtime/Connection/ConnectionWrapper.php +++ b/src/Propel/Runtime/Connection/ConnectionWrapper.php @@ -326,7 +326,7 @@ public function forceRollBack(): bool */ public function inTransaction(): bool { - return (bool)$this->connection->inTransaction(); + return $this->connection->inTransaction(); } /** diff --git a/src/Propel/Runtime/Map/ColumnMap.php b/src/Propel/Runtime/Map/ColumnMap.php index 39367420f..b4ccf6702 100644 --- a/src/Propel/Runtime/Map/ColumnMap.php +++ b/src/Propel/Runtime/Map/ColumnMap.php @@ -335,7 +335,7 @@ public function getSize(): int */ public function setPrimaryKey(bool $pk): void { - $this->pk = (bool)$pk; + $this->pk = $pk; } /** @@ -357,7 +357,7 @@ public function isPrimaryKey(): bool */ public function setNotNull(bool $nn): void { - $this->notNull = (bool)$nn; + $this->notNull = $nn; } /** @@ -592,7 +592,7 @@ public static function normalizeName(string $name): string */ public function setPrimaryString(bool $pkString): void { - $this->isPkString = (bool)$pkString; + $this->isPkString = $pkString; } /** diff --git a/src/Propel/Runtime/Map/TableMap.php b/src/Propel/Runtime/Map/TableMap.php index ce10ddf1c..07185760e 100644 --- a/src/Propel/Runtime/Map/TableMap.php +++ b/src/Propel/Runtime/Map/TableMap.php @@ -401,7 +401,7 @@ public function getPackage(): ?string */ public function setUseIdGenerator(bool $bit): void { - $this->useIdGenerator = (bool)$bit; + $this->useIdGenerator = $bit; } /**