Skip to content

Commit

Permalink
Merge pull request #631 from Ayesh/5.x-backports
Browse files Browse the repository at this point in the history
Backports for 5.2.10: Fixes in build process and PHP 8
  • Loading branch information
bighappyface committed May 27, 2020
2 parents 44c6787 + 0e9cd68 commit 2ba9c8c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitattributes
@@ -1,5 +1,6 @@
/docs export-ignore
/tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
phpunit.dist.xml export-ignore
16 changes: 8 additions & 8 deletions .travis.yml
@@ -1,4 +1,3 @@
sudo: false
language: php

cache:
Expand All @@ -23,19 +22,20 @@ matrix:
- php: 7.1
- php: 7.2
- php: 7.3
- php: 'nightly'
- php: hhvm
- php: 7.4
- php: nightly
- php: hhvm-3.18
dist: trusty
allow_failures:
- php: 'nightly'
- php: hhvm
- php: nightly

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

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

script:
- if [[ "$WITH_COVERAGE" == "true" ]]; then ./vendor/bin/phpunit --coverage-text; else composer test; fi
Expand Down
6 changes: 3 additions & 3 deletions bin/validate-json
Expand Up @@ -37,7 +37,7 @@ $arOptions = array();
$arArgs = array();
array_shift($argv);//script itself
foreach ($argv as $arg) {
if ($arg{0} == '-') {
if ($arg[0] == '-') {
$arOptions[$arg] = true;
} else {
$arArgs[] = $arg;
Expand Down Expand Up @@ -95,7 +95,7 @@ function getUrlFromPath($path)
//already an URL
return $path;
}
if ($path{0} == '/') {
if ($path[0] == '/') {
//absolute path
return 'file://' . $path;
}
Expand Down Expand Up @@ -200,7 +200,7 @@ if ($pathSchema === null) {
exit(6);
}
}
if ($pathSchema{0} == '/') {
if ($pathSchema[0] == '/') {
$pathSchema = 'file://' . $pathSchema;
}

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -31,7 +31,7 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1",
"json-schema/JSON-Schema-Test-Suite": "1.2.0",
"json-schema/json-schema-test-suite": "1.2.0",
"phpunit/phpunit": "^4.8.35"
},
"extra": {
Expand All @@ -53,7 +53,7 @@
{
"type": "package",
"package": {
"name": "json-schema/JSON-Schema-Test-Suite",
"name": "json-schema/json-schema-test-suite",
"version": "1.2.0",
"source": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions src/JsonSchema/Constraints/UndefinedConstraint.php
Expand Up @@ -59,7 +59,7 @@ public function check(&$value, $schema = null, JsonPointer $path = null, $i = nu
* @param JsonPointer $path
* @param string $i
*/
public function validateTypes(&$value, $schema = null, JsonPointer $path, $i = null)
public function validateTypes(&$value, $schema, JsonPointer $path, $i = null)
{
// check array
if ($this->getTypeCheck()->isArray($value)) {
Expand Down Expand Up @@ -105,7 +105,7 @@ public function validateTypes(&$value, $schema = null, JsonPointer $path, $i = n
* @param JsonPointer $path
* @param string $i
*/
protected function validateCommonProperties(&$value, $schema = null, JsonPointer $path, $i = '')
protected function validateCommonProperties(&$value, $schema, JsonPointer $path, $i = '')
{
// if it extends another schema, it must pass that schema as well
if (isset($schema->extends)) {
Expand Down Expand Up @@ -151,7 +151,7 @@ protected function validateCommonProperties(&$value, $schema = null, JsonPointer
);
}
} else {
// If the value is both undefined and not required, skip remaining checks
// if the value is both undefined and not required, skip remaining checks
// in this method which assume an actual, defined instance when validating.
if ($value instanceof self) {
return;
Expand Down

0 comments on commit 2ba9c8c

Please sign in to comment.