1 | <?php |
||
5 | abstract class AnyString |
||
6 | { |
||
7 | protected $raw; |
||
8 | |||
9 | public function __construct($thing) |
||
14 | |||
15 | /** |
||
16 | * @return mixed |
||
17 | */ |
||
18 | public function __get($name) |
||
22 | |||
23 | /** |
||
24 | * @return string |
||
25 | */ |
||
26 | public function __toString() |
||
30 | |||
31 | abstract public function compareTo($str, $mode = self::NORMAL, $length = 1); |
||
32 | |||
33 | abstract public function escape($mode = self::NORMAL, $charlist = ''); |
||
34 | |||
35 | abstract public function nextToken($delim); |
||
36 | |||
37 | abstract public function remove($str, $mode = self::NORMAL); |
||
38 | |||
39 | abstract public function repeat($times); |
||
40 | |||
41 | /** |
||
42 | * @param string $replace |
||
43 | */ |
||
44 | abstract public function replace($search, $replace, $mode = self::NORMAL); |
||
45 | |||
46 | abstract public function replaceWhole($replacement = ''); |
||
47 | |||
48 | abstract public function resetToken(); |
||
49 | |||
50 | abstract public function times($times); |
||
51 | |||
52 | abstract public function translate($search, $replace = ''); |
||
53 | |||
54 | abstract public function trim($mask = " \t\n\r\0\x0B", $mode = self::BOTH_ENDS); |
||
55 | |||
56 | abstract public function unescape($mode = self::NORMAL); |
||
57 | |||
58 | abstract public function uuDecode(); |
||
59 | |||
60 | abstract public function uuEncode(); |
||
61 | |||
62 | public function equals($str) |
||
69 | |||
70 | abstract public function isAscii(); |
||
71 | |||
72 | abstract public function isEmpty(); |
||
73 | |||
74 | protected static function testStringableObject($thing) |
||
84 | } |
||
85 |
For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a
@return
doc comment to communicate to implementors of these methods what they are expected to return.