Skip to content

Commit

Permalink
Change private methods to only accept what they actually need
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Mar 28, 2019
1 parent 980450c commit d48ea46
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/DocParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use League\CommonMark\Block\Element\Document;
use League\CommonMark\Block\Element\InlineContainerInterface;
use League\CommonMark\Block\Element\Paragraph;
use League\CommonMark\Node\NodeWalker;

class DocParser
{
Expand Down Expand Up @@ -95,7 +94,7 @@ public function parse($input)
$tip->finalize($context, $lineCount);
}

$this->processInlines($context, $context->getDocument()->walker());
$this->processInlines($context);

$this->processDocument($context);

Expand Down Expand Up @@ -148,8 +147,10 @@ private function processDocument(ContextInterface $context)
}
}

private function processInlines(ContextInterface $context, NodeWalker $walker)
private function processInlines(ContextInterface $context)
{
$walker = $context->getDocument()->walker();

while ($event = $walker->next()) {
if (!$event->isEntering()) {
continue;
Expand Down

0 comments on commit d48ea46

Please sign in to comment.