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 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) ) );