Skip to content

Commit

Permalink
Fix type errors reported by PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Nov 14, 2018
1 parent 3aee7f9 commit 2419e28
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function query(string $sql) : ResultStatement
public function quote($value, $type = ParameterType::STRING) : string
{
if (is_int($value) || is_float($value)) {
return $value;
return (string) $value;
}
$value = str_replace("'", "''", $value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function query(string $sql) : ResultStatement
public function quote($input, $type = ParameterType::STRING) : string
{
if (is_int($input) || is_float($input)) {
return $input;
return (string) $input;
}

return "'" . sasql_escape_string($this->connection, $input) . "'";
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function query(string $sql) : ResultStatement
public function quote($value, $type = ParameterType::STRING) : string
{
if (is_int($value)) {
return $value;
return (string) $value;
} elseif (is_float($value)) {
return sprintf('%F', $value);
}
Expand Down

0 comments on commit 2419e28

Please sign in to comment.