Completed
Push — master ( 30a2b5...89612e )
by Axel
02:59
created

CardHelper   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
eloc 12
dl 0
loc 33
ccs 0
cts 27
cp 0
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A slugify() 0 3 1
A extractValue() 0 6 2
A extractSpentTime() 0 3 1
A extractEstimatedTime() 0 3 1
A isInCurrentSprint() 0 7 1
1
<?php
2
3
namespace Scrumban\Utils;
4
5
use Scrumban\Model\CardInterface;
6
7
class CardHelper
8
{
9
    public static function extractValue(string $extraData): int
10
    {
11
        if (strtoupper($extraData{0}) !== 'V') {
12
            return 0;
13
        }
14
        return (int) substr($extraData, 1, 3);
15
    }
16
    
17
    public static function extractEstimatedTime(string $cardTitle): int
0 ignored issues
show
Unused Code introduced by
The parameter $cardTitle is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

17
    public static function extractEstimatedTime(/** @scrutinizer ignore-unused */ string $cardTitle): int

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
18
    {
19
        return 0;
20
    }
21
    
22
    public static function extractSpentTime(string $cardTitle): int
0 ignored issues
show
Unused Code introduced by
The parameter $cardTitle is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

22
    public static function extractSpentTime(/** @scrutinizer ignore-unused */ string $cardTitle): int

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
23
    {
24
        return 0;
25
    }
26
    
27
    public static function isInCurrentSprint(string $status): bool
28
    {
29
        return in_array($status, [
30
            CardInterface::STATUS_TODO,
31
            CardInterface::STATUS_IN_PROGRESS,
32
            CardInterface::STATUS_REVIEW,
33
            CardInterface::STATUS_TO_RELEASE
34
        ]);
35
    }
36
    
37
    public static function slugify($name)
38
    {
39
        return str_replace(' ', '_', strtolower($name));
40
    }
41
}