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

FrontYamlParserFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 9 1
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
}