Skip to content

Commit 2ab6744

Browse files
authored
Merge pull request jsonrainbow#669 from Seldaek/backports_php81
Backports PHP 8.1 fixes
2 parents 2ba9c8c + d073570 commit 2ab6744

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.php_cs.dist

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ $config
2626
'trailing_comma_in_multiline_array' => false,
2727
'yoda_style' => false,
2828
'phpdoc_types_order' => array('null_adjustment' => 'none', 'sort_algorithm' => 'none'),
29+
'no_superfluous_phpdoc_tags' => false,
2930
))
3031
->setFinder($finder)
3132
;

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ matrix:
2828
dist: trusty
2929
allow_failures:
3030
- php: nightly
31+
- php: hhvm-3.18
3132

3233
before_install:
3334
- 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

src/JsonSchema/Constraints/Constraint.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,15 @@ abstract class Constraint extends BaseConstraint implements ConstraintInterface
4242
protected function incrementPath(JsonPointer $path = null, $i)
4343
{
4444
$path = $path ?: new JsonPointer('');
45+
46+
if ($i === null || $i === '') {
47+
return $path;
48+
}
49+
4550
$path = $path->withPropertyPaths(
4651
array_merge(
4752
$path->getPropertyPaths(),
48-
array_filter(array($i), 'strlen')
53+
array($i)
4954
)
5055
);
5156

0 commit comments

Comments
 (0)