Skip to content

Commit db2985e

Browse files
minor #51067 Use typed properties in tests as much as possible (nicolas-grekas)
This PR was merged into the 6.4 branch. Discussion ---------- Use typed properties in tests as much as possible | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- 4ad506b085 Use typed properties in tests as much as possible
2 parents 1974909 + aae2c3f commit db2985e

39 files changed

+57
-62
lines changed

Tests/Command/AboutCommand/AboutCommandTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222
class AboutCommandTest extends TestCase
2323
{
24-
/** @var Filesystem */
25-
private $fs;
24+
private Filesystem $fs;
2625

2726
protected function setUp(): void
2827
{

Tests/Command/CachePoolClearCommandTest.php

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

2424
class CachePoolClearCommandTest extends TestCase
2525
{
26-
private $cachePool;
26+
private CacheItemPoolInterface $cachePool;
2727

2828
protected function setUp(): void
2929
{

Tests/Command/CachePoolDeleteCommandTest.php

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

2525
class CachePoolDeleteCommandTest extends TestCase
2626
{
27-
private $cachePool;
27+
private MockObject&CacheItemPoolInterface $cachePool;
2828

2929
protected function setUp(): void
3030
{

Tests/Command/TranslationDebugCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
class TranslationDebugCommandTest extends TestCase
3030
{
31-
private $fs;
32-
private $translationDir;
31+
private Filesystem $fs;
32+
private string $translationDir;
3333

3434
public function testDebugMissingMessages()
3535
{

Tests/Command/TranslationUpdateCommandCompletionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
class TranslationUpdateCommandCompletionTest extends TestCase
2929
{
30-
private $fs;
31-
private $translationDir;
30+
private Filesystem $fs;
31+
private string $translationDir;
3232

3333
/**
3434
* @dataProvider provideCompletionSuggestions

Tests/Command/TranslationUpdateCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
class TranslationUpdateCommandTest extends TestCase
2828
{
29-
private $fs;
30-
private $translationDir;
29+
private Filesystem $fs;
30+
private string $translationDir;
3131

3232
public function testDumpMessagesAndCleanWithDeprecatedCommandName()
3333
{

Tests/Command/XliffLintCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030
class XliffLintCommandTest extends TestCase
3131
{
32-
private $files;
32+
private array $files;
3333

3434
public function testGetHelp()
3535
{

Tests/Command/YamlLintCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
class YamlLintCommandTest extends TestCase
3030
{
31-
private $files;
31+
private array $files;
3232

3333
public function testLintCorrectFile()
3434
{

Tests/Console/Descriptor/AbstractDescriptorTestCase.php

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

2727
abstract class AbstractDescriptorTestCase extends TestCase
2828
{
29-
private $colSize;
29+
private string|false $colSize;
3030

3131
protected function setUp(): void
3232
{

Tests/Console/Descriptor/TextDescriptorTest.php

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

1818
class TextDescriptorTest extends AbstractDescriptorTestCase
1919
{
20-
private static $fileLinkFormatter;
20+
private static ?FileLinkFormatter $fileLinkFormatter = null;
2121

2222
protected static function getDescriptor()
2323
{

0 commit comments

Comments
 (0)