Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: kenjis <[email protected]>
  • Loading branch information
srjlewis and kenjis authored Nov 7, 2021
1 parent aa574c9 commit 77746c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/AbstractExtendedPdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ public function perform(string $statement, array $values = []): PDOStatement
public function prepare(string $query, array $options = []): PDOStatement
{
$this->connect();
$sth = $this->pdo->prepare($statement, $options);
$sth = $this->pdo->prepare($query, $options);
return $sth;
}

Expand Down Expand Up @@ -643,11 +643,11 @@ public function prepareWithValues(string $statement, array $values = []): PDOSta
* @see http://php.net/manual/en/pdo.query.php
*
*/
public function query($statement, $fetchMode = null, mixed ...$fetch_mode_args): PDOStatement
public function query(string $query, ?int $fetchMode = null, mixed ...$fetch_mode_args): PDOStatement
{
$this->connect();
$this->profiler->start(__FUNCTION__);
$sth = $this->pdo->query($statement, $fetchMode, ...$fetch_mode_args);
$sth = $this->pdo->query($query, $fetchMode, ...$fetch_mode_args);
$this->profiler->finish($sth->queryString);
return $sth;
}
Expand All @@ -668,7 +668,7 @@ public function query($statement, $fetchMode = null, mixed ...$fetch_mode_args):
* @see http://php.net/manual/en/pdo.quote.php
*
*/
public function quote(mixed $value, int $type = self::PARAM_STR): string
public function quote(string|int|array|float|null $value, int $type = self::PARAM_STR): string
{
$this->connect();

Expand Down Expand Up @@ -990,7 +990,7 @@ protected function setQuoteName(string $driver): void
* @param int $attribute
* @return mixed
*/
public function getAttribute(int $attribute): mixed
public function getAttribute(int $attribute): bool|int|string|array|null
{
$this->connect();
return $this->pdo->getAttribute($attribute);
Expand All @@ -1004,7 +1004,7 @@ public function getAttribute(int $attribute): mixed
* @param mixed $value
* @return bool
*/
public function setAttribute(int $attribute, mixed$value): bool
public function setAttribute(int $attribute, mixed $value): bool
{
$this->connect();
return $this->pdo->setAttribute($attribute, $value);
Expand Down
2 changes: 1 addition & 1 deletion src/PdoInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function query(string $query, ?int $fetchMode = null, ...$fetch_mode_args
*
* @param mixed $value The value to quote.
*
* @param int $parameter_type A data type hint for the database driver.
* @param int $type A data type hint for the database driver.
*
* @return string|false The quoted value.
*
Expand Down

0 comments on commit 77746c2

Please sign in to comment.