Downloader::toString()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: famoser
5
 * Date: 27.05.2016
6
 * Time: 13:23
7
 */
8
9
namespace Famoser\XKCDCache\Types;
10
11
/**
12
 * downloader versions
13
 *
14
 * @package Famoser\XKCDCache\Types
15
 */
16
class Downloader
17
{
18
    const VERSION_1 = 1;
19
20
    /**
21
     * the version of the downloader user
22
     *
23
     * @param $downloader
24
     * @return string
25
     */
26 3
    public static function toString($downloader)
27
    {
28
        switch ($downloader) {
29 3
            case self::VERSION_1:
30 3
                return 'version 1';
31
            default:
32 1
                return 'unknown version with id ' . $downloader;
33
        }
34
    }
35
}
36