VariantWrapper::__construct()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 3.576

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
ccs 3
cts 5
cp 0.6
rs 10
c 0
b 0
f 0
cc 3
nc 2
nop 2
crap 3.576
1
<?php
2
3
namespace PhpWinTools\Support\COM;
4
5
use VARIANT as VariantExt;
6
use PhpWinTools\WmiScripting\Configuration\Config;
7
use PhpWinTools\WmiScripting\Testing\Support\VARIANTFake;
8
use PhpWinTools\WmiScripting\Exceptions\VariantWrapperException;
9
10
class VariantWrapper extends ComVariantWrapper
11
{
12 2
    public function __construct($variant, Config $config = null)
13
    {
14 2
        if (!$variant instanceof VariantExt && !$variant instanceof VARIANTFake) {
15
            throw new VariantWrapperException('Must be an instance of VARIANT or VARIANTFake. Given: '
16
                . get_class($variant));
17
        }
18
19 2
        parent::__construct($variant, $config);
20 2
    }
21
}
22