Completed
Push — master ( 4534a2...4c3ec3 )
by Johannes
03:54
created

FrontYamlParserFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 3
1
<?php
2
/**
3
 * Lichtenwallner  (https://lichtenwallner.at)
4
 *
5
 * @see https://github.com/jolicht/markdown-cms for the canonical source repository
6
 * @license https://github.com/jolicht/markdown-cms/blob/master/LICENSE MIT
7
 * @copyright Copyright (c) Johannes Lichtenwallner
8
 */
9
declare(strict_types = 1);
10
namespace Jolicht\MarkdownCms\Markdown;
11
12
use Zend\ServiceManager\Factory\FactoryInterface;
13
use Mni\FrontYAML\Parser;
14
use Interop\Container\ContainerInterface;
15
use Mni\FrontYAML\Bridge\CommonMark\CommonMarkParser;
16
use League\CommonMark\CommonMarkConverter;
17
18
/**
19
 * Factory for Mni\FrontYAML\Parser
20
 */
21
class FrontYamlParserFactory implements FactoryInterface
22
{
23
    /**
24
     * Get front yaml parser
25
     * @return Parser
26
     * {@inheritDoc}
27
     * @see \Zend\ServiceManager\Factory\FactoryInterface::__invoke()
28
     */
29
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null) : Parser
30
    {
31
        return new Parser(
32
            null,
33
            new CommonMarkParser(
34
                new CommonMarkConverter([])
35
            )
36
        );
37
    }
38
}