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

throwExceptionOnInvalidParameter()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 2
eloc 3
nc 2
nop 2
crap 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