InvalidNotObjectException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

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