File::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\Module\monitor\TestCase\Cert;
6
7
use SimpleSAML\Module\monitor\TestData;
8
9
use function file_get_contents;
10
11
final class File extends Data
12
{
13
    /**
14
     * @param \SimpleSAML\Module\monitor\TestData $testData
15
     */
16
    public function __construct(TestData $testData)
17
    {
18
        $certFile = $testData->getInputItem('certFile');
19
        $certData = @file_get_contents($certFile);
0 ignored issues
show
Bug introduced by
It seems like $certFile can also be of type null; however, parameter $filename of file_get_contents() 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

19
        $certData = @file_get_contents(/** @scrutinizer ignore-type */ $certFile);
Loading history...
20
        $testData->setInput($certData, 'certData');
21
22
        parent::__construct($testData);
23
    }
24
}
25