Completed
Pull Request — develop (#127)
by
unknown
17:47 queued 02:46
created

Serialize::getSupportedExtensions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Noodlehaus\Parser;
4
5
/**
6
 * Class Serialize
7
 *
8
 * @package Config
9
 */
10
class Serialize implements ParserInterface
11
{
12
13
    /**
14
     * {@inheritdoc}
15
     */
16
    public function parseFile($filename)
17
    {
18
        $data = file_get_contents($filename);
19
        return $this->parseString($data);
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function parseString($config)
26
    {
27
        return (array) unserialize($config);
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public static function getSupportedExtensions()
34
    {
35
        return ['txt'];
36
    }
37
}
38