LogfileCollect   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 9
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A collect() 0 2 1
1
<?php
2
3
namespace Startwind\Inventorio\Remote;
4
5
class LogfileCollect
6
{
7
    public function __construct(string $inventorioServer, string $serverId, array $logfiles)
0 ignored issues
show
Unused Code introduced by
The parameter $serverId 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

7
    public function __construct(string $inventorioServer, /** @scrutinizer ignore-unused */ string $serverId, array $logfiles)

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...
Unused Code introduced by
The parameter $logfiles 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

7
    public function __construct(string $inventorioServer, string $serverId, /** @scrutinizer ignore-unused */ array $logfiles)

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...
Unused Code introduced by
The parameter $inventorioServer 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

7
    public function __construct(/** @scrutinizer ignore-unused */ string $inventorioServer, string $serverId, array $logfiles)

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...
8
    {
9
10
    }
11
12
    public function collect($logFile): string
0 ignored issues
show
Unused Code introduced by
The parameter $logFile 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

12
    public function collect(/** @scrutinizer ignore-unused */ $logFile): 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...
13
    {
14
15
    }
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return string. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
16
}
17