Skip to content

Commit e5f55db

Browse files
committed
Removed redundant type cast
1 parent 5531e13 commit e5f55db

21 files changed

+33
-36
lines changed

src/Propel/Generator/Builder/Om/ObjectBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ protected function getDefaultValueString(Column $column): string
200200
}
201201
$defaultValue = (string)array_search($val, $valueSet);
202202
} elseif ($column->isSetType()) {
203-
$defaultValue = (string)SetColumnConverter::convertToInt($val, $column->getValueSet());
203+
$defaultValue = SetColumnConverter::convertToInt($val, $column->getValueSet());
204204
} elseif ($column->isPhpPrimitiveType()) {
205205
settype($val, $column->getPhpType());
206206
$defaultValue = var_export($val, true);

src/Propel/Generator/Command/TestPrepareCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ protected function buildFixtures(string $fixturesDir, array $connections, InputI
151151
$command->run($in, $output);
152152
}
153153

154-
if (0 < count((array)$this->getSchemas('.'))) {
154+
if (0 < count($this->getSchemas('.'))) {
155155
$in = new ArrayInput([
156156
'command' => 'model:build',
157157
'--schema-dir' => '.',

src/Propel/Generator/Manager/AbstractManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public function getDatabase(string $name): ?Database
234234
*/
235235
public function setValidate(bool $validate): void
236236
{
237-
$this->validate = (bool)$validate;
237+
$this->validate = $validate;
238238
}
239239

240240
/**

src/Propel/Generator/Manager/ReverseManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function setDatabaseName(string $databaseName): void
150150
*/
151151
public function setSamePhpName(bool $samePhpName): void
152152
{
153-
$this->samePhpName = (bool)$samePhpName;
153+
$this->samePhpName = $samePhpName;
154154
}
155155

156156
/**
@@ -162,7 +162,7 @@ public function setSamePhpName(bool $samePhpName): void
162162
*/
163163
public function setAddVendorInfo(bool $addVendorInfo): void
164164
{
165-
$this->addVendorInfo = (bool)$addVendorInfo;
165+
$this->addVendorInfo = $addVendorInfo;
166166
}
167167

168168
/**

src/Propel/Generator/Manager/SqlManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function isOverwriteSqlMap(): bool
7979
*/
8080
public function setOverwriteSqlMap(bool $overwriteSqlMap): void
8181
{
82-
$this->overwriteSqlMap = (bool)$overwriteSqlMap;
82+
$this->overwriteSqlMap = $overwriteSqlMap;
8383
}
8484

8585
/**

src/Propel/Generator/Model/Column.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ public function getNotNullString(): string
928928
*/
929929
public function setPrimaryString(bool $isPrimaryString): void
930930
{
931-
$this->isPrimaryString = (bool)$isPrimaryString;
931+
$this->isPrimaryString = $isPrimaryString;
932932
}
933933

934934
/**
@@ -973,7 +973,7 @@ public function isPrimaryKey(): bool
973973
*/
974974
public function setNodeKey(bool $isNodeKey): void
975975
{
976-
$this->isNodeKey = (bool)$isNodeKey;
976+
$this->isNodeKey = $isNodeKey;
977977
}
978978

979979
/**
@@ -995,7 +995,7 @@ public function isNodeKey(): bool
995995
*/
996996
public function setNodeKeySep(string $sep): void
997997
{
998-
$this->nodeKeySep = (string)$sep;
998+
$this->nodeKeySep = $sep;
999999
}
10001000

10011001
/**
@@ -1017,7 +1017,7 @@ public function getNodeKeySep(): string
10171017
*/
10181018
public function setNestedSetLeftKey(bool $isNestedSetLeftKey): void
10191019
{
1020-
$this->isNestedSetLeftKey = (bool)$isNestedSetLeftKey;
1020+
$this->isNestedSetLeftKey = $isNestedSetLeftKey;
10211021
}
10221022

10231023
/**
@@ -1039,7 +1039,7 @@ public function isNestedSetLeftKey(): bool
10391039
*/
10401040
public function setNestedSetRightKey(bool $isNestedSetRightKey): void
10411041
{
1042-
$this->isNestedSetRightKey = (bool)$isNestedSetRightKey;
1042+
$this->isNestedSetRightKey = $isNestedSetRightKey;
10431043
}
10441044

10451045
/**
@@ -1061,7 +1061,7 @@ public function isNestedSetRightKey(): bool
10611061
*/
10621062
public function setTreeScopeKey(bool $isTreeScopeKey): void
10631063
{
1064-
$this->isTreeScopeKey = (bool)$isTreeScopeKey;
1064+
$this->isTreeScopeKey = $isTreeScopeKey;
10651065
}
10661066

10671067
/**

src/Propel/Generator/Model/ForeignKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ public function isLocalPrimaryKey(): bool
10251025
*/
10261026
public function setSkipSql(bool $skip): void
10271027
{
1028-
$this->skipSql = (bool)$skip;
1028+
$this->skipSql = $skip;
10291029
}
10301030

10311031
/**

src/Propel/Generator/Model/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function addColumn($data): void
190190
{
191191
if ($data instanceof Column) {
192192
$column = $data;
193-
$this->columns[] = (string)$column->getName();
193+
$this->columns[] = $column->getName();
194194
if ($column->getSize()) {
195195
$this->columnsSize[$column->getName()] = (int)$column->getSize();
196196
}

src/Propel/Generator/Model/Table.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function setupObject(): void
205205
// retrieves the method for converting from specified name to a PHP name.
206206
$this->phpNamingMethod = $this->getAttribute('phpNamingMethod', $this->database->getDefaultPhpNamingMethod());
207207

208-
$this->phpName = $this->getAttribute('phpName', $this->buildPhpName((string)$this->getStdSeparatedName()));
208+
$this->phpName = $this->getAttribute('phpName', $this->buildPhpName($this->getStdSeparatedName()));
209209

210210
if ($this->database->getTablePrefix()) {
211211
$this->commonName = $this->database->getTablePrefix() . $this->commonName;
@@ -944,7 +944,7 @@ public function getOtherRequiredPrimaryKeys(array $primaryKeys): array
944944
*/
945945
public function setContainsForeignPK(bool $containsForeignPK): void
946946
{
947-
$this->containsForeignPK = (bool)$containsForeignPK;
947+
$this->containsForeignPK = $containsForeignPK;
948948
}
949949

950950
/**
@@ -1248,7 +1248,7 @@ public function setDescription(string $description): void
12481248
public function getPhpName(): string
12491249
{
12501250
if ($this->phpName === null) {
1251-
$this->phpName = $this->buildPhpName((string)$this->getStdSeparatedName());
1251+
$this->phpName = $this->buildPhpName($this->getStdSeparatedName());
12521252
}
12531253

12541254
return $this->phpName;
@@ -1416,7 +1416,7 @@ public function isSkipSql(): bool
14161416
*/
14171417
public function setSkipSql(bool $skip): void
14181418
{
1419-
$this->skipSql = (bool)$skip;
1419+
$this->skipSql = $skip;
14201420
}
14211421

14221422
/**

src/Propel/Runtime/ActiveQuery/Criteria.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ public function hasWhereClause(): bool
652652
*/
653653
public function setUseTransaction(bool $v)
654654
{
655-
$this->useTransaction = (bool)$v;
655+
$this->useTransaction = $v;
656656

657657
return $this;
658658
}
@@ -1442,7 +1442,7 @@ public function withoutLock()
14421442
*/
14431443
public function setIgnoreCase(bool $b)
14441444
{
1445-
$this->ignoreCase = (bool)$b;
1445+
$this->ignoreCase = $b;
14461446

14471447
return $this;
14481448
}
@@ -1472,7 +1472,7 @@ public function isIgnoreCase(): bool
14721472
*/
14731473
public function setSingleRecord(bool $b)
14741474
{
1475-
$this->singleRecord = (bool)$b;
1475+
$this->singleRecord = $b;
14761476

14771477
return $this;
14781478
}

0 commit comments

Comments
 (0)