From c1cc2754433588cf5271c433337876eca25db0f7 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 14 Dec 2022 14:51:33 +1300 Subject: [PATCH] ENH PHP 8.2 support --- composer.json | 2 +- src/Control/HTTPRequest.php | 2 +- src/Core/Manifest/ClassManifest.php | 1 + src/ORM/Connect/MySQLDatabase.php | 2 ++ src/ORM/Connect/MySQLStatement.php | 1 - src/View/ViewableData.php | 1 + thirdparty/php-peg/Parser.php | 7 +++++++ 7 files changed, 13 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 7f33acac9b9..dd2d9504b52 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "composer/installers": "^2.2", "guzzlehttp/guzzle": "^7.5.0", "guzzlehttp/psr7": "^2.4.0", - "embed/embed": "^4.4.4", + "embed/embed": "^4.4.7", "league/csv": "^9.8.0", "m1/env": "^2.2.0", "monolog/monolog": "^3.2.0", diff --git a/src/Control/HTTPRequest.php b/src/Control/HTTPRequest.php index 2ceb7e23941..db22f8d4165 100644 --- a/src/Control/HTTPRequest.php +++ b/src/Control/HTTPRequest.php @@ -579,7 +579,7 @@ public function match($pattern, $shiftOnSuccess = false) $shiftCount = sizeof($patternParts ?? []); $remaining = count($this->dirParts ?? []) - $i; for ($j = 1; $j <= $remaining; $j++) { - $arguments["$${j}"] = $this->dirParts[$j + $i - 1]; + $arguments['$' . $j] = $this->dirParts[$j + $i - 1]; } $patternParts = array_merge($patternParts, array_keys($arguments ?? [])); break; diff --git a/src/Core/Manifest/ClassManifest.php b/src/Core/Manifest/ClassManifest.php index 9d406620dfe..a97137be15b 100644 --- a/src/Core/Manifest/ClassManifest.php +++ b/src/Core/Manifest/ClassManifest.php @@ -23,6 +23,7 @@ * * To be consistent; In general all array keys are lowercase, and array values are correct-case */ +#[\AllowDynamicProperties] class ClassManifest { /** diff --git a/src/ORM/Connect/MySQLDatabase.php b/src/ORM/Connect/MySQLDatabase.php index ef7cd1601a5..b80e02054b3 100644 --- a/src/ORM/Connect/MySQLDatabase.php +++ b/src/ORM/Connect/MySQLDatabase.php @@ -65,6 +65,8 @@ class MySQLDatabase extends Database implements TransactionManager */ private $transactionManager = null; + private int $transactionNesting = 0; + /** * Default collation * diff --git a/src/ORM/Connect/MySQLStatement.php b/src/ORM/Connect/MySQLStatement.php index da687898885..81edf8c50fe 100644 --- a/src/ORM/Connect/MySQLStatement.php +++ b/src/ORM/Connect/MySQLStatement.php @@ -73,7 +73,6 @@ public function __construct($statement, $metadata) public function __destruct() { $this->statement->close(); - $this->currentRecord = false; } /** diff --git a/src/View/ViewableData.php b/src/View/ViewableData.php index 2440a5cacf0..b4bf65ca130 100644 --- a/src/View/ViewableData.php +++ b/src/View/ViewableData.php @@ -28,6 +28,7 @@ * is provided and automatically escaped by ViewableData. Any class that needs to be available to a view (controllers, * {@link DataObject}s, page controls) should inherit from this class. */ +#[\AllowDynamicProperties] class ViewableData implements IteratorAggregate { use Extensible { diff --git a/thirdparty/php-peg/Parser.php b/thirdparty/php-peg/Parser.php index 1ce89193e72..bcb57ce06da 100644 --- a/thirdparty/php-peg/Parser.php +++ b/thirdparty/php-peg/Parser.php @@ -9,6 +9,13 @@ * the bracket if a failed match + restore has moved the current position backwards - so we have to check that too. */ class ParserRegexp { + + public $parser; + public $rx; + public $matches; + public $match_pos; + public $check_pos; + function __construct( $parser, $rx ) { $this->parser = $parser ; $this->rx = $rx . 'Sx' ;