GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

YamlFileLoader::supports()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 5
nc 3
nop 2
1
<?php
2
/*
3
 * Copyright (c) 2015 Matthew Loberg
4
 * Distributed under the MIT License (http://opensource.org/licenses/MIT)
5
 */
6
7
namespace Mlo\FileLoader;
8
9
use Symfony\Component\Config\Loader\Loader;
10
use Symfony\Component\Yaml\Yaml;
11
12
/**
13
 * YamlFileLoader
14
 *
15
 * @author Matthew Loberg <[email protected]>
16
 */
17
class YamlFileLoader extends Loader
18
{
19
    /**
20
     * @inheritdoc
21
     */
22
    public function load($resource, $type = null)
23
    {
24
        $values = Yaml::parse(file_get_contents($resource));
25
26
        return $values;
27
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32
    public function supports($resource, $type = null)
33
    {
34
        if (!is_string($resource)) {
35
            return false;
36
        }
37
38
        $extension = pathinfo($resource, PATHINFO_EXTENSION);
39
40
        return 'yaml' === $extension || 'yml' === $extension;
41
    }
42
}
43