Skip to content

Commit 7d1ce93

Browse files
committed
Improve PHP 8.1 compatibility.
1 parent 21efcfc commit 7d1ce93

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

Diff for: RedBeanPHP/Driver/RPDO.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,11 @@ protected function runQuery( $sql, $bindings, $options = array() )
187187
$this->resultArray = array();
188188
return $statement;
189189
}
190-
$this->resultArray = $statement->fetchAll( $fetchStyle );
190+
if ( is_null( $fetchStyle) ) {
191+
$this->resultArray = $statement->fetchAll();
192+
} else {
193+
$this->resultArray = $statement->fetchAll( $fetchStyle );
194+
}
191195
if ( $this->loggingEnabled && $this->logger ) {
192196
$this->logger->log( 'resultset: ' . count( $this->resultArray ) . ' rows' );
193197
}

Diff for: RedBeanPHP/OODBBean.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ public function setBeanHelper( BeanHelper $helper )
477477
*
478478
* @return ArrayIterator
479479
*/
480-
#[ReturnTypeWillChange]
480+
#[\ReturnTypeWillChange]
481481
public function getIterator()
482482
{
483483
return new \ArrayIterator( $this->properties );
@@ -1471,7 +1471,7 @@ public function __toString()
14711471
*
14721472
* @return void
14731473
*/
1474-
#[ReturnTypeWillChange]
1474+
#[\ReturnTypeWillChange]
14751475
public function offsetSet( $offset, $value )
14761476
{
14771477
$this->__set( $offset, $value );
@@ -1489,7 +1489,7 @@ public function offsetSet( $offset, $value )
14891489
*
14901490
* @return boolean
14911491
*/
1492-
#[ReturnTypeWillChange]
1492+
#[\ReturnTypeWillChange]
14931493
public function offsetExists( $offset )
14941494
{
14951495
return $this->__isset( $offset );
@@ -1508,7 +1508,7 @@ public function offsetExists( $offset )
15081508
*
15091509
* @return void
15101510
*/
1511-
#[ReturnTypeWillChange]
1511+
#[\ReturnTypeWillChange]
15121512
public function offsetUnset( $offset )
15131513
{
15141514
$this->__unset( $offset );
@@ -1527,7 +1527,7 @@ public function offsetUnset( $offset )
15271527
*
15281528
* @return mixed
15291529
*/
1530-
#[ReturnTypeWillChange]
1530+
#[\ReturnTypeWillChange]
15311531
public function &offsetGet( $offset )
15321532
{
15331533
return $this->__get( $offset );
@@ -1668,7 +1668,7 @@ public function traverse( $property, $function, $maxDepth = NULL, $depth = 1 )
16681668
*
16691669
* @return integer
16701670
*/
1671-
#[ReturnTypeWillChange]
1671+
#[\ReturnTypeWillChange]
16721672
public function count()
16731673
{
16741674
return count( $this->properties );
@@ -2276,7 +2276,7 @@ public function equals(OODBBean $bean)
22762276
*
22772277
* @return array
22782278
*/
2279-
#[ReturnTypeWillChange]
2279+
#[\ReturnTypeWillChange]
22802280
public function jsonSerialize()
22812281
{
22822282
$json = $this->__call( '@__jsonSerialize', array( ) );

0 commit comments

Comments
 (0)