8000 Use typed properties in tests as much as possible · symfony/templating@fc12f00 · GitHub
[go: up one dir, main page]

Skip to content

Commit fc12f00

Browse files
Use typed properties in tests as much as possible
1 parent 27d7947 commit fc12f00

File tree

4 files changed

+6
-16
lines changed

4 files changed

+6
-16
lines changed

Tests/Loader/ChainLoaderTest.php

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

1919
class ChainLoaderTest extends TestCase
2020
{
21-
protected $loader1;
22-
protected $loader2;
21+
protected FilesystemLoader $loader1;
22+
protected FilesystemLoader $loader2;
2323

2424
protected function setUp(): void
2525
{

Tests/Loader/FilesystemLoaderTest.php

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

2020
class FilesystemLoaderTest extends TestCase
2121
{
22-
protected static $fixturesPath;
22+
protected static string $fixturesPath;
2323

2424
public static function setUpBeforeClass(): void
2525
{

Tests/PhpEngineTest.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,13 @@
2424

2525
class PhpEngineTest extends TestCase
2626
{
27-
protected $loader;
27+
protected ProjectTemplateLoader $loader;
2828

2929
protected function setUp(): void
3030
{
3131
$this->loader = new ProjectTemplateLoader();
3232
}
3333

34-
protected function tearDown(): void
35-
{
36-
$this->loader = null;
37-
}
38-
3934
public function testConstructor()
4035
{
4136
$engine = new ProjectTemplateEngine(new TemplateNameParser(), $this->loader);
@@ -204,7 +199,7 @@ public function getLoader(): LoaderInterface
204199

205200
class ProjectTemplateLoader extends Loader
206201
{
207-
public $templates = [];
202+
public array $templates = [];
208203

209204
public function setTemplate($name, $content)
210205
{

Tests/TemplateNameParserTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,13 @@
1717

1818
class TemplateNameParserTest extends TestCase
1919
{
20-
protected $parser;
20+
protected TemplateNameParser $parser;
2121

2222
protected function setUp(): void
2323
{
2424
$this->parser = new TemplateNameParser();
2525
}
2626

27-
protected function tearDown(): void
28-
{
29-
$this->parser = null;
30-
}
31-
3227
/**
3328
* @dataProvider getLogicalNameToTemplateProvider
3429
*/

0 commit comments

Comments
 (0)
0