@@ -62,6 +62,11 @@ discard block |
||
| 62 | 62 | return $shortcodes; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | + /** |
|
| 66 | + * @param string|null $bbCode |
|
| 67 | + * @param null|string $content |
|
| 68 | + * @param string $text |
|
| 69 | + */ |
|
| 65 | 70 | private function getObject($name, $parameters, $bbCode, $offset, $content, $text) |
| 66 | 71 | { |
| 67 | 72 | return new ParsedShortcode(new Shortcode($name, $parameters, $content, $bbCode), $text, $offset); |
@@ -253,6 +258,9 @@ discard block |
||
| 253 | 258 | return implode('', array_map(function(array $token) { return $token[1]; }, $tokens)); |
| 254 | 259 | } |
| 255 | 260 | |
| 261 | + /** |
|
| 262 | + * @param integer $type |
|
| 263 | + */ |
|
| 256 | 264 | private function lookahead($type) |
| 257 | 265 | { |
| 258 | 266 | return $this->position < $this->tokensCount && (empty($type) || $this->tokens[$this->position][0] === $type); |
@@ -280,6 +288,10 @@ discard block |
||
| 280 | 288 | return true; |
| 281 | 289 | } |
| 282 | 290 | |
| 291 | + /** |
|
| 292 | + * @param integer|null $type |
|
| 293 | + * @param \Closure $callback |
|
| 294 | + */ |
|
| 283 | 295 | private function match($type, $callback = null, $ws = false) |
| 284 | 296 | { |
| 285 | 297 | if($this->position >= $this->tokensCount) { |
@@ -311,6 +323,9 @@ discard block |
||
| 311 | 323 | |
| 312 | 324 | /* --- LEXER ----------------------------------------------------------- */ |
| 313 | 325 | |
| 326 | + /** |
|
| 327 | + * @param string $text |
|
| 328 | + */ |
|
| 314 | 329 | private function tokenize($text) |
| 315 | 330 | { |
| 316 | 331 | preg_match_all($this->lexerRegex, $text, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE); |