MarkdownLoader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 11
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 5 2
1
<?php
2
3
/**
4
 * This file is part of template
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Slick\Template\Engine;
13
14
use PHP_CodeSniffer\Generators\Markdown;
15
use Twig\Extra\Markdown\DefaultMarkdown;
16
use Twig\Extra\Markdown\MarkdownRuntime;
17
use Twig\RuntimeLoader\RuntimeLoaderInterface;
18
19
/**
20
 * MarkdownLoader
21
 *
22
 * @package Slick\Template\Engine
23
 */
24
final class MarkdownLoader implements RuntimeLoaderInterface
25
{
26
27
    /**
28
     * @inheritDoc
29
     */
30
    public function load(string $class): ?MarkdownRuntime
31
    {
32
        return (MarkdownRuntime::class === $class)
33
            ? new MarkdownRuntime(new DefaultMarkdown())
34
            : null;
35
    }
36
}
37