diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 4afc863..87969bf 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -11,3 +11,10 @@ parameters: analyse: - ./tests/ExpectedBehaviorTest.php - ./tests/static-analysis/stubs.php + ignoreErrors: + - + identifier: method.resultUnused + path: tests/* + - + identifier: staticMethod.resultUnused + path: tests/* diff --git a/tests/Builder/FallbackBuilderTest.php b/tests/Builder/FallbackBuilderTest.php index 1a090b2..31b9589 100644 --- a/tests/Builder/FallbackBuilderTest.php +++ b/tests/Builder/FallbackBuilderTest.php @@ -58,7 +58,6 @@ class FallbackBuilderTest extends TestCase 'Could not find a suitable builder for the provided codec and fields' ); - /** @phpstan-ignore method.resultUnused */ $fallbackBuilder->build($codec, $bytes); } diff --git a/tests/Codec/GuidStringCodecTest.php b/tests/Codec/GuidStringCodecTest.php index 19f7261..4394586 100644 --- a/tests/Codec/GuidStringCodecTest.php +++ b/tests/Codec/GuidStringCodecTest.php @@ -56,7 +56,6 @@ class GuidStringCodecTest extends TestCase ->method('getFields') ->willReturn($this->fields); $codec = new GuidStringCodec($this->builder); - /** @phpstan-ignore method.resultUnused */ $codec->encode($this->uuid); } diff --git a/tests/Codec/OrderedTimeCodecTest.php b/tests/Codec/OrderedTimeCodecTest.php index c42a1d9..a0341ab 100644 --- a/tests/Codec/OrderedTimeCodecTest.php +++ b/tests/Codec/OrderedTimeCodecTest.php @@ -77,7 +77,6 @@ class OrderedTimeCodecTest extends TestCase ->method('getFields') ->willReturn($this->fields); $codec = new OrderedTimeCodec($this->builder); - /** @phpstan-ignore method.resultUnused */ $codec->encode($this->uuid); } @@ -166,7 +165,6 @@ class OrderedTimeCodecTest extends TestCase $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Expected version 1 (time-based) UUID'); - /** @phpstan-ignore method.resultUnused */ $codec->encodeBinary($uuid); } @@ -187,7 +185,6 @@ class OrderedTimeCodecTest extends TestCase $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Expected version 1 (time-based) UUID'); - /** @phpstan-ignore method.resultUnused */ $codec->encodeBinary($uuid); } diff --git a/tests/Codec/StringCodecTest.php b/tests/Codec/StringCodecTest.php index b38a435..2412dcd 100644 --- a/tests/Codec/StringCodecTest.php +++ b/tests/Codec/StringCodecTest.php @@ -60,7 +60,6 @@ class StringCodecTest extends TestCase ->method('getFields') ->willReturn($this->fields); $codec = new StringCodec($this->builder); - /** @phpstan-ignore method.resultUnused */ $codec->encode($this->uuid); } @@ -136,7 +135,6 @@ class StringCodecTest extends TestCase $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('$bytes string should contain 16 characters.'); - /** @phpstan-ignore method.resultUnused */ $codec->decodeBytes($bytes); } diff --git a/tests/Converter/Number/BigNumberConverterTest.php b/tests/Converter/Number/BigNumberConverterTest.php index c3dc6d4..83bcff2 100644 --- a/tests/Converter/Number/BigNumberConverterTest.php +++ b/tests/Converter/Number/BigNumberConverterTest.php @@ -17,7 +17,6 @@ class BigNumberConverterTest extends TestCase $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('"." is not a valid character in base 16'); - /** @phpstan-ignore method.resultUnused */ $converter->fromHex('123.34'); } @@ -31,7 +30,6 @@ class BigNumberConverterTest extends TestCase . '0-9 and, optionally, a sign (+ or -)' ); - /** @phpstan-ignore method.resultUnused */ $converter->toHex('123.34'); } diff --git a/tests/Converter/Time/BigNumberTimeConverterTest.php b/tests/Converter/Time/BigNumberTimeConverterTest.php index 235e878..f5acc98 100644 --- a/tests/Converter/Time/BigNumberTimeConverterTest.php +++ b/tests/Converter/Time/BigNumberTimeConverterTest.php @@ -56,7 +56,6 @@ class BigNumberTimeConverterTest extends TestCase . '0-9 and, optionally, a sign (+ or -)' ); - /** @phpstan-ignore method.resultUnused */ $converter->calculateTime('12.34', '5678'); } @@ -70,7 +69,6 @@ class BigNumberTimeConverterTest extends TestCase . '0-9 and, optionally, a sign (+ or -)' ); - /** @phpstan-ignore method.resultUnused */ $converter->calculateTime('1234', '56.78'); } } diff --git a/tests/Converter/Time/PhpTimeConverterTest.php b/tests/Converter/Time/PhpTimeConverterTest.php index 4fa62cc..2036fdd 100644 --- a/tests/Converter/Time/PhpTimeConverterTest.php +++ b/tests/Converter/Time/PhpTimeConverterTest.php @@ -52,7 +52,6 @@ class PhpTimeConverterTest extends TestCase . '0-9 and, optionally, a sign (+ or -)' ); - /** @phpstan-ignore method.resultUnused */ $converter->calculateTime('12.34', '5678'); } @@ -67,7 +66,6 @@ class PhpTimeConverterTest extends TestCase . '0-9 and, optionally, a sign (+ or -)' ); - /** @phpstan-ignore method.resultUnused */ $converter->calculateTime('1234', '56.78'); } diff --git a/tests/Encoder/TimestampFirstCombCodecTest.php b/tests/Encoder/TimestampFirstCombCodecTest.php index fd5e53a..875695f 100644 --- a/tests/Encoder/TimestampFirstCombCodecTest.php +++ b/tests/Encoder/TimestampFirstCombCodecTest.php @@ -75,7 +75,6 @@ class TimestampFirstCombCodecTest extends TestCase 'node' => '0800200c9a66', ])) ); - /** @phpstan-ignore method.resultUnused */ $this->codec->decode('0800200c-9a66-11e1-9b21-ff6f8cb0c57d'); } diff --git a/tests/Encoder/TimestampLastCombCodecTest.php b/tests/Encoder/TimestampLastCombCodecTest.php index 8099602..5bd41c2 100644 --- a/tests/Encoder/TimestampLastCombCodecTest.php +++ b/tests/Encoder/TimestampLastCombCodecTest.php @@ -78,7 +78,6 @@ class TimestampLastCombCodecTest extends TestCase 'node' => 'ff6f8cb0c57d', ])) ); - /** @phpstan-ignore method.resultUnused */ $this->codec->decode('0800200c-9a66-11e1-9b21-ff6f8cb0c57d'); } diff --git a/tests/Generator/DefaultNameGeneratorTest.php b/tests/Generator/DefaultNameGeneratorTest.php index b49b771..9bfb556 100644 --- a/tests/Generator/DefaultNameGeneratorTest.php +++ b/tests/Generator/DefaultNameGeneratorTest.php @@ -79,7 +79,6 @@ class DefaultNameGeneratorTest extends TestCase 'Unable to hash namespace and name with algorithm \'aBadAlgorithm\'' ); - /** @phpstan-ignore method.resultUnused */ $generator->generate($namespace, 'a test name', 'aBadAlgorithm'); } } diff --git a/tests/Generator/PeclUuidNameGeneratorTest.php b/tests/Generator/PeclUuidNameGeneratorTest.php index 4bbbf31..0bd91d3 100644 --- a/tests/Generator/PeclUuidNameGeneratorTest.php +++ b/tests/Generator/PeclUuidNameGeneratorTest.php @@ -99,7 +99,6 @@ class PeclUuidNameGeneratorTest extends TestCase 'Unable to hash namespace and name with algorithm \'aBadAlgorithm\'' ); - /** @phpstan-ignore method.resultUnused */ $generator->generate($namespace, 'a test name', 'aBadAlgorithm'); } } diff --git a/tests/Guid/GuidBuilderTest.php b/tests/Guid/GuidBuilderTest.php index d3279f3..df0405a 100644 --- a/tests/Guid/GuidBuilderTest.php +++ b/tests/Guid/GuidBuilderTest.php @@ -28,7 +28,6 @@ class GuidBuilderTest extends TestCase $this->expectException(UnableToBuildUuidException::class); $this->expectExceptionMessage('exception thrown'); - /** @phpstan-ignore method.resultUnused */ $builder->build($codec, 'foobar'); } } diff --git a/tests/Math/BrickMathCalculatorTest.php b/tests/Math/BrickMathCalculatorTest.php index 02dcec9..8cb5d90 100644 --- a/tests/Math/BrickMathCalculatorTest.php +++ b/tests/Math/BrickMathCalculatorTest.php @@ -98,7 +98,6 @@ class BrickMathCalculatorTest extends TestCase $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('"o" is not a valid character in base 16'); - /** @phpstan-ignore method.resultUnused */ $calculator->fromBase('foobar', 16); } diff --git a/tests/Nonstandard/UuidBuilderTest.php b/tests/Nonstandard/UuidBuilderTest.php index f77512c..7bf36a9 100644 --- a/tests/Nonstandard/UuidBuilderTest.php +++ b/tests/Nonstandard/UuidBuilderTest.php @@ -28,7 +28,6 @@ class UuidBuilderTest extends TestCase $this->expectException(UnableToBuildUuidException::class); $this->expectExceptionMessage('exception thrown'); - /** @phpstan-ignore method.resultUnused */ $builder->build($codec, 'foobar'); } } diff --git a/tests/Rfc4122/UuidBuilderTest.php b/tests/Rfc4122/UuidBuilderTest.php index ca00442..9e53487 100644 --- a/tests/Rfc4122/UuidBuilderTest.php +++ b/tests/Rfc4122/UuidBuilderTest.php @@ -140,7 +140,6 @@ class UuidBuilderTest extends TestCase 'The byte string must be 16 bytes long; received 15 bytes' ); - /** @phpstan-ignore method.resultUnused */ $builder->build($codec, $bytes); } @@ -164,7 +163,6 @@ class UuidBuilderTest extends TestCase 'The UUID version in the given fields is not supported by this UUID builder' ); - /** @phpstan-ignore method.resultUnused */ $builder->build($codec, 'foobar'); } } diff --git a/tests/benchmark/GuidConversionBench.php b/tests/benchmark/GuidConversionBench.php index 5c8f5ed..a11842a 100644 --- a/tests/benchmark/GuidConversionBench.php +++ b/tests/benchmark/GuidConversionBench.php @@ -38,7 +38,6 @@ final class GuidConversionBench public function benchStringConversionOfGuid(): void { - /** @phpstan-ignore method.resultUnused */ $this->uuid->toString(); } } diff --git a/tests/benchmark/NonLazyUuidConversionBench.php b/tests/benchmark/NonLazyUuidConversionBench.php index 75b4adc..32d0e66 100644 --- a/tests/benchmark/NonLazyUuidConversionBench.php +++ b/tests/benchmark/NonLazyUuidConversionBench.php @@ -34,7 +34,6 @@ final class NonLazyUuidConversionBench public function benchStringConversionOfUuid(): void { - /** @phpstan-ignore method.resultUnused */ $this->uuid->toString(); } } diff --git a/tests/benchmark/UuidGenerationBench.php b/tests/benchmark/UuidGenerationBench.php index 1992dfe..b474993 100644 --- a/tests/benchmark/UuidGenerationBench.php +++ b/tests/benchmark/UuidGenerationBench.php @@ -73,7 +73,6 @@ final class UuidGenerationBench public function benchUuid3Generation(): void { - /** @phpstan-ignore staticMethod.resultUnused */ Uuid::uuid3($this->namespace, 'name'); } @@ -84,7 +83,6 @@ final class UuidGenerationBench public function benchUuid5Generation(): void { - /** @phpstan-ignore staticMethod.resultUnused */ Uuid::uuid5($this->namespace, 'name'); } diff --git a/tests/benchmark/UuidStringConversionBench.php b/tests/benchmark/UuidStringConversionBench.php index 3693d2b..d7c098c 100644 --- a/tests/benchmark/UuidStringConversionBench.php +++ b/tests/benchmark/UuidStringConversionBench.php @@ -208,19 +208,16 @@ final class UuidStringConversionBench public function benchStringConversionOfTinyUuid(): void { - /** @phpstan-ignore method.resultUnused */ $this->tinyUuid->toString(); } public function benchStringConversionOfHugeUuid(): void { - /** @phpstan-ignore method.resultUnused */ $this->hugeUuid->toString(); } public function benchStringConversionOfUuid(): void { - /** @phpstan-ignore method.resultUnused */ $this->uuid->toString(); } @@ -233,19 +230,16 @@ final class UuidStringConversionBench public function benchBytesConversionOfTinyUuid(): void { - /** @phpstan-ignore method.resultUnused */ $this->tinyUuid->getBytes(); } public function benchBytesConversionOfHugeUuid(): void { - /** @phpstan-ignore method.resultUnused */ $this->hugeUuid->getBytes(); } public function benchBytesConversionOfUuid(): void { - /** @phpstan-ignore method.resultUnused */ $this->uuid->getBytes(); }