Skip to content

Commit

Permalink
NullToStrictStringFuncCallArgRector - Register a few more functions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
craigfrancis committed Oct 16, 2022
1 parent 34040f3 commit 5d1f686
Showing 1 changed file with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,17 @@ final class NullToStrictStringFuncCallArgRector extends AbstractRector implement
'preg_split' => ['subject'],
'preg_match' => ['subject'],
'preg_match_all' => ['subject'],
'preg_filter' => ['replacement', 'subject'],
'preg_replace' => ['replacement', 'subject'],
'preg_replace_callback' => ['subject'],
'preg_replace_callback_array' => ['subject'],
'explode' => ['string'],
'strlen' => ['string'],
'str_contains' => ['haystack', 'needle'],
'strtotime' => ['datetime'],
'str_replace' => ['subject'],
'substr_replace' => ['string', 'replace'],
'str_ireplace' => ['search', 'replace', 'subject'],
'substr' => ['string'],
'str_starts_with' => ['haystack', 'needle'],
'strtoupper' => ['string'],
Expand Down Expand Up @@ -83,6 +89,8 @@ final class NullToStrictStringFuncCallArgRector extends AbstractRector implement
'curl_escape' => ['string'],
'curl_unescape' => ['string'],
'convert_uuencode' => ['string'],
'setcookie' => ['value', 'path', 'domain'],
'setrawcookie' => ['value', 'path', 'domain'],
'zlib_encode' => ['data'],
'gzdeflate' => ['data'],
'gzencode' => ['data'],
Expand All @@ -107,6 +115,10 @@ final class NullToStrictStringFuncCallArgRector extends AbstractRector implement
'transliterator_transliterate' => ['string'],
'mysqli_real_escape_string' => ['string'],
'mysqli_escape_string' => ['string'],
'pg_escape_bytea' => ['string'],
'pg_escape_literal' => ['string'],
'pg_escape_string' => ['string'],
'pg_unescape_bytea' => ['string'],
'ucfirst' => ['string'],
'lcfirst' => ['string'],
'ucwords' => ['string'],
Expand All @@ -132,6 +144,7 @@ final class NullToStrictStringFuncCallArgRector extends AbstractRector implement
'mb_strtolower' => ['string'],
'mb_convert_case' => ['string'],
'mb_convert_kana' => ['string'],
'mb_convert_encoding' => ['string'],
'mb_scrub' => ['string'],
'mb_substr' => ['string'],
'mb_substr_count' => ['haystack', 'needle'],
Expand All @@ -147,6 +160,7 @@ final class NullToStrictStringFuncCallArgRector extends AbstractRector implement
'mb_strrpos' => ['haystack', 'needle'],
'mb_stripos' => ['haystack', 'needle'],
'mb_strripos' => ['haystack', 'needle'],
'grapheme_extract' => ['haystack'],
'grapheme_strpos' => ['haystack', 'needle'],
'grapheme_strrpos' => ['haystack', 'needle'],
'grapheme_stripos' => ['haystack', 'needle'],
Expand All @@ -163,6 +177,7 @@ final class NullToStrictStringFuncCallArgRector extends AbstractRector implement
'collator_get_sort_key' => ['string'],
'metaphone' => ['string'],
'soundex' => ['string'],
'levenshtein' => ['string1', 'string2'],
'similar_text' => ['string1', 'string2'],
'sodium_compare' => ['string1', 'string2'],
'sodium_memcmp' => ['string1', 'string2'],
Expand All @@ -173,6 +188,8 @@ final class NullToStrictStringFuncCallArgRector extends AbstractRector implement
'strpbrk' => ['string', 'characters'],
'strspn' => ['string', 'characters'],
'strcspn' => ['string', 'characters'],
'strtr' => ['string'],
'strtok' => ['string'],
'str_word_count' => ['string'],
'count_chars' => ['string'],
'iconv_strlen' => ['string'],
Expand All @@ -198,6 +215,7 @@ final class NullToStrictStringFuncCallArgRector extends AbstractRector implement
'normalizer_normalize' => ['string'],
'normalizer_is_normalized' => ['string'],
'normalizer_get_raw_decomposition' => ['string'],
'numfmt_parse' => ['string'],
'hash' => ['algo', 'data'],
'hash_hmac' => ['algo', 'data', 'key'],
'hash_update' => ['data'],
Expand All @@ -209,6 +227,7 @@ final class NullToStrictStringFuncCallArgRector extends AbstractRector implement
'basename' => ['path'],
'dirname' => ['path'],
'pathinfo' => ['path'],
'sscanf' => ['string'],
'fwrite' => ['data'],
'fputs' => ['data'],
'output_add_rewrite_var' => ['name', 'value'],
Expand All @@ -220,6 +239,8 @@ final class NullToStrictStringFuncCallArgRector extends AbstractRector implement
'msgfmt_parse' => ['string'],
'msgfmt_parse_message' => ['locale', 'pattern', 'message'],
'str_getcsv' => ['string'],
'fgetcsv' => ['escape'],
'fputcsv' => ['escape'],
'password_hash' => ['password'],
'password_verify' => ['password', 'hash'],
'bcadd' => ['num1', 'num2'],
Expand All @@ -234,13 +255,16 @@ final class NullToStrictStringFuncCallArgRector extends AbstractRector implement
'simplexml_load_string' => ['data'],
'xml_parse' => ['data'],
'xml_parse_into_struct' => ['data'],
'xml_parser_create_ns' => ['separator'],
'xmlwriter_set_indent_string' => ['indentation'],
'xmlwriter_write_attribute' => ['name', 'value'],
'xmlwriter_write_attribute_ns' => ['value'],
'xmlwriter_write_pi' => ['target', 'content'],
'xmlwriter_write_cdata' => ['content'],
'xmlwriter_text' => ['content'],
'xmlwriter_write_raw' => ['content'],
'xmlwriter_write_comment' => ['content'],
'xmlwriter_write_dtd' => ['name'],
'xmlwriter_write_dtd_element' => ['name', 'content'],
'xmlwriter_write_dtd_attlist' => ['name', 'content'],
'xmlwriter_write_dtd_entity' => ['name', 'content'],
Expand All @@ -263,11 +287,30 @@ final class NullToStrictStringFuncCallArgRector extends AbstractRector implement
'sodium_crypto_secretstream_xchacha20poly1305_pull' => ['ciphertext'],
'sodium_crypto_shorthash' => ['message', 'key'],
'sodium_crypto_sign' => ['message', 'secret_key'],
'sodium_crypto_sign_detached' => ['message'],
'sodium_crypto_sign_open' => ['signed_message', 'public_key'],
'sodium_crypto_sign_verify_detached' => ['signature', 'message', 'public_key'],
'sodium_crypto_stream_xor' => ['message', 'nonce', 'key'],
'sodium_crypto_stream_xchacha20_xor' => ['message', 'nonce', 'key'],
'imagechar' => ['char'],
'imagecharup' => ['char'],
'imageftbbox' => ['string'],
'imagefttext' => ['text'],
'imagestring' => ['string'],
'imagestringup' => ['string'],
'imagettfbbox' => ['string'],
'imagettftext' => ['text'],
'pspell_add_to_personal' => ['word'],
'pspell_add_to_session' => ['word'],
'pspell_check' => ['word'],
'pspell_config_create' => ['language', 'spelling', 'jargon', 'encoding'],
'pspell_new' => ['spelling', 'jargon', 'encoding'],
'pspell_new_personal' => ['spelling', 'jargon', 'encoding'],
'pspell_store_replacement' => ['correct'],
'pspell_suggest' => ['word'],
'stream_get_line' => ['ending'],
'stream_socket_sendto' => ['data'],
'socket_sendto' => ['data'],
'socket_write' => ['data'],
'socket_send' => ['data'],
'mail' => ['to', 'subject', 'message'],
Expand Down

0 comments on commit 5d1f686

Please sign in to comment.