-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DeadCode] Add fixture for keep constant type on @var usage on Remove…
…UselessVarTagRector (#3596)
- Loading branch information
1 parent
9629890
commit cc30d2d
Showing
6 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
.../DeadCode/Rector/Property/RemoveUselessVarTagRector/Fixture/keep_const_float_type.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
13 changes: 13 additions & 0 deletions
13
...eadCode/Rector/Property/RemoveUselessVarTagRector/Fixture/keep_const_integer_type.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
13 changes: 13 additions & 0 deletions
13
...-tests/DeadCode/Rector/Property/RemoveUselessVarTagRector/Fixture/keep_const_type.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
12 changes: 12 additions & 0 deletions
12
...eadCode/Rector/Property/RemoveUselessVarTagRector/Source/Source/SomeConstantFloatType.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
12 changes: 12 additions & 0 deletions
12
...dCode/Rector/Property/RemoveUselessVarTagRector/Source/Source/SomeConstantIntegerType.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
12 changes: 12 additions & 0 deletions
12
...sts/DeadCode/Rector/Property/RemoveUselessVarTagRector/Source/Source/SomeConstantType.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |