Skip to content

Commit

Permalink
[DeadCode] Add fixture for keep constant type on @var usage on Remove…
Browse files Browse the repository at this point in the history
…UselessVarTagRector (#3596)
  • Loading branch information
samsonasik committed Apr 9, 2023
1 parent 9629890 commit cc30d2d
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Fixture;

use Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source\SomeConstantFloatType;

final class KeepConstantFloatType
{
/**
* @var SomeConstantFloatType::*
*/
public float $name = SomeConstantFloatType::ONE_HALF;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Fixture;

use Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source\SomeConstantIntegerType;

final class KeepConstantIntegerType
{
/**
* @var SomeConstantIntegerType::*
*/
public int $name = SomeConstantIntegerType::ONE;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Fixture;

use Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source\SomeConstantType;

final class KeepConstantType
{
/**
* @var SomeConstantIntegerType::*
*/
public string $name = SomeConstantType::YES;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source;

final class SomeConstantFloatType
{
public const ONE_HALF = 1.5;

public const TWO_HALF = 2.5;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source;

final class SomeConstantIntegerType
{
public const ONE = 1;

public const TWO = 2;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source;

final class SomeConstantType
{
public const YES = 'yes';

public const NO = 'no';
}

0 comments on commit cc30d2d

Please sign in to comment.