Skip to content

Commit

Permalink
chore: phpdoc_to_property_type
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Dec 18, 2024
1 parent a942a21 commit 26d1267
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 80 deletions.
2 changes: 1 addition & 1 deletion tests/Console/Command/DescribeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ private static function createFixerWithSamplesDouble(array $samples): FixerInter
/**
* @var list<CodeSampleInterface>
*/
private $samples;
private array $samples;

/**
* @param list<CodeSampleInterface> $samples
Expand Down
5 changes: 1 addition & 4 deletions tests/Console/Command/SelfUpdateCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@
*/
final class SelfUpdateCommandTest extends TestCase
{
/**
* @var null|vfsStreamDirectory
*/
private $root;
private ?vfsStreamDirectory $root = null;

protected function setUp(): void
{
Expand Down
5 changes: 1 addition & 4 deletions tests/Console/Report/FixReport/AbstractReporterTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
*/
abstract class AbstractReporterTestCase extends TestCase
{
/**
* @var null|ReporterInterface
*/
protected $reporter;
protected ?ReporterInterface $reporter = null;

protected function setUp(): void
{
Expand Down
4 changes: 1 addition & 3 deletions tests/Console/Report/FixReport/CheckstyleReporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ final class CheckstyleReporterTest extends AbstractReporterTestCase
{
/**
* "checkstyle" XML schema.
*
* @var null|string
*/
private static $xsd;
private static ?string $xsd = null;

public static function setUpBeforeClass(): void
{
Expand Down
4 changes: 1 addition & 3 deletions tests/Console/Report/FixReport/JunitReporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ final class JunitReporterTest extends AbstractReporterTestCase
/**
* JUnit XML schema from Jenkins.
*
* @var null|string
*
* @see https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd
*/
private static $xsd;
private static ?string $xsd = null;

public static function setUpBeforeClass(): void
{
Expand Down
5 changes: 1 addition & 4 deletions tests/Console/Report/FixReport/XmlReporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
*/
final class XmlReporterTest extends AbstractReporterTestCase
{
/**
* @var null|string
*/
private static $xsd;
private static ?string $xsd = null;

public static function setUpBeforeClass(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
*/
abstract class AbstractReporterTestCase extends TestCase
{
/**
* @var null|ReporterInterface
*/
protected $reporter;
protected ?ReporterInterface $reporter = null;

protected function setUp(): void
{
Expand Down
12 changes: 5 additions & 7 deletions tests/DocBlock/AnnotationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ final class AnnotationTest extends TestCase
{
/**
* This represents the content an entire docblock.
*
* @var string
*/
private static $sample = '/**
private static string $sample = '/**
* Test docblock.
*
* @param string $hello
Expand All @@ -58,7 +56,7 @@ final class AnnotationTest extends TestCase
*
* @var list<string>
*/
private static $content = [
private static array $content = [
" * @param string \$hello\n",
" * @param bool \$test Description\n * extends over many lines\n",
" * @param adkjbadjasbdand \$asdnjkasd\n",
Expand All @@ -71,21 +69,21 @@ final class AnnotationTest extends TestCase
*
* @var list<int>
*/
private static $start = [3, 4, 7, 9, 14];
private static array $start = [3, 4, 7, 9, 14];

/**
* This represents the start indexes of each annotation.
*
* @var list<int>
*/
private static $end = [3, 5, 7, 12, 14];
private static array $end = [3, 5, 7, 12, 14];

/**
* This represents the tag type of each annotation.
*
* @var list<string>
*/
private static $tags = ['param', 'param', 'param', 'throws', 'return'];
private static array $tags = ['param', 'param', 'param', 'throws', 'return'];

/**
* @dataProvider provideGetContentCases
Expand Down
4 changes: 1 addition & 3 deletions tests/DocBlock/DocBlockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ final class DocBlockTest extends TestCase
{
/**
* This represents the content an entire docblock.
*
* @var string
*/
private static $sample = '/**
private static string $sample = '/**
* Test docblock.
*
* @param string $hello
Expand Down
10 changes: 4 additions & 6 deletions tests/DocBlock/LineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ final class LineTest extends TestCase
{
/**
* This represents the content an entire docblock.
*
* @var string
*/
private static $sample = '/**
private static string $sample = '/**
* Test docblock.
*
* @param string $hello
Expand All @@ -53,7 +51,7 @@ final class LineTest extends TestCase
*
* @var list<string>
*/
private static $content = [
private static array $content = [
"/**\n",
" * Test docblock.\n",
" *\n",
Expand All @@ -76,7 +74,7 @@ final class LineTest extends TestCase
*
* @var list<bool>
*/
private static $useful = [
private static array $useful = [
false,
true,
false,
Expand All @@ -99,7 +97,7 @@ final class LineTest extends TestCase
*
* @var list<bool>
*/
private static $tag = [
private static array $tag = [
false,
false,
false,
Expand Down
4 changes: 1 addition & 3 deletions tests/FileRemovalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ final class FileRemovalTest extends TestCase
* This is necessary for testShutdownRemovesObserved files, as the setup
* runs in a separate process to trigger the shutdown function, and
* tearDownAfterClass is called for every separate process
*
* @var bool
*/
private static $removeFilesOnTearDown = true;
private static bool $removeFilesOnTearDown = true;

public static function tearDownAfterClass(): void
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Fixer/FunctionNotation/FunctionDeclarationFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ final class FunctionDeclarationFixerTest extends AbstractFixerTestCase
/**
* @var array<string, string>
*/
private static $configurationClosureSpacingNone = ['closure_function_spacing' => FunctionDeclarationFixer::SPACING_NONE];
private static array $configurationClosureSpacingNone = ['closure_function_spacing' => FunctionDeclarationFixer::SPACING_NONE];

/**
* @var array<string, string>
*/
private static $configurationArrowSpacingNone = ['closure_fn_spacing' => FunctionDeclarationFixer::SPACING_NONE];
private static array $configurationArrowSpacingNone = ['closure_fn_spacing' => FunctionDeclarationFixer::SPACING_NONE];

public function testInvalidConfigurationClosureFunctionSpacing(): void
{
Expand Down
5 changes: 1 addition & 4 deletions tests/Smoke/CiIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
*/
final class CiIntegrationTest extends AbstractSmokeTestCase
{
/**
* @var string
*/
public static $fixtureDir;
public static string $fixtureDir;

public static function setUpBeforeClass(): void
{
Expand Down
10 changes: 2 additions & 8 deletions tests/Smoke/PharTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,9 @@
*/
final class PharTest extends AbstractSmokeTestCase
{
/**
* @var string
*/
private static $pharCwd;
private static string $pharCwd;

/**
* @var string
*/
private static $pharName;
private static string $pharName;

public static function setUpBeforeClass(): void
{
Expand Down
7 changes: 2 additions & 5 deletions tests/Test/AbstractFixerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,12 @@ abstract class AbstractFixerTestCase extends TestCase
{
use AssertTokensTrait;

/**
* @var null|LinterInterface
*/
protected $linter;
protected ?LinterInterface $linter = null;

/**
* @var null|TFixer
*/
protected $fixer;
protected ?AbstractFixer $fixer = null;

/**
* do not modify this structure without prior discussion.
Expand Down
2 changes: 1 addition & 1 deletion tests/Test/AbstractFixerWithAliasedOptionsTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ abstract class AbstractFixerWithAliasedOptionsTestCase extends AbstractFixerTest
/**
* @var null|TFixer
*/
private $fixerWithAliasedConfig;
private ?AbstractFixer $fixerWithAliasedConfig = null;

protected function tearDown(): void
{
Expand Down
10 changes: 2 additions & 8 deletions tests/Test/AbstractIntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,9 @@
*/
abstract class AbstractIntegrationTestCase extends TestCase
{
/**
* @var null|LinterInterface
*/
protected $linter;
protected ?LinterInterface $linter = null;

/**
* @var null|FileRemoval
*/
private static $fileRemoval;
private static ?FileRemoval $fileRemoval = null;

public static function setUpBeforeClass(): void
{
Expand Down
5 changes: 1 addition & 4 deletions tests/Test/AbstractTransformerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
*/
abstract class AbstractTransformerTestCase extends TestCase
{
/**
* @var null|TransformerInterface
*/
protected $transformer;
protected ?TransformerInterface $transformer = null;

protected function setUp(): void
{
Expand Down
7 changes: 2 additions & 5 deletions tests/Test/TokensWithObservedTransformers.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@

class TokensWithObservedTransformers extends Tokens
{
/**
* @var null|string
*/
public $currentTransformer;
public ?string $currentTransformer = null;

/**
* @var array<string, list<int|string>>
*/
public $observedModificationsPerTransformer = [];
public array $observedModificationsPerTransformer = [];

public function offsetSet($index, $newval): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/UtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class UtilsTest extends TestCase
/**
* @var null|false|string
*/
private $originalValueOfFutureMode;
private null|bool|string $originalValueOfFutureMode;

protected function setUp(): void
{
Expand Down

0 comments on commit 26d1267

Please sign in to comment.