Use str_starts_with, str_ends_with and str_contains instead of strpos (#5485)

This commit is contained in:
Alexey
2022-12-31 16:02:23 +03:00
committed by GitHub
parent 0d31b25fba
commit 172ce659b8
14 changed files with 35 additions and 35 deletions

View File

@ -30,7 +30,7 @@ use function array_slice;
use function count;
use function explode;
use function is_int;
use function strpos;
use function str_contains;
class SignText{
public const LINE_COUNT = 4;
@ -54,7 +54,7 @@ class SignText{
foreach($lines as $k => $line){
$this->checkLineIndex($k);
Utils::checkUTF8($line);
if(strpos($line, "\n") !== false){
if(str_contains($line, "\n")){
throw new \InvalidArgumentException("Line must not contain newlines");
}
//TODO: add length checks