Lines Matching full:lines
132 * Given a set of lines and an index of a current line it uses the registed block types to
134 * @param array $lines
138 protected function detectLineType($lines, $current) argument
140 $line = $lines[$current];
143 if ($this->{'identify' . $blockType}($line, $lines, $current)) {
155 protected function parseBlocks($lines) argument
159 return [['text', implode("\n", $lines)]];
165 // convert lines to blocks
166 for ($i = 0, $count = count($lines); $i < $count; $i++) {
167 $line = $lines[$i];
168 if ($line !== '' && rtrim($line) !== '') { // skip empty lines
170 list($block, $i) = $this->parseBlock($lines, $i);
184 * @param $lines
189 protected function parseBlock($lines, $current) argument
192 $blockType = $this->detectLineType($lines, $current);
194 // call consume method for the detected block type to consume further lines
195 return $this->{'consume' . $blockType}($lines, $current);
210 * Consume lines for a paragraph
212 * @param $lines
216 protected function consumeParagraph($lines, $current) argument
220 for ($i = $current, $count = count($lines); $i < $count; $i++) {
221 if (ltrim($lines[$i]) !== '') {
222 $content[] = $lines[$i];