@@ -61,6 +61,11 @@ discard block |
||
| 61 | 61 | return $shortcodes; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | + /** |
|
| 65 | + * @param string|null $bbCode |
|
| 66 | + * @param null|string $content |
|
| 67 | + * @param string $text |
|
| 68 | + */ |
|
| 64 | 69 | private function getObject($name, $parameters, $bbCode, $offset, $content, $text) |
| 65 | 70 | { |
| 66 | 71 | return new ParsedShortcode(new Shortcode($name, $parameters, $content, $bbCode), $text, $offset); |
@@ -279,11 +284,18 @@ discard block |
||
| 279 | 284 | return true; |
| 280 | 285 | } |
| 281 | 286 | |
| 287 | + /** |
|
| 288 | + * @param integer $type |
|
| 289 | + */ |
|
| 282 | 290 | private function lookahead($type) |
| 283 | 291 | { |
| 284 | 292 | return $this->position < $this->tokensCount && (empty($type) || $this->tokens[$this->position][0] === $type); |
| 285 | 293 | } |
| 286 | 294 | |
| 295 | + /** |
|
| 296 | + * @param integer|null $type |
|
| 297 | + * @param \Closure $callbacks |
|
| 298 | + */ |
|
| 287 | 299 | private function match($type, $callbacks = null, $ws = false) |
| 288 | 300 | { |
| 289 | 301 | 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); |