InvalidNotArrayException::__construct()   A
last analyzed

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.4285
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 InvalidNotArrayException extends ArgumentException
11
{
12
    /**
13
     * @param string $variableName
14
     * @throws InvalidStringException
15
     */
16 6
    public function __construct($variableName)
17
    {
18 6
        if (!is_string($variableName)) {
19 1
            throw new InvalidStringException('variableName', $variableName);
20
        }
21
22 5
        parent::__construct(
23 5
            sprintf(
24 5
                'Variable "$%s" must be "not array"',
25
                $variableName
26 5
            )
27 5
        );
28
    }
29
}