Skip to content

Commit

Permalink
ENH PHP 8.2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Dec 14, 2022
1 parent bf440e4 commit ba20b48
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/Control/HTTPRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/ORM/Connect/MySQLDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class MySQLDatabase extends Database implements TransactionManager
*/
private $transactionManager = null;

private int $transactionNesting = 0;

/**
* Default collation
*
Expand Down
1 change: 0 additions & 1 deletion src/ORM/Connect/MySQLStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public function __construct($statement, $metadata)
public function __destruct()
{
$this->statement->close();
$this->currentRecord = false;
}

/**
Expand Down
8 changes: 5 additions & 3 deletions src/View/ViewableData.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class ViewableData implements IteratorAggregate
*/
private static $casting_cache = [];

private array $data = [];

// -----------------------------------------------------------------------------------------------------------------

/**
Expand Down Expand Up @@ -191,7 +193,7 @@ public function getFailover()
*/
public function hasField($field)
{
return property_exists($this, $field ?? '');
return isset($this->data[$field]);
}

/**
Expand All @@ -202,7 +204,7 @@ public function hasField($field)
*/
public function getField($field)
{
return $this->$field;
return $this->data[$field];
}

/**
Expand All @@ -215,7 +217,7 @@ public function getField($field)
public function setField($field, $value)
{
$this->objCacheClear();
$this->$field = $value;
$this->data[$field] = $value;
return $this;
}

Expand Down
7 changes: 7 additions & 0 deletions thirdparty/php-peg/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ;
Expand Down

0 comments on commit ba20b48

Please sign in to comment.