Skip to content

Commit 14640af

Browse files
authored
Merge pull request #6 from infection/add-type-declaration
Add property type declaration instead of doc-blocks
2 parents 49853c9 + b6477f2 commit 14640af

10 files changed

Lines changed: 24 additions & 45 deletions

src/CommandLineBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ final class CommandLineBuilder
4646
/**
4747
* @var string[]|null
4848
*/
49-
private $cachedPhpCmdLine;
49+
private ?array $cachedPhpCmdLine = null;
5050

5151
/**
5252
* @param string[] $frameworkArgs

src/Config/AbstractYamlConfiguration.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,14 @@
4242
*/
4343
abstract class AbstractYamlConfiguration
4444
{
45-
/**
46-
* @var string
47-
*/
48-
protected $tempDirectory;
45+
protected string $tempDirectory;
4946

5047
/**
5148
* @var array<string, mixed>
5249
*/
53-
protected $parsedYaml;
50+
protected array $parsedYaml;
5451

5552
/**
56-
* AbstractYamlConfiguration constructor.
57-
*
5853
* @param array<string, mixed> $parsedYaml
5954
*/
6055
public function __construct(string $tmpDir, array $parsedYaml)

src/Config/Builder/InitialConfigBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
*/
4444
class InitialConfigBuilder
4545
{
46-
private $tempDirectory;
47-
private $originalYamlConfigPath;
48-
private $skipCoverage;
46+
private string $tempDirectory;
47+
private string $originalYamlConfigPath;
48+
private bool $skipCoverage;
4949

5050
public function __construct(string $tempDirectory, string $originalYamlConfigPath, bool $skipCoverage)
5151
{

src/Config/Builder/MutationConfigBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
*/
4848
class MutationConfigBuilder
4949
{
50-
private $tempDirectory;
51-
private $originalYamlConfigPath;
52-
private $projectDir;
50+
private string $tempDirectory;
51+
private string $originalYamlConfigPath;
52+
private string $projectDir;
5353

5454
public function __construct(string $tempDirectory, string $originalYamlConfigPath, string $projectDir)
5555
{

src/Config/InitialYamlConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
*/
4444
final class InitialYamlConfiguration extends AbstractYamlConfiguration
4545
{
46-
private $skipCoverage;
46+
private bool $skipCoverage;
4747

4848
/**
4949
* @param array<string, mixed> $parsedYaml

src/Config/MutationYamlConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
*/
4343
final class MutationYamlConfiguration extends AbstractYamlConfiguration
4444
{
45-
private $customAutoloadFilePath;
45+
private string $customAutoloadFilePath;
4646

4747
/**
4848
* @param array<string, mixed> $parsedYaml

src/PhpSpecAdapter.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ final class PhpSpecAdapter implements TestFrameworkAdapter
5252
'/Fatal error happened/i',
5353
];
5454

55-
private $testFrameworkExecutable;
56-
private $argumentsAndOptionsBuilder;
57-
private $initialConfigBuilder;
58-
private $mutationConfigBuilder;
59-
private $versionParser;
60-
private $commandLineBuilder;
55+
private string $testFrameworkExecutable;
56+
private ArgumentsAndOptionsBuilder $argumentsAndOptionsBuilder;
57+
private InitialConfigBuilder $initialConfigBuilder;
58+
private MutationConfigBuilder $mutationConfigBuilder;
59+
private VersionParser $versionParser;
60+
private CommandLineBuilder $commandLineBuilder;
6161
private ?string $cachedVersion = null;
6262

6363
public function __construct(

tests/phpunit/Config/InitialYamlConfigurationTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,12 @@
4343

4444
final class InitialYamlConfigurationTest extends TestCase
4545
{
46-
/**
47-
* @var string
48-
*/
49-
private $tempDir = '/path/to/tmp';
46+
private string $tempDir = '/path/to/tmp';
5047

5148
/**
5249
* @var array<string, mixed>
5350
*/
54-
private $defaultConfig = [
51+
private array $defaultConfig = [
5552
'extensions' => [
5653
'SomeOtherExtension' => [],
5754
'PhpSpecCodeCoverageExtension' => [

tests/phpunit/Config/MutationYamlConfigurationTest.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,14 @@
4141

4242
final class MutationYamlConfigurationTest extends TestCase
4343
{
44-
/**
45-
* @var string
46-
*/
47-
private $tempDir = '/path/to/tmp';
44+
private string $tempDir = '/path/to/tmp';
4845

49-
/**
50-
* @var string
51-
*/
52-
private $customAutoloadFilePath = '/custom/path';
46+
private string $customAutoloadFilePath = '/custom/path';
5347

5448
/**
5549
* @var array<string, mixed>
5650
*/
57-
private $defaultConfig = [
51+
private array $defaultConfig = [
5852
'extensions' => [
5953
'FirstExtension' => [],
6054
'PhpSpecCodeCoverageExtension' => [

tests/phpunit/FileSystem/FileSystemTestCase.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,8 @@ abstract class FileSystemTestCase extends TestCase
6060
{
6161
private const TMP_DIR_NAME = 'infection-test';
6262

63-
/**
64-
* @var string
65-
*/
66-
protected $cwd;
67-
68-
/**
69-
* @var string
70-
*/
71-
protected $tmp;
63+
protected string $cwd;
64+
protected string $tmp;
7265

7366
public static function tearDownAfterClass(): void
7467
{

0 commit comments

Comments
 (0)