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

InfReverser   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A reverse() 0 9 2
1
<?php
2
3
namespace Chrisyue\PhpM3u8\Transformer;
4
5
class InfReverser implements ReverserInterface
6
{
7
    public function reverse($inf)
8
    {
9
        $format = '%d,%s';
10
        if (is_float($inf->duration)) {
11
            $format = '%.3f,%s';
12
        }
13
14
        return sprintf($format, $inf->duration, $inf->title);
15
    }
16
}
17