mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
finishing the code
This commit is contained in:
@ -51,7 +51,7 @@ final class Str
|
||||
return true;
|
||||
}
|
||||
|
||||
return substr($target, -$length) === $search;
|
||||
return $search === substr($target, -$length);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -92,4 +92,12 @@ final class Str
|
||||
{
|
||||
return $search === '' ? $subject : array_reverse(explode($search, $subject, 2))[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a describe block as `$right` → `$left` format.
|
||||
*/
|
||||
public static function describe(string $right, string $left): string
|
||||
{
|
||||
return sprintf('`%s` → %s', $right, $left);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user