Issues (35)

tests/example/src/AppCode.php (2 issues)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Test;
6
7
use Doctrine\Common\Collections\ArrayCollection;
0 ignored issues
show
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...
8
9
final class AppCode
10
{
11
    public function execute() : void
12
    {
13
        $sliced = $this->createArrayCollection()
0 ignored issues
show
The assignment to $sliced is dead and can be removed.
Loading history...
14
            ->slice(0, 1);
15
16
        $sliced = (new MyCollection())
17
            ->slice(0, 2);
18
19
        $sliced = (new MyArrayCollection())
20
            ->slice(0, 3);
21
    }
22
23
    private function createArrayCollection() : ArrayCollection
24
    {
25
        return new ArrayCollection([0, 1, 2, 3]);
26
    }
27
}
28