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

InvalidNotNullException::__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 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
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 InvalidNotNullException extends ArgumentException
11
{
12
    /**
13
     * @param string $variableName
14
     * @throws InvalidStringException
15
     */
16 4
    public function __construct($variableName)
17
    {
18 4
        if (!is_string($variableName)) {
19 1
            throw new InvalidStringException('variableName', $variableName);
20
        }
21
22 3
        parent::__construct(
23 3
            sprintf(
24 3
                'Variable "$%s" must be "not null"',
25
                $variableName
26 3
            )
27 3
        );
28
    }
29
}