Skip to content

Commit

Permalink
Added new functions to NullToStrictStringFuncCallArgRector (#2217)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorinProfeanu committed May 3, 2022
1 parent f1dba88 commit c4e1ee2
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,20 @@ final class NullToStrictStringFuncCallArgRector extends AbstractRector implement
* @var array<string, string[]>
*/
private const ARG_POSITION_NAME_NULL_TO_STRICT_STRING = [
'preg_split' => ['subject'],
'preg_match' => ['subject'],
'preg_match_all' => ['subject'],
'explode' => ['string'],
'strlen' => ['string'],
'str_contains' => ['haystack', 'needle'],
'preg_split' => ['subject'],
'preg_match' => ['subject'],
'preg_match_all' => ['subject'],
'explode' => ['string'],
'strlen' => ['string'],
'str_contains' => ['haystack', 'needle'],
'strtotime' => ['datetime'],
'str_replace' => ['subject'],
'substr' => ['string'],
'str_starts_with' => ['haystack', 'needle'],
'strtoupper' => ['string'],
'strtolower' => ['string'],
'strpos' => ['haystack', 'needle'],
'stripos' => ['haystack', 'needle'],
];

public function __construct(
Expand Down

0 comments on commit c4e1ee2

Please sign in to comment.