Failed Conditions
Pull Request — master (#117)
by Andreas
10:51
created

OtherThing::baz()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 9
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Example\Library;
6
7
use Foo\Bar\Baz;
8
9
final class OtherThing
10
{
11
    public function baz(Baz $baz)
12
    {
13
        $collection = new \Doctrine\Common\Collections\ArrayCollection([]);
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\Collections\ArrayCollection was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
Unused Code introduced by
The assignment to $collection is dead and can be removed.
Loading history...
14
15
        libxml_clear_errors();
16
17
        filter_var(
18
            $baz->value(),
0 ignored issues
show
Bug introduced by
The method value() does not exist on Foo\Bar\Baz. ( Ignorable by Annotation )

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

18
            $baz->/** @scrutinizer ignore-call */ 
19
                  value(),

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
19
            FILTER_VALIDATE_URL
20
        );
21
    }
22
}
23