Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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