-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Down_To_PHP71] Handle Downgrade Param Widening + Downgrade Reflectio…
…n Get on DowngradeLevelSetList::DOWN_TO_PHP_71 (#3001) Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
e4ec1f9
commit 4cecebf
Showing
3 changed files
with
88 additions
and
6 deletions.
There are no files selected for viewing
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
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
44 changes: 44 additions & 0 deletions
44
...sueDowngradeParamType/FixtureDownToPhp71/downgrade_param_reflection_get_attribute.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,44 @@ | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\IssueDowngradeParamType\FixtureDownToPhp71; | ||
|
||
use ReflectionClass; | ||
|
||
class DowngradeParamReflectionGetAttribute | ||
{ | ||
public function run(ReflectionClass $reflectionClass) | ||
{ | ||
echo $reflectionClass->getFileName(); | ||
|
||
if ($reflectionClass->getAttributes()) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Core\Tests\Issues\IssueDowngradeParamType\FixtureDownToPhp71; | ||
|
||
use ReflectionClass; | ||
|
||
class DowngradeParamReflectionGetAttribute | ||
{ | ||
/** | ||
* @param \ReflectionClass $reflectionClass | ||
*/ | ||
public function run($reflectionClass) | ||
{ | ||
echo $reflectionClass->getFileName(); | ||
|
||
if (method_exists($reflectionClass, 'getAttributes') ? $reflectionClass->getAttributes() : []) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
} | ||
|
||
?> |