Completed
Push — master ( df194f...6edc14 )
by Samuel
13s
created

IntervalTransformer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A transform() 0 8 2
1
<?php
2
3
namespace Recurrence\RruleTransformer;
4
5
/**
6
 * Class IntervalTransformer
7
 * @package Recurrence\RruleTransformer
8
 */
9
class IntervalTransformer implements TransformerInterface
10
{
11
    /**
12
     * @param string $rRule
13
     * @return integer
14
     */
15
    public function transform($rRule)
16
    {
17
        if (preg_match('/INTERVAL=([0-9]+)/', $rRule, $matches)) {
18
            return (int) $matches[1];
19
        }
20
21
        return null;
22
    }
23
}
24