YamlClassMetadataLoader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 14
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A loadFile() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of the Ivory Serializer package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\Serializer\Mapping\Loader;
13
14
use Symfony\Component\Yaml\Exception\ParseException;
15
use Symfony\Component\Yaml\Yaml;
16
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class YamlClassMetadataLoader extends AbstractFileClassMetadataLoader
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25 464
    protected function loadFile($file)
26
    {
27
        try {
28 464
            return Yaml::parse(file_get_contents($file));
29 8
        } catch (ParseException $e) {
30 8
            throw new \InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
31
        }
32
    }
33
}
34