Merge branch '2.x' into to_be_uuid

This commit is contained in:
Nuno Maduro
2023-09-06 11:53:58 +01:00
committed by GitHub
8 changed files with 38 additions and 9 deletions

View File

@ -51,7 +51,7 @@ final class Str
return true;
}
return substr($target, -$length) === $search;
return $search === substr($target, -$length);
}
/**
@ -100,4 +100,12 @@ final class Str
{
return preg_match('/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iD', $value) > 0;
}
/**
* Creates a describe block as `$describeDescription` → `$testDescription` format.
*/
public static function describe(string $describeDescription, string $testDescription): string
{
return sprintf('`%s` → %s', $describeDescription, $testDescription);
}
}