1 | <?php namespace Gears\String\Methods; |
||
16 | trait Ensure |
||
17 | { |
||
18 | /** |
||
19 | * Ensures that the string begins with $substring. |
||
20 | * |
||
21 | * @param string $substring The substring to add if not present. |
||
22 | * |
||
23 | * @return static The string prefixed by the $substring. |
||
24 | */ |
||
25 | public function ensureLeft($substring) |
||
36 | |||
37 | /** |
||
38 | * Ensures that the string ends with $substring. |
||
39 | * |
||
40 | * @param string $substring The substring to add if not present. |
||
41 | * |
||
42 | * @return static The string suffixed by the $substring. |
||
43 | */ |
||
44 | public function ensureRight($substring) |
||
55 | } |
||
56 |