Skip to content

Commit

Permalink
Merge pull request #229 from mlocati/fix-php8.1-strlen-null
Browse files Browse the repository at this point in the history
Fix PHP 8.1 warning: passing null to string parameter
  • Loading branch information
mlocati authored Jun 29, 2021
2 parents 7db8ffe + b339dbe commit e547420
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 3 deletions.
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"scripts": {
"cs-fix": "php-cs-fixer fix --path-mode=intersection --config=./.php_cs.dist --ansi .",
"cs-check": "php-cs-fixer fix --path-mode=intersection --config=.php_cs.dist --ansi --dry-run --diff --diff-format=udiff .",
"cs-check": "php-cs-fixer fix --path-mode=intersection --config=.php_cs.dist --ansi --dry-run --diff --diff-format=udiff .",
"test": "atoum --force-terminal && ./vendor/bin/behat --suite pickle --colors"
},
"extra": {
Expand All @@ -66,6 +66,9 @@
},
"hoa/stream:1.17.02.21": {
"PHP 8 fixes": "patches/hoa/stream/0001-Fix-PHP-8-compatibility.patch"
},
"justinrainbow/json-schema:5.2.10": {
"PHP 8.1 fixes": "patches/justinrainbow/json-schema/0001-PHP-8.1-fixes.patch"
}
}
}
Expand Down
43 changes: 41 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions patches/justinrainbow/json-schema/0001-PHP-8.1-fixes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
From: Michele Locati <[email protected]>
Date: Tue, 29 Jun 2021 18:08:46 +0200
Subject: [PATCH] PHP 8.1 patched

---
src/JsonSchema/Constraints/Constraint.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/JsonSchema/Constraints/Constraint.php b/src/JsonSchema/Constraints/Constraint.php
--- a/src/JsonSchema/Constraints/Constraint.php
+++ b/src/JsonSchema/Constraints/Constraint.php
@@ -45,7 +45,7 @@ abstract class Constraint extends BaseConstraint implements ConstraintInterface
$path = $path->withPropertyPaths(
array_merge(
$path->getPropertyPaths(),
- array_filter(array($i), 'strlen')
+ array_filter(array((string) $i), 'strlen')
)
);

0 comments on commit e547420

Please sign in to comment.