ParametriTabella::getParameter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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