Completed
Pull Request — develop (#27)
by Chris
01:52
created

Factory::createByData()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace Chrisyue\PhpM3u8\DataAccessor;
4
5
class Factory implements FactoryInterface
6
{
7
    /**
8
     * {@inheritdoc}
9
     */
10
    public function createByData($data)
11
    {
12
        if (is_array($data)) {
13
            return new ArrayAccessor($data);
14
        }
15
16
        return new ObjectAccessor($data);
17
    }
18
}
19