Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backports PHP 8.1 fixes #669

Merged
merged 2 commits into from Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .php_cs.dist
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
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
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