for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Lichtenwallner (https://lichtenwallner.at)
*
* @see https://github.com/jolicht/markdown-cms for the canonical source repository
* @license https://github.com/jolicht/markdown-cms/blob/master/LICENSE MIT
* @copyright Copyright (c) Johannes Lichtenwallner
*/
declare(strict_types = 1);
namespace Jolicht\MarkdownCms\CommonMark;
use Interop\Container\ContainerInterface;
use League\CommonMark\Environment;
use League\CommonMark\Inline\Element\Image;
use Jolicht\MarkdownCms\Markdown\Renderer\ImageRenderer;
class EnvironmentFactory
{
public function __invoke(ContainerInterface $container) : Environment
$environment = Environment::createCommonMarkEnvironment();
$environment->addInlineRenderer(Image::class, $container->get(ImageRenderer::class));
return $environment;
}