protected function parseReferences(ContextInterface $context, Cursor $cursor) { $referenceFound = false; while ($cursor->getCharacter() === '[' && $context->getReferenceParser()->parse($cursor)) { $this->finalStringContents = $cursor->getRemainder(); $referenceFound = true; } return $referenceFound; }