Completed
Pull Request — master (#14)
by Samuel
06:39
created

AbstractRruleTransformer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 14
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A throwExceptionOnInvalidParameter() 0 6 2
1
<?php
2
3
namespace Recurrence\RruleTransformer;
4
5
/**
6
 * Class AbstractRruleTransformer
7
 * @package Recurrence\RruleTransformer
8
 */
9
class AbstractRruleTransformer
10
{
11
    /**
12
     * @param string $rRule
13
     * @param string $ruleKey
14
     * @return bool
15
     */
16
    public function throwExceptionOnInvalidParameter($rRule, $ruleKey)
17
    {
18 1
        if ((preg_match(sprintf('/%s=/', $ruleKey), $rRule, $matches) === 1)) {
19 1
            throw new \InvalidArgumentException(sprintf('RRULE invalid [%s] option', $ruleKey));
20
        }
21 1
    }
22
}
23