Skip to content

Commit

Permalink
replace php type boolean with bool
Browse files Browse the repository at this point in the history
  • Loading branch information
mringler committed Jun 15, 2024
1 parent e5b98d1 commit a3dc074
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Propel/Generator/Builder/Om/ObjectBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6684,7 +6684,7 @@ protected function addSaveComment(string &$script): void
* @param ConnectionInterface \$con";
if ($reloadOnUpdate || $reloadOnInsert) {
$script .= "
* @param boolean \$skipReload Whether to skip the reload for this object from database.";
* @param bool \$skipReload Whether to skip the reload for this object from database.";
}
$script .= "
* @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
Expand Down
2 changes: 1 addition & 1 deletion src/Propel/Generator/Model/Domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public function getPhpDefaultValue()
throw new EngineException('Cannot get PHP version of default value for default value EXPRESSION.');
}

if (in_array($this->mappingType, [PropelTypes::BOOLEAN, PropelTypes::BOOLEAN_EMU], true)) {
if (in_array($this->mappingType, [PropelTypes::BOOLEAN, PropelTypes::BOOLEAN_EMU, PropelTypes::BOOLEAN_NATIVE_TYPE], true)) {
return $this->booleanValue($this->defaultValue->getValue());
}

Expand Down
8 changes: 4 additions & 4 deletions src/Propel/Generator/Model/PropelTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,12 @@ class PropelTypes
/**
* @var string
*/
public const BOOLEAN_NATIVE_TYPE = 'boolean';
public const BOOLEAN_NATIVE_TYPE = 'bool';

/**
* @var string
*/
public const BOOLEAN_EMU_NATIVE_TYPE = 'boolean';
public const BOOLEAN_EMU_NATIVE_TYPE = 'bool';

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

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

/**
Expand Down
2 changes: 1 addition & 1 deletion templates/Behavior/Validate/objectAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Flag to prevent endless validation loop, if this object is referenced
* by another object which falls in this transaction.
* @var boolean
* @var bool
*/
protected $alreadyInValidation = false;

Expand Down
2 changes: 1 addition & 1 deletion tests/Propel/Tests/Generator/Model/ColumnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ public function testBooleanType($mappingType)
$column->setDomain($domain);
$column->setType($mappingType);

$this->assertSame('boolean', $column->getPhpType());
$this->assertSame('bool', $column->getPhpType());
$this->assertTrue($column->isPhpPrimitiveType());
$this->assertTrue($column->isBooleanType());
}
Expand Down

0 comments on commit a3dc074

Please sign in to comment.