1 | <?php |
||
7 | class Underscore |
||
8 | { |
||
9 | protected $underscoreMethods = |
||
10 | [ |
||
11 | //name, firstArgumentIsString, returnsAString |
||
12 | 'accord' => [false, true], |
||
13 | 'random' => [false, true], |
||
14 | 'quickRandom' => [false, true], |
||
15 | 'randomStrings' => [false, true], |
||
16 | 'endsWith' => [true, false], |
||
17 | 'isIp' => [true, false], |
||
18 | 'isEmail' => [true, false], |
||
19 | 'isUrl' => [true, false], |
||
20 | 'startsWith' => [true, false], |
||
21 | 'find' => [true, false], |
||
22 | 'slice' => [true, false], |
||
23 | 'sliceFrom' => [true, true], |
||
24 | 'sliceTo' => [true, true], |
||
25 | 'baseClass' => [true, true], |
||
26 | 'prepend' => [true, true], |
||
27 | 'append' => [true, true], |
||
28 | 'limit' => [true, true], |
||
29 | 'remove' => [true, true], |
||
30 | 'replace' => [true, true], |
||
31 | 'toggle' => [true, true], |
||
32 | 'slugify' => [true, true], |
||
33 | 'explode' => [true, false], |
||
34 | 'lower' => [true, true], |
||
35 | 'plural' => [true, true], |
||
36 | 'singular' => [true, true], |
||
37 | 'upper' => [true, true], |
||
38 | 'title' => [true, true], |
||
39 | 'words' => [true, true], |
||
40 | 'toPascalCase' => [true, true], |
||
41 | 'toSnakeCase' => [true, true], |
||
42 | 'toCamelCase' => [true, true], |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * @param \Spatie\String\Str $string |
||
47 | * @param string $method |
||
48 | * @param array $args |
||
49 | * |
||
50 | * @return mixed|\Spatie\String\Str |
||
51 | */ |
||
52 | public function call($string, $method, $args) |
||
66 | |||
67 | /** |
||
68 | * Determine if the given method is supported. |
||
69 | * |
||
70 | * @param $method |
||
71 | * |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function isSupportedMethod($method) |
||
78 | |||
79 | /** |
||
80 | * Determine if the given method uses the string as it's first argument. |
||
81 | * |
||
82 | * @param $method |
||
83 | * |
||
84 | * @return bool |
||
85 | */ |
||
86 | public function methodUsesStringAsFirstArgument($method) |
||
90 | |||
91 | /** |
||
92 | * Determine if the given method returns a string. |
||
93 | * |
||
94 | * @param $method |
||
95 | * |
||
96 | * @return bool |
||
97 | */ |
||
98 | public function methodReturnsAString($method) |
||
102 | } |
||
103 |