Completed
Push — master ( 0443ac...f80d0b )
by Filipe
09:19 queued 13s
created

SymfonyYmlParser::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of slick/web_stack package
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
namespace Slick\WebStack\Router\Parsers;
11
12
use Slick\WebStack\Router\RoutesParser;
13
use Symfony\Component\Yaml\Parser;
14
15
/**
16
 * SymfonyYmlParser
17
 *
18
 * @package Slick\WebStack\Router\Parsers
19
 */
20
class SymfonyYmlParser implements RoutesParser
21
{
22
    /**
23
     * @var Parser
24
     */
25
    private $parser;
26
27
28
    /**
29
     * Creates a SymfonyYmlParser
30
     *
31
     * @param Parser $parser
32
     */
33
    public function __construct(Parser $parser)
34
    {
35
        $this->parser = $parser;
36
    }
37
38
    /**
39
     * parse
40
     *
41
     * @param string $content
42
     * @return array|mixed|\stdClass|\Symfony\Component\Yaml\Tag\TaggedValue|null
43
     */
44
    public function parse(string $content)
45
    {
46
        return $this->parser->parse($content);
47
    }
48
49
    /**
50
     * parseFile
51
     *
52
     * @param string $filename
53
     * @return array|mixed|\stdClass|\Symfony\Component\Yaml\Tag\TaggedValue|null
54
     */
55
    public function parseFile(string $filename)
56
    {
57
        return $this->parser->parseFile($filename);
58
    }
59
}
60