Completed
Push — master ( 975c17...8f2777 )
by Adam
04:20 queued 01:49
created

StringVO::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 7
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
crap 6
1
<?php
2
3
namespace BestServedCold\PhalueObjects;
4
5
use BestServedCold\PhalueObjects\Exception\InvalidTypeException;
6
7
/**
8
 * Class String
9
 *
10
 * @package   BestServedCold\PhalueObjects
11
 * @author    Adam Lewis <[email protected]>
12
 * @copyright Copyright (c) 2015 Best Served Cold Media Limited
13
 * @license      http://http://opensource.org/licenses/GPL-3.0 GPL License
14
 * @link      http://bestservedcold.com
15
 * @since      0.0.1-alpha
16
 * @version   0.0.2-alpha
17
 */
18
class StringVO extends ValueObject
19
{
20
    /**
21
     * StringVO constructor.
22
     *
23
     * @param  $value
24
     * @throws InvalidTypeException
25
     */
26
    public function __construct($value)
27
    {
28
        if (! is_string($value)) {
29
            throw new InvalidTypeException($value, ['string']);
30
        }
31
        parent::__construct($value);
32
    }
33
}
34