From 6efe6ecefea11f05cd7e436dc72ec1138417447d Mon Sep 17 00:00:00 2001 From: "Chun-Sheng, Li" Date: Sun, 5 Apr 2020 14:28:07 +0800 Subject: [PATCH 1/7] Use lowercase package name for test suite (#614) Resolves #613 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 884a6971..fcacd40c 100644 --- a/composer.json +++ b/composer.json @@ -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": { @@ -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", From 9a34c57d8f7bd820601b62b146704cc51486719b Mon Sep 17 00:00:00 2001 From: Mathias Berchtold Date: Wed, 26 Feb 2020 19:01:01 -0500 Subject: [PATCH 2/7] Fix PHP 8 deprecated warnings (#619) This fixes issue https://github.com/justinrainbow/json-schema/issues/618 --- src/JsonSchema/Constraints/UndefinedConstraint.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/JsonSchema/Constraints/UndefinedConstraint.php b/src/JsonSchema/Constraints/UndefinedConstraint.php index e194cb0e..aaf714dd 100644 --- a/src/JsonSchema/Constraints/UndefinedConstraint.php +++ b/src/JsonSchema/Constraints/UndefinedConstraint.php @@ -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)) { @@ -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)) { From a38f509ee19e1915189dfc3d63f59162a5b6c39b Mon Sep 17 00:00:00 2001 From: Alexander Dmitryuk Date: Fri, 27 Dec 2019 11:52:10 +0700 Subject: [PATCH 3/7] Repleace deprecated curved brackets (#607) --- bin/validate-json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/validate-json b/bin/validate-json index 3619bf59..d2102fe9 100755 --- a/bin/validate-json +++ b/bin/validate-json @@ -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; @@ -95,7 +95,7 @@ function getUrlFromPath($path) //already an URL return $path; } - if ($path{0} == '/') { + if ($path[0] == '/') { //absolute path return 'file://' . $path; } @@ -200,7 +200,7 @@ if ($pathSchema === null) { exit(6); } } -if ($pathSchema{0} == '/') { +if ($pathSchema[0] == '/') { $pathSchema = 'file://' . $pathSchema; } From e190b04a8979864721218ad943e73e49d4e3997a Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Fri, 20 Dec 2019 10:06:59 +0000 Subject: [PATCH 4/7] Test on PHP 7.4 and HHVM (3.18 explicitly) (#605) * Test on PHP 7.4 and HHVM (3.18 explicitly) * Update .travis.yml --- .travis.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index be79e9fe..7a05526b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,3 @@ -sudo: false language: php cache: @@ -23,16 +22,17 @@ 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 + - php: hhvm-3.18 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 From f140a46bf6febde45715da0d9c6eb17f3f07b0c7 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Mon, 17 Feb 2020 17:35:42 +0000 Subject: [PATCH 5/7] Further travis tweaks (#606) --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7a05526b..0573330b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,14 +28,14 @@ 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 - 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 From 0222bebfd22fc4acece71b8000b1f10e77af5c4c Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Tue, 12 Nov 2019 03:01:15 -0500 Subject: [PATCH 6/7] Add .gitattributes to .gitattributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index beeff5b8..7d46ab97 100644 --- a/.gitattributes +++ b/.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 From 0e9cd68669867b6db241472a30f8cabe2dc06a5c Mon Sep 17 00:00:00 2001 From: Erayd Date: Wed, 27 Feb 2019 10:30:31 +1300 Subject: [PATCH 7/7] Most body comments in this project do not start uppercase --- src/JsonSchema/Constraints/UndefinedConstraint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JsonSchema/Constraints/UndefinedConstraint.php b/src/JsonSchema/Constraints/UndefinedConstraint.php index aaf714dd..8effd4ba 100644 --- a/src/JsonSchema/Constraints/UndefinedConstraint.php +++ b/src/JsonSchema/Constraints/UndefinedConstraint.php @@ -151,7 +151,7 @@ protected function validateCommonProperties(&$value, $schema, JsonPointer $path, ); } } 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;