Skip to content

Commit

Permalink
PHP 7.3+ Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
rotimi authored and rotimi committed Apr 14, 2021
1 parent d799749 commit 2df7865
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ jobs:

strategy:
matrix:
php: [8.0, 7.4, 7.3, 7.2]
php: [8.0, 7.4, 7.3]
# prefer-lowest is causing unit tests to fail when php 7.2 is run against PHPunit 7.x,
# PHPUnit 8.x is the latest stable release that supports PHP 7.2 and that runs fine
# dependency-version: [prefer-lowest, prefer-stable]
dependency-version: [prefer-stable]
os: [ubuntu-18.04, ubuntu-20.04]
include:
- os: ubuntu-18.04
php: 7.2
- os: ubuntu-18.04
php: 7.3
- os: ubuntu-18.04
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
}
],
"require": {
"php": ">=7.2",
"php": ">=7.3",
"laminas/laminas-escaper": "^2.6.1"
},
"require-dev": {
"phpunit/phpunit": "^9.0 || ^8.0",
"phpunit/phpunit": "^9.0",
"php-coveralls/php-coveralls": "^2.0",
"rector/rector": "^0.10.4 || ^0.8.56",
"rector/rector": "^0.10.4",
"vimeo/psalm": "^4.7"
},
"autoload": {
Expand Down
4 changes: 2 additions & 2 deletions rector.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

declare(strict_types=1);

use Rector\Core\Configuration\Option;
Expand All @@ -9,6 +8,7 @@


return static function (ContainerConfigurator $containerConfigurator): void {

// get parameters
$parameters = $containerConfigurator->parameters();

Expand All @@ -23,7 +23,7 @@
SetList::PHP_71,
SetList::PHP_72,
SetList::DEAD_CODE,
//SetList::PHP_73,
SetList::PHP_73,
//SetList::PHP_74,
//SetList::PHP_80,
SetList::DEAD_CODE,
Expand Down
4 changes: 2 additions & 2 deletions src/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ protected function escapeData(
return;
}

$hash_of_data_array = spl_object_hash(json_decode(json_encode($data)));
$hash_of_data_array = spl_object_hash(json_decode(json_encode($data, JSON_THROW_ON_ERROR), false, 512, JSON_THROW_ON_ERROR));

if(
array_key_exists($hash_of_data_array, $this->multi_escape_prevention_guard)
Expand Down Expand Up @@ -896,7 +896,7 @@ protected function escapeData(

//add the hash of the data array we have just escaped to the list of
//hashes of escaped data arrays
$hash_of_escaped_data_array = spl_object_hash(json_decode(json_encode($data)));
$hash_of_escaped_data_array = spl_object_hash(json_decode(json_encode($data, JSON_THROW_ON_ERROR), false, 512, JSON_THROW_ON_ERROR));

$this->multi_escape_prevention_guard[$hash_of_escaped_data_array] = array(
'escape_encoding'=>$escape_encoding,
Expand Down

0 comments on commit 2df7865

Please sign in to comment.