Completed
Push — master ( 379576...3184a2 )
by Roman
02:29
created

InvalidNotIntAndNotFloatException::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 13
ccs 9
cts 9
cp 1
rs 9.4286
cc 2
eloc 7
nc 2
nop 1
crap 2
1
<?php
2
/**
3
 * @link      https://github.com/ko-ko-ko/php-assert
4
 * @copyright Copyright (c) 2015 Roman Levishchenko <[email protected]>
5
 * @license   https://raw.github.com/ko-ko-ko/php-assert/master/LICENSE
6
 */
7
8
namespace KoKoKo\assert\exceptions;
9
10
class InvalidNotIntAndNotFloatException extends ArgumentException
11
{
12
    /**
13
     * @param string $variableName
14
     * @throws InvalidStringException
15
     */
16 3
    public function __construct($variableName)
17
    {
18 3
        if (!is_string($variableName)) {
19 1
            throw new InvalidStringException('variableName', $variableName);
20
        }
21
22 2
        parent::__construct(
23 2
            sprintf(
24 2
                'Variable "$%s" must be "not int" and "not float"',
25
                $variableName
26 2
            )
27 2
        );
28
    }
29
}