Skip to content

Commit 781f01e

Browse files
committed
Rector type coverage level 2
1 parent 78d64ef commit 781f01e

13 files changed

Lines changed: 30 additions & 30 deletions

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
__DIR__ . '/tests',
1212
])
1313
->withPhpSets()
14-
->withTypeCoverageLevel(1)
14+
->withTypeCoverageLevel(2)
1515
->withDeadCodeLevel(2)
1616
->withCodeQualityLevel(10)
1717
->withCodingStyleLevel(0)

tests/BasePoLoaderTestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ abstract class BasePoLoaderTestCase extends TestCase
1111
{
1212
abstract protected function createPoLoader(): Loader;
1313

14-
public function testPoLoader()
14+
public function testPoLoader(): void
1515
{
1616
$loader = $this->createPoLoader();
1717
$translations = $loader->loadFile(__DIR__.'/assets/translations.po');
@@ -260,7 +260,7 @@ public function stringDecodeProvider()
260260
* @param mixed $source
261261
* @param mixed $decoded
262262
*/
263-
public function testStringDecode($source, $decoded)
263+
public function testStringDecode($source, $decoded): void
264264
{
265265
$po = <<<EOT
266266
msgid "source"
@@ -270,7 +270,7 @@ public function testStringDecode($source, $decoded)
270270
$this->assertSame($decoded, $translations->find(null, 'source')->getTranslation());
271271
}
272272

273-
public function testMultilineDisabledTranslations()
273+
public function testMultilineDisabledTranslations(): void
274274
{
275275
$po = <<<'EOT'
276276
#~ msgid "Last agent hours-description"

tests/CommentsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class CommentsTest extends TestCase
1010
{
11-
public function testComments()
11+
public function testComments(): void
1212
{
1313
$comments = new Comments();
1414

@@ -36,7 +36,7 @@ public function testComments()
3636
$this->assertCount(1, $comments);
3737
}
3838

39-
public function testMergeComments()
39+
public function testMergeComments(): void
4040
{
4141
$comments1 = new Comments('one', 'two', 'three');
4242
$comments2 = new Comments('three', 'four', 'five');
@@ -50,7 +50,7 @@ public function testMergeComments()
5050
$this->assertNotSame($merged, $comments2);
5151
}
5252

53-
public function testCreateFromState()
53+
public function testCreateFromState(): void
5454
{
5555
$state = ['comments' => ['First comment', 'Second comment']];
5656
$comments = Comments::__set_state($state);

tests/FlagsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class FlagsTest extends TestCase
1010
{
11-
public function testFlags()
11+
public function testFlags(): void
1212
{
1313
$flags = new Flags();
1414

@@ -41,7 +41,7 @@ public function testFlags()
4141
$this->assertCount(2, $flags);
4242
}
4343

44-
public function testMergeFlags()
44+
public function testMergeFlags(): void
4545
{
4646
$flags1 = new Flags('one', 'two', 'three');
4747
$flags2 = new Flags('three', 'four', 'five');
@@ -61,7 +61,7 @@ public function testMergeFlags()
6161
$this->assertNotSame($merged, $flags2);
6262
}
6363

64-
public function testCreateFromState()
64+
public function testCreateFromState(): void
6565
{
6666
$state = ['flags' => ['one', 'two']];
6767
$flags = Flags::__set_state($state);

tests/HeadersTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class HeadersTest extends TestCase
1111
{
12-
public function testHeaders()
12+
public function testHeaders(): void
1313
{
1414
$headers = new Headers();
1515

@@ -41,7 +41,7 @@ public function testHeaders()
4141
$this->assertCount(0, $headers);
4242
}
4343

44-
public function testDomain()
44+
public function testDomain(): void
4545
{
4646
$headers = new Headers();
4747
$headers->setDomain('foo');
@@ -52,7 +52,7 @@ public function testDomain()
5252
$this->assertSame('foo', $headers->getDomain());
5353
}
5454

55-
public function testLanguage()
55+
public function testLanguage(): void
5656
{
5757
$headers = new Headers();
5858
$headers->setLanguage('gl_ES');
@@ -63,15 +63,15 @@ public function testLanguage()
6363
$this->assertSame('gl_ES', $headers->getLanguage());
6464
}
6565

66-
public function testInvalidLanguage()
66+
public function testInvalidLanguage(): void
6767
{
6868
$this->expectException(InvalidArgumentException::class);
6969

7070
$headers = new Headers();
7171
$headers->setPluralForm(1, 'foo');
7272
}
7373

74-
public function testPluralForm()
74+
public function testPluralForm(): void
7575
{
7676
$headers = new Headers();
7777
$headers->setPluralForm(2, '(n=1)');
@@ -82,7 +82,7 @@ public function testPluralForm()
8282
$this->assertSame([2, '(n=1)'], $headers->getPluralForm());
8383
}
8484

85-
public function testMergeHeaders()
85+
public function testMergeHeaders(): void
8686
{
8787
$headers1 = new Headers(['X-Domain' => 'foo', 'Language' => 'gl_ES']);
8888
$headers2 = new Headers(['Translator' => 'Oscar Otero', 'Language' => 'ru']);
@@ -97,7 +97,7 @@ public function testMergeHeaders()
9797
$this->assertNotSame($merged, $headers2);
9898
}
9999

100-
public function testCreateFromState()
100+
public function testCreateFromState(): void
101101
{
102102
$state = ['headers' => ['X-Domain' => 'foo']];
103103
$headers = Headers::__set_state($state);

tests/MergeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private static function createPO(): Translations
9393
return $translations;
9494
}
9595

96-
public function testNoStrategy()
96+
public function testNoStrategy(): void
9797
{
9898
$pot = self::createPOT();
9999
$po = self::createPO();
@@ -106,7 +106,7 @@ public function testNoStrategy()
106106
/**
107107
* We want to use the scanner to fetch new entries and complete them with PO files.
108108
*/
109-
public function testScanAndLoadStrategy()
109+
public function testScanAndLoadStrategy(): void
110110
{
111111
$pot = self::createPOT();
112112
$po = self::createPO();

tests/MoGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class MoGeneratorTest extends TestCase
1313
{
14-
public function testMoGenerator()
14+
public function testMoGenerator(): void
1515
{
1616
$generator = (new MoGenerator())->includeHeaders();
1717
$loader = new MoLoader();

tests/MoLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class MoLoaderTest extends TestCase
1111
{
12-
public function testMoLoader()
12+
public function testMoLoader(): void
1313
{
1414
$loader = new MoLoader();
1515
$translations = $loader->loadFile(__DIR__.'/assets/translations.mo');

tests/ParsedFunctionsAndCommentsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class ParsedFunctionsAndCommentsTest extends TestCase
1010
{
11-
public function testParsedFunction()
11+
public function testParsedFunction(): void
1212
{
1313
$function = new ParsedFunction('__', 'template.php', 45);
1414

tests/PoGeneratorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class PoGeneratorTest extends TestCase
1212
{
13-
public function testPoLoader()
13+
public function testPoLoader(): void
1414
{
1515
$generator = new PoGenerator();
1616
$translations = Translations::create('my-domain');
@@ -112,7 +112,7 @@ public function stringEncodeProvider()
112112
* @param mixed $encoded
113113
* @param mixed $decoded
114114
*/
115-
public function testStringEncode($encoded, $decoded)
115+
public function testStringEncode($encoded, $decoded): void
116116
{
117117
$this->assertSame($encoded, PoGenerator::encode($decoded));
118118
}

0 commit comments

Comments
 (0)