LatitudeEvaluator   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 17
rs 10
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A evaluateFieldValue() 0 11 4
1
<?php
2
3
/*
4
 * This file is part of the Extension "sf_event_mgt" for TYPO3 CMS.
5
 *
6
 * For the full copyright and license information, please read the
7
 * LICENSE.txt file that was distributed with this source code.
8
 */
9
10
namespace DERHANSEN\SfEventMgt\Evaluation;
11
12
use TYPO3\CMS\Core\Utility\MathUtility;
13
14
class LatitudeEvaluator
15
{
16
    /**
17
     * Validates the given latitude value (between -90 and 90 degrees)
18
     * @see https://developers.google.com/maps/documentation/javascript/reference?hl=fr#LatLng
19
     */
20
    public function evaluateFieldValue(string $value, string $is_in, bool &$set): string
0 ignored issues
show
Unused Code introduced by
The parameter $is_in is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

20
    public function evaluateFieldValue(string $value, /** @scrutinizer ignore-unused */ string $is_in, bool &$set): string

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
21
    {
22
        $newValue = '0.000000';
23
        $set = true;
24
        if (MathUtility::canBeInterpretedAsFloat($value) &&
25
            ((float)$value >= -90 && (float)$value <= 90)
26
        ) {
27
            $newValue = number_format((float)$value, 6);
28
        }
29
30
        return $newValue;
31
    }
32
}
33