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.
Completed
Push — master ( 430bba...26150f )
by Miguel A.
03:06
created

Factory::fromFile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Retrinko\Ini\IniFile;
4
5
use Retrinko\Ini\Exceptions\InvalidDataException;
6
use Retrinko\Ini\IniFile;
7
use Retrinko\Ini\IniParser;
8
use Retrinko\Ini\IniSection;
9
10
class Factory
11
{
12
    /**
13
     * @param array $data
14
     *
15
     * @return IniFile
16
     * @throws \Retrinko\Ini\Exceptions\InvalidDataException
17
     */
18 2
    public static function fromArray(array $data)
19
    {
20 2
        $iniSections = IniParser::i()->parseArray($data);
21
22 1
        return self::fromIniSections($iniSections);
23
    }
24
25
    /**
26
     * @param IniSection[] $iniSections
27
     *
28
     * @return IniFile
29
     * @throws InvalidDataException
30
     */
31 4
    public static function fromIniSections(array $iniSections)
32
    {
33 4
        $iniFile = new IniFile();
34 4
        foreach ($iniSections as $iniSection)
35
        {
36 2
            if (false === $iniSection instanceof IniSection)
37 2
            {
38 1
                throw new InvalidDataException('Invalid data! ');
39
            }
40 1
            $iniFile->addSection($iniSection);
41 3
        }
42
43 3
        return $iniFile;
44
    }
45
46
    /**
47
     * @param string $file File path
48
     *
49
     * @return IniFile
50
     */
51
    public static function fromFile($file)
52
    {
53
        return new IniFile($file);
54
    }
55
    
56
}