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::parse()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 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