From 5872ad258a16191361f2f8eb570ece6b15070d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Wed, 29 Dec 2021 10:18:38 +0100 Subject: [PATCH] Fix: Use methods instead of deprecated magic properties --- .../InvalidIndentStringExceptionTest.php | 2 +- .../InvalidIndentStyleExceptionTest.php | 4 ++-- .../InvalidJsonEncodedExceptionTest.php | 2 +- .../InvalidNewLineStringExceptionTest.php | 2 +- ...edInvalidAccordingToSchemaExceptionTest.php | 8 ++++---- ...alInvalidAccordingToSchemaExceptionTest.php | 8 ++++---- .../SchemaUriCouldNotBeReadExceptionTest.php | 2 +- ...chemaUriCouldNotBeResolvedExceptionTest.php | 2 +- ...cumentWithInvalidMediaTypeExceptionTest.php | 2 +- ...erencesInvalidJsonDocumentExceptionTest.php | 2 +- test/Unit/FixedFormatNormalizerTest.php | 2 +- test/Unit/Format/IndentTest.php | 4 ++-- test/Unit/SchemaNormalizerTest.php | 18 +++++++++--------- test/Unit/Validator/ResultTest.php | 6 +++--- .../Composer/AbstractComposerTestCase.php | 4 ++-- 15 files changed, 34 insertions(+), 34 deletions(-) diff --git a/test/Unit/Exception/InvalidIndentStringExceptionTest.php b/test/Unit/Exception/InvalidIndentStringExceptionTest.php index bde3453f..37bce8e0 100644 --- a/test/Unit/Exception/InvalidIndentStringExceptionTest.php +++ b/test/Unit/Exception/InvalidIndentStringExceptionTest.php @@ -31,7 +31,7 @@ public function testDefaults(): void public function testFromSizeAndMinimumSizeReturnsInvalidIndentStringException(): void { - $string = self::faker()->word; + $string = self::faker()->word(); $exception = Exception\InvalidIndentStringException::fromString($string); diff --git a/test/Unit/Exception/InvalidIndentStyleExceptionTest.php b/test/Unit/Exception/InvalidIndentStyleExceptionTest.php index c695d528..51a2564e 100644 --- a/test/Unit/Exception/InvalidIndentStyleExceptionTest.php +++ b/test/Unit/Exception/InvalidIndentStyleExceptionTest.php @@ -34,10 +34,10 @@ public function testFromStyleAndAllowedStylesReturnsInvalidIndentStyleException( { $faker = self::faker(); - $style = $faker->word; + $style = $faker->word(); /** @var string[] $allowedStyles */ - $allowedStyles = $faker->words; + $allowedStyles = $faker->words(); $exception = Exception\InvalidIndentStyleException::fromStyleAndAllowedStyles( $style, diff --git a/test/Unit/Exception/InvalidJsonEncodedExceptionTest.php b/test/Unit/Exception/InvalidJsonEncodedExceptionTest.php index f615ef1c..02fa1bb2 100644 --- a/test/Unit/Exception/InvalidJsonEncodedExceptionTest.php +++ b/test/Unit/Exception/InvalidJsonEncodedExceptionTest.php @@ -31,7 +31,7 @@ public function testDefaults(): void public function testFromEncodedReturnsInvalidJsonEncodedException(): void { - $encoded = self::faker()->sentence; + $encoded = self::faker()->sentence(); $exception = Exception\InvalidJsonEncodedException::fromEncoded($encoded); diff --git a/test/Unit/Exception/InvalidNewLineStringExceptionTest.php b/test/Unit/Exception/InvalidNewLineStringExceptionTest.php index 9a351537..2d4775b4 100644 --- a/test/Unit/Exception/InvalidNewLineStringExceptionTest.php +++ b/test/Unit/Exception/InvalidNewLineStringExceptionTest.php @@ -31,7 +31,7 @@ public function testDefaults(): void public function testFromSizeAndMinimumSizeReturnsInvalidIndentStringException(): void { - $string = self::faker()->word; + $string = self::faker()->word(); $exception = Exception\InvalidNewLineStringException::fromString($string); diff --git a/test/Unit/Exception/NormalizedInvalidAccordingToSchemaExceptionTest.php b/test/Unit/Exception/NormalizedInvalidAccordingToSchemaExceptionTest.php index d7d51db8..0277379b 100644 --- a/test/Unit/Exception/NormalizedInvalidAccordingToSchemaExceptionTest.php +++ b/test/Unit/Exception/NormalizedInvalidAccordingToSchemaExceptionTest.php @@ -34,12 +34,12 @@ public function testFromSchemaUriReturnsNormalizedInvalidAccordingToSchemaExcept { $faker = self::faker(); - $schemaUri = $faker->url; + $schemaUri = $faker->url(); $errors = [ - $faker->sentence, - $faker->sentence, - $faker->sentence, + $faker->sentence(), + $faker->sentence(), + $faker->sentence(), ]; $exception = Exception\NormalizedInvalidAccordingToSchemaException::fromSchemaUriAndErrors( diff --git a/test/Unit/Exception/OriginalInvalidAccordingToSchemaExceptionTest.php b/test/Unit/Exception/OriginalInvalidAccordingToSchemaExceptionTest.php index 5e6fc446..ce86ccc7 100644 --- a/test/Unit/Exception/OriginalInvalidAccordingToSchemaExceptionTest.php +++ b/test/Unit/Exception/OriginalInvalidAccordingToSchemaExceptionTest.php @@ -34,12 +34,12 @@ public function testFromSchemaUriAndErrorsReturnsOriginalInvalidAccordingToSchem { $faker = self::faker(); - $schemaUri = $faker->url; + $schemaUri = $faker->url(); $errors = [ - $faker->sentence, - $faker->sentence, - $faker->sentence, + $faker->sentence(), + $faker->sentence(), + $faker->sentence(), ]; $exception = Exception\OriginalInvalidAccordingToSchemaException::fromSchemaUriAndErrors( diff --git a/test/Unit/Exception/SchemaUriCouldNotBeReadExceptionTest.php b/test/Unit/Exception/SchemaUriCouldNotBeReadExceptionTest.php index fd88c4a6..1d846560 100644 --- a/test/Unit/Exception/SchemaUriCouldNotBeReadExceptionTest.php +++ b/test/Unit/Exception/SchemaUriCouldNotBeReadExceptionTest.php @@ -31,7 +31,7 @@ public function testDefaults(): void public function testFromSchemaUriReturnsSchemaUriCouldNotBeReadException(): void { - $schemaUri = self::faker()->url; + $schemaUri = self::faker()->url(); $exception = Exception\SchemaUriCouldNotBeReadException::fromSchemaUri($schemaUri); diff --git a/test/Unit/Exception/SchemaUriCouldNotBeResolvedExceptionTest.php b/test/Unit/Exception/SchemaUriCouldNotBeResolvedExceptionTest.php index 5a42ac48..1f02f1ec 100644 --- a/test/Unit/Exception/SchemaUriCouldNotBeResolvedExceptionTest.php +++ b/test/Unit/Exception/SchemaUriCouldNotBeResolvedExceptionTest.php @@ -31,7 +31,7 @@ public function testDefaults(): void public function testFromSchemaUriReturnsSchemaUriCouldNotBeResolvedException(): void { - $schemaUri = self::faker()->url; + $schemaUri = self::faker()->url(); $exception = Exception\SchemaUriCouldNotBeResolvedException::fromSchemaUri($schemaUri); diff --git a/test/Unit/Exception/SchemaUriReferencesDocumentWithInvalidMediaTypeExceptionTest.php b/test/Unit/Exception/SchemaUriReferencesDocumentWithInvalidMediaTypeExceptionTest.php index 1ee76879..c6521dbc 100644 --- a/test/Unit/Exception/SchemaUriReferencesDocumentWithInvalidMediaTypeExceptionTest.php +++ b/test/Unit/Exception/SchemaUriReferencesDocumentWithInvalidMediaTypeExceptionTest.php @@ -31,7 +31,7 @@ public function testDefaults(): void public function testFromSchemaUriReturnsSchemaUriReferencesDocumentWithInvalidMediaType(): void { - $schemaUri = self::faker()->url; + $schemaUri = self::faker()->url(); $exception = Exception\SchemaUriReferencesDocumentWithInvalidMediaTypeException::fromSchemaUri($schemaUri); diff --git a/test/Unit/Exception/SchemaUriReferencesInvalidJsonDocumentExceptionTest.php b/test/Unit/Exception/SchemaUriReferencesInvalidJsonDocumentExceptionTest.php index 4c140f6d..96fb7299 100644 --- a/test/Unit/Exception/SchemaUriReferencesInvalidJsonDocumentExceptionTest.php +++ b/test/Unit/Exception/SchemaUriReferencesInvalidJsonDocumentExceptionTest.php @@ -31,7 +31,7 @@ public function testDefaults(): void public function testFromSchemaUriReturnsSchemaUriReferencesDocumentWithInvalidMediaType(): void { - $schemaUri = self::faker()->url; + $schemaUri = self::faker()->url(); $exception = Exception\SchemaUriReferencesInvalidJsonDocumentException::fromSchemaUri($schemaUri); diff --git a/test/Unit/FixedFormatNormalizerTest.php b/test/Unit/FixedFormatNormalizerTest.php index f76f118c..dcaf6c8d 100644 --- a/test/Unit/FixedFormatNormalizerTest.php +++ b/test/Unit/FixedFormatNormalizerTest.php @@ -39,7 +39,7 @@ public function testNormalizeNormalizesAndFormatsUsingFormat(): void Format\JsonEncodeOptions::fromInt($faker->numberBetween(1)), Format\Indent::fromString("\t"), Format\NewLine::fromString("\r\n"), - $faker->boolean, + $faker->boolean(), ); $json = Json::fromEncoded( diff --git a/test/Unit/Format/IndentTest.php b/test/Unit/Format/IndentTest.php index 9a92f21e..5dd4c6b7 100644 --- a/test/Unit/Format/IndentTest.php +++ b/test/Unit/Format/IndentTest.php @@ -81,7 +81,7 @@ public function testFromSizeAndStyleRejectsInvalidStyle(): void $faker = self::faker(); $size = $faker->numberBetween(1); - $style = $faker->sentence; + $style = $faker->sentence(); $this->expectException(Exception\InvalidIndentStyleException::class); @@ -141,7 +141,7 @@ public function testFromStringRejectsInvalidIndentString(string $string): void public function provideInvalidIndentString(): \Generator { $strings = [ - 'string-not-whitespace' => self::faker()->sentence, + 'string-not-whitespace' => self::faker()->sentence(), 'string-contains-line-feed' => " \n ", 'string-mixed-space-and-tab' => " \t", ]; diff --git a/test/Unit/SchemaNormalizerTest.php b/test/Unit/SchemaNormalizerTest.php index ccb6841e..920f0b80 100644 --- a/test/Unit/SchemaNormalizerTest.php +++ b/test/Unit/SchemaNormalizerTest.php @@ -54,7 +54,7 @@ public function testNormalizeThrowsSchemaUriCouldNotBeResolvedExceptionWhenSchem JSON ); - $schemaUri = self::faker()->url; + $schemaUri = self::faker()->url(); $schemaStorage = $this->createMock(SchemaStorage::class); @@ -86,7 +86,7 @@ public function testNormalizeThrowsSchemaUriCouldNotBeReadExceptionWhenSchemaUri JSON ); - $schemaUri = self::faker()->url; + $schemaUri = self::faker()->url(); $schemaStorage = $this->createMock(SchemaStorage::class); @@ -118,7 +118,7 @@ public function testNormalizeThrowsSchemaUriReferencesDocumentWithInvalidMediaTy JSON ); - $schemaUri = self::faker()->url; + $schemaUri = self::faker()->url(); $schemaStorage = $this->createMock(SchemaStorage::class); @@ -150,7 +150,7 @@ public function testNormalizeThrowsRuntimeExceptionIfSchemaUriReferencesResource JSON ); - $schemaUri = self::faker()->url; + $schemaUri = self::faker()->url(); $schemaStorage = $this->createMock(SchemaStorage::class); @@ -184,7 +184,7 @@ public function testNormalizeThrowsOriginalInvalidAccordingToSchemaExceptionWhen JSON ); - $schemaUri = $faker->url; + $schemaUri = $faker->url(); $schema = <<<'JSON' { @@ -212,9 +212,9 @@ public function testNormalizeThrowsOriginalInvalidAccordingToSchemaExceptionWhen self::identicalTo($schemaDecoded), ) ->willReturn(Result::create( - $faker->sentence, - $faker->sentence, - $faker->sentence, + $faker->sentence(), + $faker->sentence(), + $faker->sentence(), )); $normalizer = new SchemaNormalizer( @@ -241,7 +241,7 @@ public function testNormalizeThrowsNormalizedInvalidAccordingToSchemaExceptionWh JSON ); - $schemaUri = $faker->url; + $schemaUri = $faker->url(); $schema = <<<'JSON' { diff --git a/test/Unit/Validator/ResultTest.php b/test/Unit/Validator/ResultTest.php index 33c41e44..c979dfcd 100644 --- a/test/Unit/Validator/ResultTest.php +++ b/test/Unit/Validator/ResultTest.php @@ -39,9 +39,9 @@ public function testCreateReturnsResultWithErrors(): void $faker = self::faker(); $errors = [ - $faker->sentence, - $faker->sentence, - $faker->sentence, + $faker->sentence(), + $faker->sentence(), + $faker->sentence(), ]; $result = Validator\Result::create(...$errors); diff --git a/test/Unit/Vendor/Composer/AbstractComposerTestCase.php b/test/Unit/Vendor/Composer/AbstractComposerTestCase.php index ab2a48b6..c59c3080 100644 --- a/test/Unit/Vendor/Composer/AbstractComposerTestCase.php +++ b/test/Unit/Vendor/Composer/AbstractComposerTestCase.php @@ -50,13 +50,13 @@ final public function provideJsonNotDecodingToObject(): \Generator $faker = self::faker(); $values = [ - 'array' => $faker->words, + 'array' => $faker->words(), 'bool-false' => false, 'bool-true' => true, 'float' => $faker->randomFloat(), 'int' => $faker->randomNumber(), 'null' => null, - 'string' => $faker->sentence, + 'string' => $faker->sentence(), ]; foreach ($values as $key => $value) {