From 143e8d13445ee071602699c2a96d792a7051ec96 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Wed, 21 Jul 2021 06:57:00 -0700 Subject: [PATCH 1/2] Do not call strlen() on null (#657) --- src/JsonSchema/Constraints/Constraint.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/JsonSchema/Constraints/Constraint.php b/src/JsonSchema/Constraints/Constraint.php index a53130df..c61b89ad 100644 --- a/src/JsonSchema/Constraints/Constraint.php +++ b/src/JsonSchema/Constraints/Constraint.php @@ -42,10 +42,15 @@ abstract class Constraint extends BaseConstraint implements ConstraintInterface protected function incrementPath(JsonPointer $path = null, $i) { $path = $path ?: new JsonPointer(''); + + if ($i === null || $i === '') { + return $path; + } + $path = $path->withPropertyPaths( array_merge( $path->getPropertyPaths(), - array_filter(array($i), 'strlen') + array($i) ) ); From d073570dee3ab48a0a12362cd111fc22e0647d4c Mon Sep 17 00:00:00 2001 From: Guilliam Xavier Date: Wed, 21 Jul 2021 16:18:28 +0200 Subject: [PATCH 2/2] Fix CI (php-cs-fixer, HHVM) (#662) --- .php_cs.dist | 1 + .travis.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.php_cs.dist b/.php_cs.dist index 5a7a578e..a9e7e4ed 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -26,6 +26,7 @@ $config 'trailing_comma_in_multiline_array' => false, 'yoda_style' => false, 'phpdoc_types_order' => array('null_adjustment' => 'none', 'sort_algorithm' => 'none'), + 'no_superfluous_phpdoc_tags' => false, )) ->setFinder($finder) ; diff --git a/.travis.yml b/.travis.yml index 0573330b..ca5eced3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,7 @@ matrix: dist: trusty allow_failures: - php: nightly + - php: hhvm-3.18 before_install: - if [[ "$WITH_COVERAGE" != "true" && "$TRAVIS_PHP_VERSION" != "hhvm-3.18" && "$TRAVIS_PHP_VERSION" != "nightly" && "$TRAVIS_PHP_VERSION" != "7.1" ]]; then phpenv config-rm xdebug.ini; fi