GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

FloatType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 8 2
1
<?php
2
3
namespace Minime\Annotations\Types;
4
5
use Minime\Annotations\Interfaces\TypeInterface;
6
use Minime\Annotations\ParserException;
7
8
class FloatType implements TypeInterface
9
{
10
11
    /**
12
     * Filter a value to be a Float
13
     *
14
     * @param  string                              $value
15
     * @param  null                                $annotation Unused
16
     * @throws \Minime\Annotations\ParserException
17
     * @return float
18
     */
19
    public function parse($value, $annotation = null)
20
    {
21
        if (false === ($value = filter_var($value, FILTER_VALIDATE_FLOAT))) {
22
            throw new ParserException("Raw value must be float. Invalid value '{$value}' given.");
23
        }
24
25
        return $value;
26
    }
27
28
}
29