diff --git a/rector.php b/rector.php index 68bbf904f..5a983fd80 100644 --- a/rector.php +++ b/rector.php @@ -116,4 +116,4 @@ ->withConfiguredRule(ClassPropertyAssignToConstructorPromotionRector::class, [ ClassPropertyAssignToConstructorPromotionRector::RENAME_PROPERTY => false, ]) - ->withTypeCoverageLevel(0); + ->withTypeCoverageLevel(2); diff --git a/src/Auth/tests/TokenStorageProviderTest.php b/src/Auth/tests/TokenStorageProviderTest.php index a14878a01..d2d458b24 100644 --- a/src/Auth/tests/TokenStorageProviderTest.php +++ b/src/Auth/tests/TokenStorageProviderTest.php @@ -137,7 +137,7 @@ public function testGetStorageTwice(): void $this->assertSame($sameStorage, $provider->getStorage('database')); } - public function testGetDifferentStorage() + public function testGetDifferentStorage(): void { $provider = new TokenStorageProvider( new AuthConfig([ diff --git a/src/Boot/tests/KernelTest.php b/src/Boot/tests/KernelTest.php index c05045901..4631636f1 100644 --- a/src/Boot/tests/KernelTest.php +++ b/src/Boot/tests/KernelTest.php @@ -120,7 +120,7 @@ public function testEnv(): void ); } - public function testBootingCallbacks() + public function testBootingCallbacks(): void { $kernel = TestCore::create(['root' => __DIR__]); diff --git a/src/Core/tests/Scope/FinalizeAttributeTest.php b/src/Core/tests/Scope/FinalizeAttributeTest.php index 9b55edb58..6872d9d78 100644 --- a/src/Core/tests/Scope/FinalizeAttributeTest.php +++ b/src/Core/tests/Scope/FinalizeAttributeTest.php @@ -117,7 +117,7 @@ public function testFinalizerWithoutConcreteScopeInRoot(): void } #[Group('scrutinizer-ignore')] - public function testExceptionOnDestroy() + public function testExceptionOnDestroy(): void { $root = self::makeContainer(); @@ -146,7 +146,7 @@ public function testExceptionOnDestroy() } #[Group('scrutinizer-ignore')] - public function testManyExceptionsOnDestroy() + public function testManyExceptionsOnDestroy(): void { $root = self::makeContainer(); diff --git a/src/Core/tests/Scope/ProxyTest.php b/src/Core/tests/Scope/ProxyTest.php index 05e41c6fd..1ee5e0354 100644 --- a/src/Core/tests/Scope/ProxyTest.php +++ b/src/Core/tests/Scope/ProxyTest.php @@ -363,7 +363,7 @@ static function (#[Proxy] ContainerInterface $proxy, ContainerInterface $scoped) ); } - public function testProxyFallbackFactory() + public function testProxyFallbackFactory(): void { $root = new Container(); $root->bind(UserInterface::class, new ProxyConfig( diff --git a/src/Mailer/tests/MessageTest.php b/src/Mailer/tests/MessageTest.php index 1d5e3cd4a..2b8047ae9 100644 --- a/src/Mailer/tests/MessageTest.php +++ b/src/Mailer/tests/MessageTest.php @@ -113,7 +113,7 @@ public function testReplyTo(): void $this->assertNull($m->getReplyTo()); } - public function testSetDelayInSeconds() + public function testSetDelayInSeconds(): void { $m = new Message('test', 'email@domain.com'); $m->setDelay(100); @@ -123,7 +123,7 @@ public function testSetDelayInSeconds() ], $m->getOptions()); } - public function testSetDelayInDateInterval() + public function testSetDelayInDateInterval(): void { $m = new Message('test', 'email@domain.com'); $m->setDelay(new \DateInterval('PT56S')); @@ -133,7 +133,7 @@ public function testSetDelayInDateInterval() ], $m->getOptions()); } - public function testSetDelayInDateTime() + public function testSetDelayInDateTime(): void { $m = new Message('test', 'email@domain.com'); $m->setDelay(new \DateTimeImmutable('+ 123 second')); @@ -143,7 +143,7 @@ public function testSetDelayInDateTime() ], $m->getOptions()); } - public function testSetDelayInDateTimeWithPastTime() + public function testSetDelayInDateTimeWithPastTime(): void { $m = new Message('test', 'email@domain.com'); $m->setDelay(new \DateTimeImmutable('- 123 second')); diff --git a/src/Pagination/tests/LimitsTraitTest.php b/src/Pagination/tests/LimitsTraitTest.php index 8cff62e65..0dfef7f82 100644 --- a/src/Pagination/tests/LimitsTraitTest.php +++ b/src/Pagination/tests/LimitsTraitTest.php @@ -29,14 +29,14 @@ public function setUp(): void $this->trait = $this->getMockForTrait(LimitsTrait::class); } - public function testLimit() + public function testLimit(): void { $this->assertEquals(static::DEFAULT_LIMIT, $this->trait->getLimit()); $this->assertEquals($this->trait, $this->trait->limit(static::LIMIT)); $this->assertEquals(static::LIMIT, $this->trait->getLimit()); } - public function testOffset() + public function testOffset(): void { $this->assertEquals(static::DEFAULT_OFFSET, $this->trait->getOffset()); $this->assertEquals($this->trait, $this->trait->offset(static::OFFSET)); diff --git a/src/Snapshots/tests/SnapshotTest.php b/src/Snapshots/tests/SnapshotTest.php index e09419625..97e944dae 100644 --- a/src/Snapshots/tests/SnapshotTest.php +++ b/src/Snapshots/tests/SnapshotTest.php @@ -9,7 +9,7 @@ class SnapshotTest extends TestCase { - public function testSnapshot() + public function testSnapshot(): void { $e = new \Error("message"); $s = new Snapshot("id", $e); diff --git a/src/Streams/tests/StreamsTest.php b/src/Streams/tests/StreamsTest.php index 5cdb89ba2..8eeeff474 100644 --- a/src/Streams/tests/StreamsTest.php +++ b/src/Streams/tests/StreamsTest.php @@ -24,7 +24,7 @@ public function tearDown(): void $files->deleteDirectory(self::FIXTURE_DIRECTORY, true); } - public function testGetUri() + public function testGetUri(): void { $stream = Stream::create(); $stream->write('sample text'); @@ -51,7 +51,7 @@ public function testGetUri() $this->assertFalse(StreamWrapper::has($newFilename)); } - public function testGetResource() + public function testGetResource(): void { $stream = Stream::create(); $stream->write('sample text'); @@ -74,7 +74,7 @@ public function testGetResource() /** * @requires PHP < 8.0 */ - public function testException() + public function testException(): void { try { fopen('spiral://non-exists', 'rb'); @@ -92,7 +92,7 @@ public function testException() /** * @requires PHP >= 8.0 */ - public function testExceptionPHP8() + public function testExceptionPHP8(): void { try { fopen('spiral://non-exists', 'rb'); @@ -107,7 +107,7 @@ public function testExceptionPHP8() } } - public function testWriteIntoStream() + public function testWriteIntoStream(): void { $stream = Stream::create(fopen('php://temp', 'wrb+')); $file = StreamWrapper::getFilename($stream); diff --git a/src/Tokenizer/tests/ReflectionFileTest.php b/src/Tokenizer/tests/ReflectionFileTest.php index 333ccb873..6fb55a1be 100644 --- a/src/Tokenizer/tests/ReflectionFileTest.php +++ b/src/Tokenizer/tests/ReflectionFileTest.php @@ -113,7 +113,7 @@ private function deadend() } } -function hello() +function hello(): void { } diff --git a/tests/Framework/Framework/KernelTest.php b/tests/Framework/Framework/KernelTest.php index 6f73b3340..4d39c9d5b 100644 --- a/tests/Framework/Framework/KernelTest.php +++ b/tests/Framework/Framework/KernelTest.php @@ -9,7 +9,7 @@ final class KernelTest extends BaseTestCase { - public function testAppBootingCallbacks() + public function testAppBootingCallbacks(): void { $kernel = $this->createAppInstance(); diff --git a/tests/Framework/SnapshotTest.php b/tests/Framework/SnapshotTest.php index 5096bc406..9f9f0db7b 100644 --- a/tests/Framework/SnapshotTest.php +++ b/tests/Framework/SnapshotTest.php @@ -9,7 +9,7 @@ final class SnapshotTest extends BaseTestCase { - public function testStringConfigParams() + public function testStringConfigParams(): void { // string important. Emulating string from .env $app = $this->makeApp([