@@ -67,6 +67,11 @@ discard block |
||
67 | 67 | return $shortcodes; |
68 | 68 | } |
69 | 69 | |
70 | + /** |
|
71 | + * @param string|null $bbCode |
|
72 | + * @param null|string $content |
|
73 | + * @param string $text |
|
74 | + */ |
|
70 | 75 | private function getObject($name, $parameters, $bbCode, $offset, $content, $text) |
71 | 76 | { |
72 | 77 | return new ParsedShortcode(new Shortcode($name, $parameters, $content, $bbCode), $text, $offset); |
@@ -253,11 +258,18 @@ discard block |
||
253 | 258 | return $backtrack; |
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); |
259 | 267 | } |
260 | 268 | |
269 | + /** |
|
270 | + * @param integer|null $type |
|
271 | + * @param boolean $ws |
|
272 | + */ |
|
261 | 273 | private function match($type, $ws) |
262 | 274 | { |
263 | 275 | if($this->position >= $this->tokensCount) { |
@@ -279,6 +291,9 @@ discard block |
||
279 | 291 | |
280 | 292 | /* --- LEXER ----------------------------------------------------------- */ |
281 | 293 | |
294 | + /** |
|
295 | + * @param string $text |
|
296 | + */ |
|
282 | 297 | private function tokenize($text) |
283 | 298 | { |
284 | 299 | preg_match_all($this->lexerRegex, $text, $matches, PREG_OFFSET_CAPTURE); |
@@ -127,6 +127,9 @@ discard block |
||
127 | 127 | return $text; |
128 | 128 | } |
129 | 129 | |
130 | + /** |
|
131 | + * @param callable|null $handler |
|
132 | + */ |
|
130 | 133 | private function processHandler(ParsedShortcodeInterface $parsed, ProcessorContext $context, $handler) |
131 | 134 | { |
132 | 135 | $processed = ProcessedShortcode::createFromContext(clone $context); |
@@ -144,6 +147,9 @@ discard block |
||
144 | 147 | return mb_substr($state, 0, $offset, 'utf-8').$processed->getContent().mb_substr($state, $offset + $length, mb_strlen($state, 'utf-8'), 'utf-8'); |
145 | 148 | } |
146 | 149 | |
150 | + /** |
|
151 | + * @return string |
|
152 | + */ |
|
147 | 153 | private function processRecursion(ParsedShortcodeInterface $shortcode, ProcessorContext $context) |
148 | 154 | { |
149 | 155 | if ($this->autoProcessContent && null !== $shortcode->getContent()) { |