Skip to content

Commit

Permalink
1.99.1
Browse files Browse the repository at this point in the history
- PHP 7.4 & 8.* version
- fix PHP8 bugs
  • Loading branch information
Karel Wintersky committed Sep 12, 2024
1 parent 67f256f commit cb26b19
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/Queries/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ protected function resetClause($clause)
*
* @throws Exception
*/
#[\ReturnTypeWillChange]
public function getIterator()
{
return $this->execute();
Expand All @@ -204,7 +205,7 @@ public function getIterator()
/**
* Execute query with earlier added parameters
*
* @return \PDOStatement
* @return \PDOStatement|null
*
* @throws Exception
*/
Expand Down
16 changes: 11 additions & 5 deletions src/Queries/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,12 @@ public function fetch(?string $column = null, int $cursorOrientation = \PDO::FET
if ($this->result === false) {
return false;
}

$row = $this->result->fetch( $this->currentFetchMode, $cursorOrientation );

if (is_null($this->currentFetchMode)) {
$row = $this->result->fetch( \PDO::FETCH_ASSOC, $cursorOrientation );
} else {
$row = $this->result->fetch( $this->currentFetchMode, $cursorOrientation );
}

if ($this->fluent->convertRead === true) {
$row = Utilities::stringToNumeric( $this->result, $row );
Expand Down Expand Up @@ -183,7 +187,7 @@ public function fetchAll($index = '', $selectOnly = '')
}

if ($selectOnly) {
$this->select( $index.', '.$selectOnly, true );
$this->select( $index . ', ' . $selectOnly, true );
}

if ($index) {
Expand All @@ -208,7 +212,8 @@ public function fetchAll($index = '', $selectOnly = '')
* @throws Exception
*
*/
public function count()
#[\ReturnTypeWillChange]
public function count(): int
{
$fluent = clone $this;

Expand All @@ -220,6 +225,7 @@ public function count()
* @throws Exception
*
*/
#[\ReturnTypeWillChange]
public function getIterator()
{
if ($this->fluent->convertRead === true) {
Expand All @@ -235,7 +241,7 @@ public function getIterator()
*
* @return array
*/
private function buildSelectData($index, $indexAsArray)
private function buildSelectData($index, $indexAsArray): array
{
$data = [];

Expand Down

0 comments on commit cb26b19

Please sign in to comment.