-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeQuality][TypeDeclaration] Add string append support on ReturnTyp…
…eFromStrictScalarReturnExprRector (#4657) * [CodeQuality] Add string append support on ReturnTypeFromStrictScalarReturnExprRector * Fixed 🎉
- Loading branch information
1 parent
9097d76
commit 625fccc
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
...sMethod/ReturnTypeFromStrictScalarReturnExprRector/Fixture/string_append_variable.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,39 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\ReturnTypeFromStrictScalarReturnExprRector\Fixture; | ||
|
||
class StringAppendVariable | ||
{ | ||
public function resolve(array $data) | ||
{ | ||
$content = ''; | ||
|
||
foreach ($data as $value) { | ||
$content .= $value; | ||
} | ||
|
||
return $content; | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\ReturnTypeFromStrictScalarReturnExprRector\Fixture; | ||
|
||
class StringAppendVariable | ||
{ | ||
public function resolve(array $data): string | ||
{ | ||
$content = ''; | ||
|
||
foreach ($data as $value) { | ||
$content .= $value; | ||
} | ||
|
||
return $content; | ||
} | ||
} | ||
|
||
?> |
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