ParametriTabella   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 1
f 0
dl 0
loc 21
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setParameter() 0 3 1
A getParameter() 0 3 1
1
<?php
2
3
namespace Cdf\BiCoreBundle\Utils\Tabella;
4
5
class ParametriTabella
6
{
7
    /**
8
     *
9
     * @param string $parametro
10
     * @return string
11
     * @throws \Exception
12
     */
13 18
    public static function getParameter(string $parametro)
14
    {
15 18
        return base64_decode($parametro);
16
    }
17
    
18
    /**
19
     *
20
     * @param ?mixed $parametro
21
     * @return string
22
     */
23 18
    public static function setParameter($parametro)
24
    {
25 18
        return base64_encode($parametro);
0 ignored issues
show
Bug introduced by
It seems like $parametro can also be of type null; however, parameter $string of base64_encode() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

25
        return base64_encode(/** @scrutinizer ignore-type */ $parametro);
Loading history...
26
    }
27
}
28