Passed
Pull Request — 2.x (#19)
by Alexander
22:21 queued 07:54
created

ChangesCountGenerator::generate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cycle\Schema\Generator\Migrations;
6
7
use Cycle\Migrations\Atomizer\Atomizer;
8
use Cycle\Schema\Generator\Migrations\Changes\Collector;
9
use Cycle\Schema\Generator\Migrations\Changes\CollectorInterface;
0 ignored issues
show
Bug introduced by
The type Cycle\Schema\Generator\M...nges\CollectorInterface 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...
10
11
final class ChangesCountGenerator implements NameGeneratorInterface
12
{
13
    public function generate(Atomizer $atomizer): string
14
    {
15
        $collector = new Collector();
16
        return \sprintf('changes_%d', $collector->collect($atomizer));
0 ignored issues
show
Bug introduced by
$collector->collect($atomizer) of type array|array<mixed,array<...nges\ChangeType|mixed>> is incompatible with the type double|integer|string expected by parameter $values of sprintf(). ( Ignorable by Annotation )

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

16
        return \sprintf('changes_%d', /** @scrutinizer ignore-type */ $collector->collect($atomizer));
Loading history...
17
    }
18
}
19