Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeDeclaration] Skip default numeric string on param int on ParamTy…
…peByMethodCallTypeRector (#5210) * [TypeDeclaration] Skip default numeric string on param int on ParamTypeByMethodCallTypeRector * udpate code * Fixed 🎉 * Fixed 🎉 * more fixture * fix
- Loading branch information
1 parent
6f33010
commit 97d095f
Showing
3 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
...hod/ParamTypeByMethodCallTypeRector/Fixture/skip_default_numeric_string_param_int.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\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector\Fixture; | ||
|
||
final class SkipDefaultNumericStringParamInt | ||
{ | ||
public function go($value = '1') | ||
{ | ||
$this->execute($value); | ||
} | ||
|
||
private function execute(int $value) | ||
{ | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...amTypeByMethodCallTypeRector/Fixture/with_default_constant_integer_type_param_int.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,35 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector\Fixture; | ||
|
||
final class WithDefaultConstantIntegerTypeParamInt | ||
{ | ||
public function go($value = 1) | ||
{ | ||
$this->execute($value); | ||
} | ||
|
||
private function execute(int $value) | ||
{ | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector\Fixture; | ||
|
||
final class WithDefaultConstantIntegerTypeParamInt | ||
{ | ||
public function go(int $value = 1) | ||
{ | ||
$this->execute($value); | ||
} | ||
|
||
private function execute(int $value) | ||
{ | ||
} | ||
} | ||
|
||
?> |
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