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

YamlParser   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A parse() 0 4 1
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