Skip to content

Commit 2ba9c8c

Browse files
authored
Merge pull request #631 from Ayesh/5.x-backports
Backports for 5.2.10: Fixes in build process and PHP 8
2 parents 44c6787 + 0e9cd68 commit 2ba9c8c

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/docs export-ignore
22
/tests export-ignore
3+
.gitattributes export-ignore
34
.gitignore export-ignore
45
.travis.yml export-ignore
56
phpunit.dist.xml export-ignore

.travis.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
sudo: false
21
language: php
32

43
cache:
@@ -23,19 +22,20 @@ matrix:
2322
- php: 7.1
2423
- php: 7.2
2524
- php: 7.3
26-
- php: 'nightly'
27-
- php: hhvm
25+
- php: 7.4
26+
- php: nightly
27+
- php: hhvm-3.18
2828
dist: trusty
2929
allow_failures:
30-
- php: 'nightly'
31-
- php: hhvm
30+
- php: nightly
3231

3332
before_install:
34-
- if [[ "$WITH_COVERAGE" != "true" && "$TRAVIS_PHP_VERSION" != "hhvm" && "$TRAVIS_PHP_VERSION" != "nightly" && "$TRAVIS_PHP_VERSION" != "7.1" ]]; then phpenv config-rm xdebug.ini; fi
35-
- if [[ "$TRAVIS_PHP_VERSION" = "hhvm" || "$TRAVIS_PHP_VERSION" = "nightly" ]]; then sed -i '/^.*friendsofphp\/php-cs-fixer.*$/d' composer.json; fi
33+
- 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
34+
- if [[ "$TRAVIS_PHP_VERSION" = "hhvm-3.18" || "$TRAVIS_PHP_VERSION" = "nightly" ]]; then sed -i '/^.*friendsofphp\/php-cs-fixer.*$/d' composer.json; fi
3635

3736
install:
38-
- travis_retry composer install --no-interaction --prefer-dist
37+
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then travis_retry composer install; fi
38+
- if [[ "$TRAVIS_PHP_VERSION" = "nightly" ]]; then travis_retry composer install --ignore-platform-reqs; fi
3939

4040
script:
4141
- if [[ "$WITH_COVERAGE" == "true" ]]; then ./vendor/bin/phpunit --coverage-text; else composer test; fi

bin/validate-json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $arOptions = array();
3737
$arArgs = array();
3838
array_shift($argv);//script itself
3939
foreach ($argv as $arg) {
40-
if ($arg{0} == '-') {
40+
if ($arg[0] == '-') {
4141
$arOptions[$arg] = true;
4242
} else {
4343
$arArgs[] = $arg;
@@ -95,7 +95,7 @@ function getUrlFromPath($path)
9595
//already an URL
9696
return $path;
9797
}
98-
if ($path{0} == '/') {
98+
if ($path[0] == '/') {
9999
//absolute path
100100
return 'file://' . $path;
101101
}
@@ -200,7 +200,7 @@ if ($pathSchema === null) {
200200
exit(6);
201201
}
202202
}
203-
if ($pathSchema{0} == '/') {
203+
if ($pathSchema[0] == '/') {
204204
$pathSchema = 'file://' . $pathSchema;
205205
}
206206

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"require-dev": {
3333
"friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1",
34-
"json-schema/JSON-Schema-Test-Suite": "1.2.0",
34+
"json-schema/json-schema-test-suite": "1.2.0",
3535
"phpunit/phpunit": "^4.8.35"
3636
},
3737
"extra": {
@@ -53,7 +53,7 @@
5353
{
5454
"type": "package",
5555
"package": {
56-
"name": "json-schema/JSON-Schema-Test-Suite",
56+
"name": "json-schema/json-schema-test-suite",
5757
"version": "1.2.0",
5858
"source": {
5959
"type": "git",

src/JsonSchema/Constraints/UndefinedConstraint.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function check(&$value, $schema = null, JsonPointer $path = null, $i = nu
5959
* @param JsonPointer $path
6060
* @param string $i
6161
*/
62-
public function validateTypes(&$value, $schema = null, JsonPointer $path, $i = null)
62+
public function validateTypes(&$value, $schema, JsonPointer $path, $i = null)
6363
{
6464
// check array
6565
if ($this->getTypeCheck()->isArray($value)) {
@@ -105,7 +105,7 @@ public function validateTypes(&$value, $schema = null, JsonPointer $path, $i = n
105105
* @param JsonPointer $path
106106
* @param string $i
107107
*/
108-
protected function validateCommonProperties(&$value, $schema = null, JsonPointer $path, $i = '')
108+
protected function validateCommonProperties(&$value, $schema, JsonPointer $path, $i = '')
109109
{
110110
// if it extends another schema, it must pass that schema as well
111111
if (isset($schema->extends)) {
@@ -151,7 +151,7 @@ protected function validateCommonProperties(&$value, $schema = null, JsonPointer
151151
);
152152
}
153153
} else {
154-
// If the value is both undefined and not required, skip remaining checks
154+
// if the value is both undefined and not required, skip remaining checks
155155
// in this method which assume an actual, defined instance when validating.
156156
if ($value instanceof self) {
157157
return;

0 commit comments

Comments
 (0)