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.
Passed
Push — 3.0 ( 58bd2d...2f6977 )
by Vermeulen
01:15
created

ReadDirLoadModule::dirAction()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace BFW\Install;
4
5
use bultonFr\Utils\Files\ReadDirectory;
6
7
/**
8
 * Class use to detect modules in a directory and sub-directories
9
 */
10
class ReadDirLoadModule extends ReadDirectory
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    protected function itemAction(string $fileName, string $pathToFile): string
16
    {
17
        //Call parent method to check ignored files
18
        $parentAction = parent::itemAction($fileName, $pathToFile);
19
20
        if (!empty($parentAction)) {
21
            return $parentAction;
22
        }
23
24
        //Detect the file containing module infos
25
        if ($fileName === 'bfwModulesInfos.json') {
26
            $this->list[] = $pathToFile;
27
28
            return 'break';
29
        }
30
31
        return '';
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    protected function dirAction(string $dirPath)
38
    {
39
        if (preg_match('/test(s?)$/', $dirPath) === 1) {
40
            return;
41
        }
42
43
        return parent::dirAction($dirPath);
0 ignored issues
show
Bug introduced by
Are you sure the usage of parent::dirAction($dirPath) targeting bultonFr\Utils\Files\ReadDirectory::dirAction() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
44
    }
45
}
46