@@ 55-62 (lines=8) @@ | ||
52 | * @param string $data |
|
53 | * @return boolean|string |
|
54 | */ |
|
55 | private static function wordShift(&$data) |
|
56 | { |
|
57 | if (preg_match('~^(\S+)\s*(.*)$~', $data, $matches) === 1) { |
|
58 | $data = $matches[2]; |
|
59 | return $matches[1]; |
|
60 | } |
|
61 | return false; |
|
62 | } |
|
63 | ||
64 | protected function handle($command, $expression) |
|
65 | { |
@@ 148-155 (lines=8) @@ | ||
145 | * @param string $data |
|
146 | * @return string|bool Either the first word or false if no more words available |
|
147 | */ |
|
148 | public static function wordShift(&$data) |
|
149 | { |
|
150 | if (preg_match('~^\s*(\S+)\s*(.*)$~s', $data, $matches) === 1) { |
|
151 | $data = $matches[2]; |
|
152 | return $matches[1]; |
|
153 | } |
|
154 | return false; |
|
155 | } |
|
156 | ||
157 | /** |
|
158 | * Splits a text line in all it's words |
@@ 108-115 (lines=8) @@ | ||
105 | * @param string $data |
|
106 | * @return boolean|string |
|
107 | */ |
|
108 | private static function wordShift(&$data) |
|
109 | { |
|
110 | if (preg_match('~^(\S+)\s*(.*)$~', $data, $matches) === 1) { |
|
111 | $data = $matches[2]; |
|
112 | return $matches[1]; |
|
113 | } |
|
114 | return false; |
|
115 | } |
|
116 | ||
117 | } |
|
118 |