Completed
Push — develop ( 60a782...a29030 )
by
unknown
12:36
created
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
4
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
5
use Symplify\CodingStandard\Fixer\LineLength\LineLengthFixer;
6
use Symplify\EasyCodingStandard\ValueObject\Option;
7
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
8
9
return static function (ContainerConfigurator $containerConfigurator): void {
10
    $services = $containerConfigurator->services();
0 ignored issues
show
$services is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
11
    // $services->set(ArraySyntaxFixer::class)->call('configure', [
12
    //     'syntax' => 'short'
13
    // ]);
14
15
    // $services->set(LineLengthFixer::class)->call('configure', [
16
    //     "max_line_length" => 100,
17
    //     "break_long_lines" => true, # default: true
18
    //     "inline_short_lines" => false # default: true
19
    // ]);
20
21
    $parameters = $containerConfigurator->parameters();
22
23
    $parameters->set(Option::SETS, [SetList::CLEAN_CODE, SetList::PSR_12]);
24
25
    $parameters->set(Option::PATHS, [__DIR__ . '/src', __DIR__ . '/tests']);
26
27
    $parameters->set(Option::SKIP, ['Unused variable $deleted.' => ['src/GitElephant/Objects/Diff/DiffChunk.php'], 'Unused variable $new.' => ['src/GitElephant/Objects/Diff/DiffChunk.php']]);
28
};
29