-
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [Php80] Add MixedTypeRector * fixture * apply type param * apply type param * [ci-review] Rector Rectify * fix type definition * [ci-review] Rector Rectify * identifier * phpstan * remove doc only mixed * doc * doc & Node * register * try check string or object type * check virtual node * fix * update FileCache mixed as skipped in rector.php * skip no mixed doc param * [ci-review] Rector Rectify * [ci-review] Rector Rectify * [ci-review] Rector Rectify * implemented with add MakeClassMethodParamMixedTypedGuard * [ci-review] Rector Rectify * [ci-review] Rector Rectify * only make typed with use doc @param mixed * rollback invalid change * add fixture for override public method * fixture for skip has pubilc child method * rename fixture * void return for paramTagRemover->removeParamTagsIfUseless() * implemented check has child or parent method 🎉 * [ci-review] Rector Rectify Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
4ed677d
commit 69d3c92
Showing
32 changed files
with
358 additions
and
84 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
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
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
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
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
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
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
28 changes: 28 additions & 0 deletions
28
rules-tests/Php80/Rector/FunctionLike/MixedTypeRector/Fixture/fixture.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,28 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\MixedTypeRector\Fixture; | ||
|
||
class Fixture | ||
{ | ||
/** | ||
* @param mixed $param | ||
*/ | ||
public function run($param) | ||
{ | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\MixedTypeRector\Fixture; | ||
|
||
class Fixture | ||
{ | ||
public function run(mixed $param) | ||
{ | ||
} | ||
} | ||
|
||
?> |
28 changes: 28 additions & 0 deletions
28
rules-tests/Php80/Rector/FunctionLike/MixedTypeRector/Fixture/remove_mixed_param_doc.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,28 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\MixedTypeRector\Fixture; | ||
|
||
class RemoveMixedParamDoc | ||
{ | ||
/** | ||
* @param mixed $param | ||
*/ | ||
public function run(mixed $param) | ||
{ | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\MixedTypeRector\Fixture; | ||
|
||
class RemoveMixedParamDoc | ||
{ | ||
public function run(mixed $param) | ||
{ | ||
} | ||
} | ||
|
||
?> |
10 changes: 10 additions & 0 deletions
10
...s-tests/Php80/Rector/FunctionLike/MixedTypeRector/Fixture/skip_already_mixed_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,10 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\MixedTypeRector\Fixture; | ||
|
||
class SkipAlreadyMixedType | ||
{ | ||
public function run(mixed $param) | ||
{ | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
rules-tests/Php80/Rector/FunctionLike/MixedTypeRector/Fixture/skip_has_child_method.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,23 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\MixedTypeRector\Fixture; | ||
|
||
class SkipHasChildMethod | ||
{ | ||
/** | ||
* @param mixed $param | ||
*/ | ||
public function run($param) | ||
{ | ||
} | ||
} | ||
|
||
class SomeChild extends SkipHasChildMethod | ||
{ | ||
/** | ||
* @param int $param | ||
*/ | ||
public function run($param) | ||
{ | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...s-tests/Php80/Rector/FunctionLike/MixedTypeRector/Fixture/skip_no_mixed_param_doc.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,10 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\MixedTypeRector\Fixture; | ||
|
||
class NoMixedParamDoc | ||
{ | ||
public function run($param) | ||
{ | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...sts/Php80/Rector/FunctionLike/MixedTypeRector/Fixture/skip_override_parent_method.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\Php80\Rector\FunctionLike\MixedTypeRector\Fixture; | ||
|
||
use Rector\Tests\Php80\Rector\FunctionLike\MixedTypeRector\Source\SomeParentNotMixedDocParam; | ||
|
||
class SkipOverrideParentMethod extends SomeParentNotMixedDocParam | ||
{ | ||
/** | ||
* @param mixed $param | ||
*/ | ||
public function run($param) | ||
{ | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
rules-tests/Php80/Rector/FunctionLike/MixedTypeRector/MixedTypeRectorTest.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,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\MixedTypeRector; | ||
|
||
use Iterator; | ||
use Rector\Testing\PHPUnit\AbstractRectorTestCase; | ||
use Symplify\SmartFileSystem\SmartFileInfo; | ||
|
||
final class MixedTypeRectorTest extends AbstractRectorTestCase | ||
{ | ||
/** | ||
* @dataProvider provideData() | ||
*/ | ||
public function test(SmartFileInfo $fileInfo): void | ||
{ | ||
$this->doTestFileInfo($fileInfo); | ||
} | ||
|
||
/** | ||
* @return Iterator<SmartFileInfo> | ||
*/ | ||
public function provideData(): Iterator | ||
{ | ||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); | ||
} | ||
|
||
public function provideConfigFilePath(): string | ||
{ | ||
return __DIR__ . '/config/configured_rule.php'; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
rules-tests/Php80/Rector/FunctionLike/MixedTypeRector/Source/SomeParentNotMixedDocParam.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,13 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php80\Rector\FunctionLike\MixedTypeRector\Source; | ||
|
||
class SomeParentNotMixedDocParam | ||
{ | ||
/** | ||
* @param int $param | ||
*/ | ||
public function run($param) | ||
{ | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
rules-tests/Php80/Rector/FunctionLike/MixedTypeRector/config/configured_rule.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,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Config\RectorConfig; | ||
use Rector\Core\ValueObject\PhpVersionFeature; | ||
use Rector\Php80\Rector\FunctionLike\MixedTypeRector; | ||
|
||
return static function (RectorConfig $rectorConfig): void { | ||
$rectorConfig->rule(MixedTypeRector::class); | ||
|
||
$rectorConfig->phpVersion(PhpVersionFeature::MIXED_TYPE); | ||
}; |
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
Oops, something went wrong.