diff --git a/.php_cs b/.php_cs index 3b63a310..981148fc 100644 --- a/.php_cs +++ b/.php_cs @@ -11,7 +11,7 @@ the LICENSE file that was distributed with this source code. @see https://github.com/localheinz/json-normalizer EOF; -$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php70($header), [ +$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71($header), [ 'mb_str_functions' => false, ]); diff --git a/.travis.yml b/.travis.yml index a6e29a03..31b5bd92 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ jobs: include: - stage: Style - php: 7.0 + php: 7.1 before_install: - source .travis/xdebug.sh @@ -40,7 +40,7 @@ jobs: stage: Test - php: 7.0 + php: 7.1 env: WITH_LOWEST=true @@ -63,24 +63,6 @@ jobs: after_success: - if [[ "$WITH_COVERAGE" == "true" ]]; then bash <(curl -s https://codecov.io/bash); fi - - <<: *TEST - - php: 7.0 - - env: WITH_LOCKED=true - - - <<: *TEST - - php: 7.0 - - env: WITH_HIGHEST=true - - - <<: *TEST - - php: 7.1 - - env: WITH_LOWEST=true - - <<: *TEST php: 7.1 diff --git a/composer.json b/composer.json index b45beaec..89fd5857 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": "^7.0", + "php": "^7.1", "justinrainbow/json-schema": "^4.0.0 || ^5.0.0", "localheinz/json-printer": "^1.0.0" }, diff --git a/composer.lock b/composer.lock index c41df9c3..2e3c47a1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "4b97b1368210cf73f4f1a1abe9208898", + "content-hash": "7056ef9d643e1a3512de88286980c8fa", "packages": [ { "name": "justinrainbow/json-schema", @@ -3652,7 +3652,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.0" + "php": "^7.1" }, "platform-dev": [] } diff --git a/test/Bench/SchemaNormalizerBench.php b/test/Bench/SchemaNormalizerBench.php index 1e15c4c0..36aad879 100644 --- a/test/Bench/SchemaNormalizerBench.php +++ b/test/Bench/SchemaNormalizerBench.php @@ -23,7 +23,7 @@ final class SchemaNormalizerBench * @Revs(5) * @Iterations(1) */ - public function benchNormalizeProjectComposerFile() + public function benchNormalizeProjectComposerFile(): void { $this->normalize( __DIR__ . '/../../composer.json', @@ -37,7 +37,7 @@ public function benchNormalizeProjectComposerFile() * @Revs(5) * @Iterations(1) */ - public function benchNormalizeLargeComposerFile() + public function benchNormalizeLargeComposerFile(): void { $this->normalize( __DIR__ . '/../Fixture/LargeComposerFile/composer.json', @@ -45,7 +45,7 @@ public function benchNormalizeLargeComposerFile() ); } - private function normalize(string $file, string $schemaUri) + private function normalize(string $file, string $schemaUri): void { $original = \file_get_contents($file); diff --git a/test/Unit/AbstractNormalizerTestCase.php b/test/Unit/AbstractNormalizerTestCase.php index daa2f0fa..00eb3058 100644 --- a/test/Unit/AbstractNormalizerTestCase.php +++ b/test/Unit/AbstractNormalizerTestCase.php @@ -21,12 +21,12 @@ abstract class AbstractNormalizerTestCase extends Framework\TestCase { use Helper; - final public function testImplementsNormalizerInterface() + final public function testImplementsNormalizerInterface(): void { $this->assertClassImplementsInterface(NormalizerInterface::class, $this->className()); } - final public function testNormalizeRejectsInvalidJson() + final public function testNormalizeRejectsInvalidJson(): void { $json = $this->faker()->realText(); diff --git a/test/Unit/AutoFormatNormalizerTest.php b/test/Unit/AutoFormatNormalizerTest.php index b95e42d2..782ae604 100644 --- a/test/Unit/AutoFormatNormalizerTest.php +++ b/test/Unit/AutoFormatNormalizerTest.php @@ -27,7 +27,7 @@ final class AutoFormatNormalizerTest extends AbstractNormalizerTestCase * @param bool $hasFinalNewLine * @param string $suffix */ - public function testNormalizeEncodesWithJsonEncodeOptionsIndentsAndPossiblySuffixesWithFinalNewLine(bool $hasFinalNewLine, string $suffix) + public function testNormalizeEncodesWithJsonEncodeOptionsIndentsAndPossiblySuffixesWithFinalNewLine(bool $hasFinalNewLine, string $suffix): void { $faker = $this->faker(); @@ -123,7 +123,7 @@ public function providerFinalNewLine(): \Generator ], ]; - foreach ($values as $key => list($hasFinalNewLine, $suffix)) { + foreach ($values as $key => [$hasFinalNewLine, $suffix]) { yield $key => [ $hasFinalNewLine, $suffix, diff --git a/test/Unit/CallableNormalizerTest.php b/test/Unit/CallableNormalizerTest.php index 5d835036..abb62a1d 100644 --- a/test/Unit/CallableNormalizerTest.php +++ b/test/Unit/CallableNormalizerTest.php @@ -22,7 +22,7 @@ final class CallableNormalizerTest extends AbstractNormalizerTestCase * * @param callable $callable */ - public function testNormalizePassesJsonThroughCallable(callable $callable) + public function testNormalizePassesJsonThroughCallable(callable $callable): void { $json = <<<'JSON' { diff --git a/test/Unit/ChainNormalizerTest.php b/test/Unit/ChainNormalizerTest.php index 39448d2e..656073da 100644 --- a/test/Unit/ChainNormalizerTest.php +++ b/test/Unit/ChainNormalizerTest.php @@ -19,7 +19,7 @@ final class ChainNormalizerTest extends AbstractNormalizerTestCase { - public function testNormalizePassesJsonThroughNormalizers() + public function testNormalizePassesJsonThroughNormalizers(): void { $count = $this->faker()->numberBetween(3, 5); diff --git a/test/Unit/FinalNewLineNormalizerTest.php b/test/Unit/FinalNewLineNormalizerTest.php index 6a2dbdf8..4aa14ccb 100644 --- a/test/Unit/FinalNewLineNormalizerTest.php +++ b/test/Unit/FinalNewLineNormalizerTest.php @@ -22,7 +22,7 @@ final class FinalNewLineNormalizerTest extends AbstractNormalizerTestCase * * @param string $whitespace */ - public function testNormalizeEnsuresSingleFinalNewLine(string $whitespace) + public function testNormalizeEnsuresSingleFinalNewLine(string $whitespace): void { $json = <<<'JSON' { diff --git a/test/Unit/FixedFormatNormalizerTest.php b/test/Unit/FixedFormatNormalizerTest.php index 0f7898b6..14d5d319 100644 --- a/test/Unit/FixedFormatNormalizerTest.php +++ b/test/Unit/FixedFormatNormalizerTest.php @@ -27,7 +27,7 @@ final class FixedFormatNormalizerTest extends AbstractNormalizerTestCase * @param bool $hasFinalNewLine * @param string $suffix */ - public function testNormalizeEncodesWithJsonEncodeOptionsIndentsAndPossiblySuffixesWithFinalNewLine(bool $hasFinalNewLine, string $suffix) + public function testNormalizeEncodesWithJsonEncodeOptionsIndentsAndPossiblySuffixesWithFinalNewLine(bool $hasFinalNewLine, string $suffix): void { $faker = $this->faker(); @@ -116,7 +116,7 @@ public function providerFinalNewLine(): \Generator ], ]; - foreach ($values as $key => list($hasFinalNewLine, $suffix)) { + foreach ($values as $key => [$hasFinalNewLine, $suffix]) { yield $key => [ $hasFinalNewLine, $suffix, diff --git a/test/Unit/Format/FormatSnifferTest.php b/test/Unit/Format/FormatSnifferTest.php index 664d7812..0c59d461 100644 --- a/test/Unit/Format/FormatSnifferTest.php +++ b/test/Unit/Format/FormatSnifferTest.php @@ -23,12 +23,12 @@ final class FormatSnifferTest extends Framework\TestCase { use Helper; - public function testImplementsSnifferInterface() + public function testImplementsSnifferInterface(): void { $this->assertClassImplementsInterface(FormatSnifferInterface::class, FormatSniffer::class); } - public function testSniffRejectsInvalidJson() + public function testSniffRejectsInvalidJson(): void { $json = $this->faker()->realText(); @@ -49,7 +49,7 @@ public function testSniffRejectsInvalidJson() * @param int $jsonEncodeOptions * @param string $json */ - public function testSniffReturnsFormatWithJsonEncodeOptions(int $jsonEncodeOptions, string $json) + public function testSniffReturnsFormatWithJsonEncodeOptions(int $jsonEncodeOptions, string $json): void { $sniffer = new FormatSniffer(); @@ -98,7 +98,7 @@ public function providerJsonAndJsonEncodeOptions(): array * * @param string $json */ - public function testSniffReturnsFormatWithDefaultIndentIfUnableToSniff(string $json) + public function testSniffReturnsFormatWithDefaultIndentIfUnableToSniff(string $json): void { $sniffer = new FormatSniffer(); @@ -129,7 +129,7 @@ public function providerJsonWithoutWhitespace(): \Generator * * @param string $indent */ - public function testSniffReturnsFormatWithIndentSniffedFromArray(string $indent) + public function testSniffReturnsFormatWithIndentSniffedFromArray(string $indent): void { $json = <<assertClassImplementsInterface(FormatInterface::class, Format::class); } - public function testConstructorRejectsInvalidEncodeOptions() + public function testConstructorRejectsInvalidEncodeOptions(): void { $jsonEncodeOptions = -1; $indent = ' '; @@ -51,7 +51,7 @@ public function testConstructorRejectsInvalidEncodeOptions() * * @param string $indent */ - public function testConstructorRejectsInvalidIndent(string $indent) + public function testConstructorRejectsInvalidIndent(string $indent): void { $jsonEncodeOptions = 0; $hasFinalNewLine = true; @@ -89,7 +89,7 @@ public function providerInvalidIndent(): \Generator * @param string $indent * @param bool $hasFinalNewLine */ - public function testConstructorSetsValues(string $indent, bool $hasFinalNewLine) + public function testConstructorSetsValues(string $indent, bool $hasFinalNewLine): void { $jsonEncodeOptions = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES; diff --git a/test/Unit/IndentNormalizerTest.php b/test/Unit/IndentNormalizerTest.php index b203b730..4f3151ce 100644 --- a/test/Unit/IndentNormalizerTest.php +++ b/test/Unit/IndentNormalizerTest.php @@ -24,7 +24,7 @@ final class IndentNormalizerTest extends AbstractNormalizerTestCase * * @param string $indent */ - public function testConstructorRejectsInvalidIndent(string $indent) + public function testConstructorRejectsInvalidIndent(string $indent): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage(\sprintf( @@ -52,7 +52,7 @@ public function providerInvalidIndent(): \Generator } } - public function testNormalizeUsesPrinterToNormalizeJsonWithIndent() + public function testNormalizeUsesPrinterToNormalizeJsonWithIndent(): void { $indent = ' '; diff --git a/test/Unit/JsonEncodeNormalizerTest.php b/test/Unit/JsonEncodeNormalizerTest.php index 90b0dec1..73ac1e58 100644 --- a/test/Unit/JsonEncodeNormalizerTest.php +++ b/test/Unit/JsonEncodeNormalizerTest.php @@ -17,7 +17,7 @@ final class JsonEncodeNormalizerTest extends AbstractNormalizerTestCase { - public function testConstructorRejectsInvalidJsonEncodeOptions() + public function testConstructorRejectsInvalidJsonEncodeOptions(): void { $jsonEncodeOptions = -1; @@ -35,7 +35,7 @@ public function testConstructorRejectsInvalidJsonEncodeOptions() * * @param int $jsonEncodeOptions */ - public function testNormalizeDecodesAndEncodesJsonWithJsonEncodeOptions(int $jsonEncodeOptions) + public function testNormalizeDecodesAndEncodesJsonWithJsonEncodeOptions(int $jsonEncodeOptions): void { $json = <<<'JSON' { diff --git a/test/Unit/NoFinalNewLineNormalizerTest.php b/test/Unit/NoFinalNewLineNormalizerTest.php index 24844ab0..c9ceb0ec 100644 --- a/test/Unit/NoFinalNewLineNormalizerTest.php +++ b/test/Unit/NoFinalNewLineNormalizerTest.php @@ -22,7 +22,7 @@ final class NoFinalNewLineNormalizerTest extends AbstractNormalizerTestCase * * @param string $whitespace */ - public function testNormalizeRemovesAllWhitespaceFromEndOfJson(string $whitespace) + public function testNormalizeRemovesAllWhitespaceFromEndOfJson(string $whitespace): void { $json = <<<'JSON' { diff --git a/test/Unit/ProjectCodeTest.php b/test/Unit/ProjectCodeTest.php index 427f4df9..202b64cf 100644 --- a/test/Unit/ProjectCodeTest.php +++ b/test/Unit/ProjectCodeTest.php @@ -20,12 +20,12 @@ final class ProjectCodeTest extends Framework\TestCase { use Helper; - public function testProductionClassesAreAbstractOrFinal() + public function testProductionClassesAreAbstractOrFinal(): void { $this->assertClassesAreAbstractOrFinal(__DIR__ . '/../../src'); } - public function testProductionClassesHaveTests() + public function testProductionClassesHaveTests(): void { $this->assertClassesHaveTests( __DIR__ . '/../../src', @@ -34,7 +34,7 @@ public function testProductionClassesHaveTests() ); } - public function testTestClassesAreAbstractOrFinal() + public function testTestClassesAreAbstractOrFinal(): void { $this->assertClassesAreAbstractOrFinal(__DIR__ . '/..'); } diff --git a/test/Unit/SchemaNormalizerTest.php b/test/Unit/SchemaNormalizerTest.php index 83594be9..c78d09ef 100644 --- a/test/Unit/SchemaNormalizerTest.php +++ b/test/Unit/SchemaNormalizerTest.php @@ -21,7 +21,7 @@ final class SchemaNormalizerTest extends AbstractNormalizerTestCase { - public function testNormalizeThrowsRuntimeExceptionIfSchemaUriCouldNotBeResolved() + public function testNormalizeThrowsRuntimeExceptionIfSchemaUriCouldNotBeResolved(): void { $json = <<<'JSON' { @@ -54,7 +54,7 @@ public function testNormalizeThrowsRuntimeExceptionIfSchemaUriCouldNotBeResolved $normalizer->normalize($json); } - public function testNormalizeThrowsRuntimeExceptionIfSchemaUriReferencesUnreadableResource() + public function testNormalizeThrowsRuntimeExceptionIfSchemaUriReferencesUnreadableResource(): void { $json = <<<'JSON' { @@ -87,7 +87,7 @@ public function testNormalizeThrowsRuntimeExceptionIfSchemaUriReferencesUnreadab $normalizer->normalize($json); } - public function testNormalizeThrowsRuntimeExceptionIfSchemaUriReferencesResourceWithInvalidMediaType() + public function testNormalizeThrowsRuntimeExceptionIfSchemaUriReferencesResourceWithInvalidMediaType(): void { $json = <<<'JSON' { @@ -120,7 +120,7 @@ public function testNormalizeThrowsRuntimeExceptionIfSchemaUriReferencesResource $normalizer->normalize($json); } - public function testNormalizeThrowsRuntimeExceptionIfSchemaUriReferencesResourceWithInvalidJson() + public function testNormalizeThrowsRuntimeExceptionIfSchemaUriReferencesResourceWithInvalidJson(): void { $json = <<<'JSON' { @@ -153,7 +153,7 @@ public function testNormalizeThrowsRuntimeExceptionIfSchemaUriReferencesResource $normalizer->normalize($json); } - public function testNormalizeRejectsInvalidJsonAccordingToSchema() + public function testNormalizeRejectsInvalidJsonAccordingToSchema(): void { $json = <<<'JSON' { @@ -205,7 +205,7 @@ public function testNormalizeRejectsInvalidJsonAccordingToSchema() $normalizer->normalize($json); } - public function testNormalizeThrowsRuntimeExceptionIfNormalizedIsInvalidAccordingToSchema() + public function testNormalizeThrowsRuntimeExceptionIfNormalizedIsInvalidAccordingToSchema(): void { $json = <<<'JSON' { @@ -291,7 +291,7 @@ public function testNormalizeThrowsRuntimeExceptionIfNormalizedIsInvalidAccordin * @param string $json * @param string $schemaUri */ - public function testNormalizeNormalizes(string $expected, string $json, string $schemaUri) + public function testNormalizeNormalizes(string $expected, string $json, string $schemaUri): void { $normalizer = new SchemaNormalizer($schemaUri); diff --git a/test/Unit/Validator/SchemaValidatorTest.php b/test/Unit/Validator/SchemaValidatorTest.php index 32cab4f8..36c68aae 100644 --- a/test/Unit/Validator/SchemaValidatorTest.php +++ b/test/Unit/Validator/SchemaValidatorTest.php @@ -24,7 +24,7 @@ final class SchemaValidatorTest extends Framework\TestCase { use Helper; - public function testImplementsSchemaValidatorInterface() + public function testImplementsSchemaValidatorInterface(): void { $this->assertClassImplementsInterface(SchemaValidatorInterface::class, SchemaValidator::class); } @@ -34,7 +34,7 @@ public function testImplementsSchemaValidatorInterface() * * @param bool $isValid */ - public function testValidateUsesSchemaValidator(bool $isValid) + public function testValidateUsesSchemaValidator(bool $isValid): void { $dataJson = <<<'JSON' {