Skip to content

Commit

Permalink
fix return types
Browse files Browse the repository at this point in the history
  • Loading branch information
jwong-dayspring committed Jan 3, 2024
1 parent 1309769 commit 33e5b5d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions runtime/lib/connection/PropelPDO.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function isCommitable()
*
* @return boolean
*/
public function beginTransaction()
public function beginTransaction(): bool
{
$return = true;
if (!$this->nestedTransactionCount) {
Expand All @@ -252,7 +252,7 @@ public function beginTransaction()
*
* @throws PropelException
*/
public function commit()
public function commit(): bool
{
$return = true;
$opcount = $this->nestedTransactionCount;
Expand Down Expand Up @@ -281,7 +281,7 @@ public function commit()
*
* @return boolean Whether operation was successful.
*/
public function rollBack()
public function rollBack(): bool
{
$return = true;
$opcount = $this->nestedTransactionCount;
Expand Down Expand Up @@ -337,19 +337,19 @@ public function forceRollBack()
* @param integer $attribute The attribute to set (e.g. PropelPDO::PROPEL_ATTR_CACHE_PREPARES).
* @param mixed $value The attribute value.
*
* @return void
* @return boolean
*/
public function setAttribute($attribute, $value)
public function setAttribute($attribute, $value): bool
{
switch ($attribute) {
case self::PROPEL_ATTR_CACHE_PREPARES:
$this->cachePreparedStatements = $value;
break;
return true;
case self::PROPEL_ATTR_CONNECTION_NAME:
$this->connectionName = $value;
break;
return true;
default:
parent::setAttribute($attribute, $value);
return parent::setAttribute($attribute, $value);
}
}

Expand All @@ -362,7 +362,7 @@ public function setAttribute($attribute, $value)
*
* @return mixed
*/
public function getAttribute($attribute)
public function getAttribute($attribute): mixed
{
switch ($attribute) {
case self::PROPEL_ATTR_CACHE_PREPARES:
Expand All @@ -389,7 +389,7 @@ public function getAttribute($attribute)
*
* @return PDOStatement
*/
public function prepare($sql, $driver_options = array())
public function prepare($sql, $driver_options = array()): PDOStatement|false
{
if ($this->useDebug) {
$debug = $this->getDebugSnapshot();
Expand Down Expand Up @@ -421,7 +421,7 @@ public function prepare($sql, $driver_options = array())
*
* @return integer
*/
public function exec($sql)
public function exec($sql): int|false
{
if ($this->useDebug) {
$debug = $this->getDebugSnapshot();
Expand All @@ -448,7 +448,7 @@ public function exec($sql)
*
* @return PDOStatement
*/
public function query(string $statement, ?int $fetchMode = null, ...$fetchModeArgs)
public function query(string $statement, ?int $fetchMode = null, ...$fetchModeArgs): PDOStatement|false
{
$debug = null;

Expand Down Expand Up @@ -665,7 +665,7 @@ public function getDebugSnapshot()
'microtime' => microtime(true),
'memory_get_usage' => memory_get_usage($this->getLoggingConfig('realmemoryusage', false)),
'memory_get_peak_usage' => memory_get_peak_usage($this->getLoggingConfig('realmemoryusage', false)),
);
);
} else {
throw new PropelException('Should not get debug snapshot when not debugging');
}
Expand Down

0 comments on commit 33e5b5d

Please sign in to comment.