diff --git a/.travis.yml b/.travis.yml index d814ff93b..81cd29536 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,12 @@ language: php env: global: - XDEBUG_MODE=coverage + +services: + - mysql + - postgresql + + matrix: include: - php: 5.3 @@ -23,6 +29,8 @@ matrix: dist: trusty - php: 7.4 dist: trusty + - php: 8.0 + dist: xenial before_script: diff --git a/RedBeanPHP/DuplicationManager.php b/RedBeanPHP/DuplicationManager.php index b5bb93b99..290fdd20e 100644 --- a/RedBeanPHP/DuplicationManager.php +++ b/RedBeanPHP/DuplicationManager.php @@ -274,7 +274,7 @@ public function __construct( ToolBox $toolbox ) public function camelfy( $array, $dolphinMode = FALSE ) { $newArray = array(); foreach( $array as $key => $element ) { - $newKey = preg_replace_callback( '/_(\w)/', function( &$matches ){ + $newKey = preg_replace_callback( '/_(\w)/', function( $matches ){ return strtoupper( $matches[1] ); }, $key); diff --git a/testing/RedUNIT/Base/Finding.php b/testing/RedUNIT/Base/Finding.php index 52bbc5909..4c0d9cb89 100644 --- a/testing/RedUNIT/Base/Finding.php +++ b/testing/RedUNIT/Base/Finding.php @@ -257,7 +257,7 @@ public function testPreloadingOwnListWithMulti() asrt(count($book->noLoad()->ownPageList),2); asrt($book->title,"book{$i}"); $pages = $book->noLoad()->ownPageList; - usort($pages, function($a,$b){ return $a->title > $b->title; }); + usort($pages, function($a,$b){ return strcmp( $a->title, $b->title ); }); $first = reset($pages); asrt( $first->title, "1/$i" ); $last = end($pages); diff --git a/testing/RedUNIT/Base/Misc.php b/testing/RedUNIT/Base/Misc.php index 22d2f9b3f..4ac9b634e 100644 --- a/testing/RedUNIT/Base/Misc.php +++ b/testing/RedUNIT/Base/Misc.php @@ -271,7 +271,7 @@ public function testBeautifulColumnNames() asrt( ( $town->name == 'BeautyVille' ), TRUE ); testpack( 'Accept datetime objects.' ); $cal = R::dispense( 'calendar' ); - $cal->when = new\DateTime( '2000-01-01', new\DateTimeZone( 'Pacific/Nauru' ) ); + $cal->when = new \DateTime( '2000-01-01', new \DateTimeZone( 'Pacific/Nauru' ) ); asrt( $cal->when, '2000-01-01 00:00:00' ); testpack( 'Affected rows test' ); $currentDriver = $this->currentlyActiveDriverID; diff --git a/testing/RedUNIT/Base/Typechecking.php b/testing/RedUNIT/Base/Typechecking.php index 04b25c033..970239925 100644 --- a/testing/RedUNIT/Base/Typechecking.php +++ b/testing/RedUNIT/Base/Typechecking.php @@ -63,7 +63,7 @@ public function testTypes() $bean->bool2 = TRUE; $bean->text = 'abc'; $bean->null = null; - $bean->datetime = new\DateTime( 'NOW', new\DateTimeZone( 'Europe/Amsterdam' ) ); + $bean->datetime = new \DateTime( 'NOW', new \DateTimeZone( 'Europe/Amsterdam' ) ); $id = R::store( $bean ); asrt( is_int( $id ), TRUE ); asrt( is_float( $bean->float ), TRUE ); diff --git a/testing/RedUNIT/Blackhole/Misc.php b/testing/RedUNIT/Blackhole/Misc.php index 108e9e2f4..9c6eb5759 100644 --- a/testing/RedUNIT/Blackhole/Misc.php +++ b/testing/RedUNIT/Blackhole/Misc.php @@ -363,7 +363,7 @@ public function testTransactionInFacade() R::transaction( function () use ( $bean ) { R::store( $bean ); R::transaction( function () { - throw new\Exception(); + throw new \Exception(); } ); } ); } catch (\Exception $e ) { @@ -376,7 +376,7 @@ public function testTransactionInFacade() R::transaction( function () use ( $bean ) { R::transaction( function () use ( $bean ) { R::store( $bean ); - throw new\Exception(); + throw new \Exception(); } ); } ); } catch (\Exception $e ) {