<?php
namespace EdpMarkdown\View\Helper;

use Zend\View\Helper\AbstractHelper;

class Markdown extends AbstractHelper
{
    protected $parser;

    public function __construct($parser)
    {
        $this->setParser($parser);
    }

    public function setParser($parser)
    {
        $this->parser = $parser;
    }

    public function __invoke($string = null)
    {
        if (null === $this->parser) {
            return $string;
        }
        if ($string === null) {
            return $this;
        }

        return $this->parser->transform($string);
    }

    public function start()
    {
        ob_start();
    }

    public function end()
    {
        echo $this->parser->transform(ob_get_clean());
    }
}

<?php
namespace EdpMarkdown\View\Helper;

use Zend\View\Helper\AbstractHelper;

class Markdown extends AbstractHelper
{
    protected $parser;

    public function __construct()
    {
    }

    public function setParser($parser)
    {
        $this->parser = $parser;
    }

    public function __invoke($string = null)
    {
        if (null === $this->parser) {
            return $string;
        }
        if ($string === null) {
            return $this;
        }

        return $this->parser->transform($string);
    }

    public function start()
    {
        ob_start();
    }

    public function end()
    {
        echo $this->parser->transform(ob_get_clean());
    }
}

Revert "Make parser parameter required in the constructor as it is a hard dep"
Revert "Make parser parameter required in the constructor as it is a hard dep"

Doing this will break the fallback PluginBroker behavior, as it tries to
instantiate the helper with no parameters to the constructor.

This reverts commit f368725d5742906cb0bf4130c290327adae1b08f.
