Completed
Push — master ( 386146...a2d301 )
by John
07:40
created

YamlParser::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the KleijnWeb\SwaggerBundle package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace KleijnWeb\SwaggerBundle\Document;
10
11
use Symfony\Component\Yaml\Parser;
12
use Symfony\Component\Yaml\Yaml;
13
14
/**
15
 * Facade for Symfony\Yaml
16
 *
17
 * @author John Kleijn <[email protected]>
18
 */
19
class YamlParser
20
{
21
    /**
22
     * @var Parser
23
     */
24
    private $parser;
25
26
    /**
27
     * Construct the wrapper
28
     */
29
    public function __construct()
30
    {
31
        $this->parser = new Parser();
32
    }
33
34
    /**
35
     * @param string $string
36
     *
37
     * @return object
38
     */
39
    public function parse($string)
40
    {
41
        return $this->parser->parse($string, true, false, true);
42
    }
43
}
44