Skip to content

Commit

Permalink
Merge pull request #669 from Seldaek/backports_php81
Browse files Browse the repository at this point in the history
Backports PHP 8.1 fixes
  • Loading branch information
Seldaek authored Jul 22, 2021
2 parents 2ba9c8c + d073570 commit 2ab6744
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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)
;
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/JsonSchema/Constraints/Constraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
);

Expand Down

0 comments on commit 2ab6744

Please sign in to comment.