1 | <?php |
||
5 | abstract class StringSupport |
||
6 | { |
||
7 | /** |
||
8 | * Parametrize string using array of params. |
||
9 | * |
||
10 | * @param string $str |
||
11 | * @param string[] $params |
||
12 | * @return string |
||
13 | */ |
||
14 | 1 | public static function parametrize($str, $params) |
|
25 | |||
26 | /** |
||
27 | * Check if string matches pattern using simple regexp method. |
||
28 | * |
||
29 | * @param string $pattern |
||
30 | * @param string $string |
||
31 | * @return bool |
||
32 | */ |
||
33 | 5 | public static function match($pattern, $string) |
|
37 | |||
38 | /** |
||
39 | * Filter and return entries that match any of specified patterns. |
||
40 | * |
||
41 | * @param string|string[] $pattern |
||
42 | * @param string[] $entries |
||
43 | * @return string[] |
||
44 | */ |
||
45 | public static function find($pattern, $entries) |
||
54 | |||
55 | /** |
||
56 | * Filter and return entries that match specified pattern. |
||
57 | * |
||
58 | * @param string $pattern |
||
59 | * @param string[] $entries |
||
60 | * @return string[] |
||
61 | */ |
||
62 | 4 | public static function findOne($pattern, $entries) |
|
76 | |||
77 | /** |
||
78 | * Filter and return entries that match any of specified patterns. |
||
79 | * |
||
80 | * @param string[] $patterns |
||
81 | * @param string[] $entries |
||
82 | * @return string[] |
||
83 | */ |
||
84 | 2 | public static function findFew($patterns, $entries) |
|
108 | } |
||
109 |