Skip to content

Commit 0b01e64

Browse files
authored
Remove NullToStrictStringIntConverter, use explicit null type in null-to-strict rules (#8837)
1 parent fe0d47b commit 0b01e64

30 files changed

Lines changed: 226 additions & 801 deletions

‎rules-tests/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector/Fixture/case_insensitive_function_name.php.inc‎

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎rules-tests/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector/Fixture/crypt_one_arg.php.inc‎

Lines changed: 0 additions & 37 deletions
This file was deleted.

‎rules-tests/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector/Fixture/explicit_mixed_in_trait.php.inc‎

Lines changed: 0 additions & 29 deletions
This file was deleted.

‎rules-tests/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector/Fixture/named_argument.php.inc‎

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎rules-tests/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector/Fixture/non_string_param_type.php.inc‎

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎rules-tests/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector/Fixture/non_string_param_type_in_use_closure.php.inc‎

Lines changed: 0 additions & 31 deletions
This file was deleted.

‎rules-tests/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector/Fixture/normal_variable_in_trait.php.inc‎

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎rules-tests/Php81/Rector/FuncCall/NullToStrictStringFuncCallArgRector/Fixture/null_defined_in_variable_first.php.inc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class NullDefinedInVariableFirst
2222
public function getTitle()
2323
{
2424
$title = null;
25-
return trim((string) $title);
25+
return trim('');
2626
}
2727
}
2828

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace Rector\Tests\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector\Fixture;
4+
5+
final class CaseInsensitiveFunctionName
6+
{
7+
public function run($var)
8+
{
9+
return strToLower($var);
10+
}
11+
}
12+
13+
?>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Rector\Tests\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector\Fixture;
4+
5+
/**
6+
* Crypt requires 2 args since php 5.6, when it only fill 1st arg, it will only change 1st arg
7+
*
8+
* Note: Filling 2nd arg will require different Rule to match the salt algorithm.
9+
*/
10+
final class CryptOneArg
11+
{
12+
public function run($subject)
13+
{
14+
crypt($subject);
15+
}
16+
}
17+
18+
?>

0 commit comments

Comments
 (0)