Skip to content

Commit 87ce22e

Browse files
committed
new features
1 parent 7ea148f commit 87ce22e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Strings.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ public static function compare(string $strA, string $strB, string $type = String
127127
*/
128128
public static function contains(string $subject, string $value): bool
129129
{
130+
if (function_exists('str_contains')) {
131+
return str_contains($subject, $value);
132+
}
130133
if ($value === Strings::EMPTY_STRING) {
131134
throw new InvalidArgumentException('Parameter $value cannot be empty string.');
132135
}

tests/ParamsCheckerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function testType()
6363
$value = function () { };
6464
ParamsChecker::type('value', $value, "callable");
6565
self::assertException(function () {
66-
ParamsChecker::type('value', $value, "string");;
66+
ParamsChecker::type('value', $value, "string");
6767
}, InvalidArgumentException::class);
6868
}
6969

0 commit comments

Comments
 (0)