Completed
Push — master ( 53961b...a16bad )
by Maxime
33s
created

RatioChecker::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 1
b 0
f 1
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Mhor\MediaInfo\Checker;
4
5
use Mhor\MediaInfo\Attribute\Ratio;
6
7
class RatioChecker extends AbstractAttributeChecker
8
{
9
    /**
10
     * @param array $value
11
     *
12
     * @return Ratio
13
     */
14 1
    public function create($value)
15
    {
16 1
        $ratio = new Ratio($value[0], $value[1]);
17
18 1
        return $ratio;
19
    }
20
21
    /**
22
     * @return array
23
     */
24 5
    public function getMembersFields()
25
    {
26
        return array(
27 5
            'display_aspect_ratio',
28 5
            'original_display_aspect_ratio',
29 5
        );
30
    }
31
}
32