-
-
Notifications
You must be signed in to change notification settings - Fork 351
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 to remove already known more specific type (#6309
) * [DeadCode] Add fixture to remove already known more specific type * Remove more specific property type
- Loading branch information
1 parent
04bd2bb
commit bbdeb0f
Showing
7 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
.../Rector/Property/RemoveUselessVarTagRector/Fixture/remove_specific_typed_property.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,32 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Fixture; | ||
|
||
use Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source\SomeConstantFloatType; | ||
use Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source\SomeMoreSpecificObject; | ||
use Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source\SomeObject; | ||
|
||
final class RemoveSpecificTypedProperty | ||
{ | ||
/** | ||
* @var SomeObject | ||
*/ | ||
public SomeMoreSpecificObject $name; | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Fixture; | ||
|
||
use Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source\SomeConstantFloatType; | ||
use Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source\SomeMoreSpecificObject; | ||
use Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source\SomeObject; | ||
|
||
final class RemoveSpecificTypedProperty | ||
{ | ||
public SomeMoreSpecificObject $name; | ||
} | ||
|
||
?> |
14 changes: 14 additions & 0 deletions
14
...e/Rector/Property/RemoveUselessVarTagRector/Fixture/skip_different_typed_property.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,14 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Fixture; | ||
|
||
use Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source\DifferentTypeProperty; | ||
use Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source\SomeMoreSpecificObject; | ||
|
||
final class SkipDifferentTypedProperty | ||
{ | ||
/** | ||
* @var DifferentTypeProperty | ||
*/ | ||
public SomeMoreSpecificObject $name; | ||
} |
15 changes: 15 additions & 0 deletions
15
...or/Property/RemoveUselessVarTagRector/Fixture/skip_more_specific_type_in_docblock.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,15 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Fixture; | ||
|
||
use Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source\DifferentTypeProperty; | ||
use Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source\SomeMoreSpecificObject; | ||
use Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source\SomeObject; | ||
|
||
final class SkipMoreSpecificTypeInDocblock | ||
{ | ||
/** | ||
* @var SomeMoreSpecificObject | ||
*/ | ||
public SomeObject $name; | ||
} |
8 changes: 8 additions & 0 deletions
8
...tests/DeadCode/Rector/Property/RemoveUselessVarTagRector/Source/DifferentTypeProperty.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,8 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source; | ||
|
||
final class DifferentTypeProperty | ||
{ | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
...ests/DeadCode/Rector/Property/RemoveUselessVarTagRector/Source/SomeMoreSpecificObject.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,8 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source; | ||
|
||
final class SomeMoreSpecificObject extends SomeObject | ||
{ | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
rules-tests/DeadCode/Rector/Property/RemoveUselessVarTagRector/Source/SomeObject.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,8 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\DeadCode\Rector\Property\RemoveUselessVarTagRector\Source; | ||
|
||
class SomeObject | ||
{ | ||
|
||
} |
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