Skip to content

Commit

Permalink
fix ArrayHelper::map() for path strings
Browse files Browse the repository at this point in the history
o code style fixes
  • Loading branch information
chriscpty committed Oct 18, 2024
1 parent 1fcadcd commit 7538551
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion framework/helpers/BaseStringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,12 @@ public static function contains($string, $needle, $caseSensitive = true)
$needle = (string)$needle;

if ($caseSensitive) {
// can be replaced with just the str_contains call when minimum supported PHP version is raised to 8.0 or higher
if (function_exists('str_contains')) {
return str_contains($string, $needle);

Check warning on line 244 in framework/helpers/BaseStringHelper.php

View check run for this annotation

Codecov / codecov/patch

framework/helpers/BaseStringHelper.php#L244

Added line #L244 was not covered by tests
}
$encoding = Yii::$app ? Yii::$app->charset : 'UTF-8';
return mb_strpos($string, $needle, 0, $encoding) !== false;
return mb_strpos($string, $needle, 0, $encoding) !== false;
}
$encoding = Yii::$app ? Yii::$app->charset : 'UTF-8';
return mb_stripos($string, $needle, 0, $encoding) !== false;
Expand Down

0 comments on commit 7538551

Please sign in to comment.