Completed
Push — master ( 5c637b...29a871 )
by Adam
02:41
created

VOResource::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
ccs 5
cts 5
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
crap 2
1
<?php
2
3
namespace BestServedCold\PhalueObjects;
4
5
use BestServedCold\PhalueObjects\Exception\InvalidTypeException;
6
7
/**
8
 * Class VOResource
9
 *
10
 * @package BestServedCold\PhalueObjects
11
 */
12
class VOResource extends ValueObject
13
{
14
    /**
15
     * VOResource constructor.
16
     *
17
     * @param $value
18
     */
19 7
    public function __construct($value)
20
    {
21 7
        if (!is_resource($value)) {
22 1
            throw new InvalidTypeException($value, [ 'object' ]);
23
        }
24
25 7
        parent::__construct($value);
26 7
    }
27
}
28