From 77746c246a437ee91087d61a6c27b539c650cc29 Mon Sep 17 00:00:00 2001 From: Steven Lewis Date: Sun, 7 Nov 2021 09:14:16 +0000 Subject: [PATCH] Apply suggestions from code review Co-authored-by: kenjis --- src/AbstractExtendedPdo.php | 12 ++++++------ src/PdoInterface.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/AbstractExtendedPdo.php b/src/AbstractExtendedPdo.php index df4b4ae7..974bc83b 100644 --- a/src/AbstractExtendedPdo.php +++ b/src/AbstractExtendedPdo.php @@ -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; } @@ -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; } @@ -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(); @@ -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); @@ -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); diff --git a/src/PdoInterface.php b/src/PdoInterface.php index fbd6357e..6e86a687 100644 --- a/src/PdoInterface.php +++ b/src/PdoInterface.php @@ -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. *