Completed
Push — master ( 499778...79f24a )
by Emily
9s
created

FloatType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 12
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A cast() 0 4 1
1
<?php
2
/**
3
 * This file is part of the Composite Utils package.
4
 *
5
 * (c) Emily Shepherd <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the
8
 * LICENSE.md file that was distributed with this source code.
9
 *
10
 * @package spaark/composite-utils
11
 * @author Emily Shepherd <[email protected]>
12
 * @license MIT
13
 */
14
15
namespace Spaark\CompositeUtils\Model\Reflection\Type;
16
17
/**
18
 * Represents a native string type
19
 */
20
class FloatType extends ScalarType
21
{
22
    const NAME = 'Float';
23
24
    /**
25
     * {@inheritDoc}
26
     */
27 1
    public function cast($value)
28
    {
29 1
        return (float)$value;
30
    }
31
}
32