TypeString   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A cast() 0 3 2
1
<?php
2
3
namespace Mvkasatkin\typecast\type;
4
5
class TypeString extends Type
6
{
7
8
    /**
9
     * @param $value
10
     *
11
     * @return string|null
12
     */
13
    public function cast($value)
14
    {
15
        return $value === null ? $this->default : (string)$value;
16
    }
17
}
18