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

Factory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createByData() 0 8 2
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