• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

keradus / PHP-CS-Fixer / 16428450756

21 Jul 2025 06:19PM UTC coverage: 94.756% (-0.002%) from 94.758%
16428450756

push

github

web-flow
fix: always reach 100% of checked files (#8861)

4 of 4 new or added lines in 1 file covered. (100.0%)

111 existing lines in 19 files now uncovered.

28186 of 29746 relevant lines covered (94.76%)

45.93 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

69.23
/src/Console/Command/CheckCommand.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of PHP CS Fixer.
7
 *
8
 * (c) Fabien Potencier <fabien@symfony.com>
9
 *     Dariusz RumiƄski <dariusz.ruminski@gmail.com>
10
 *
11
 * This source file is subject to the MIT license that is bundled
12
 * with this source code in the file LICENSE.
13
 */
14

15
namespace PhpCsFixer\Console\Command;
16

17
use PhpCsFixer\ToolInfoInterface;
18
use Symfony\Component\Console\Attribute\AsCommand;
19
use Symfony\Component\Console\Input\InputInterface;
20
use Symfony\Component\Console\Input\InputOption;
21

22
/**
23
 * @author Greg Korba <greg@codito.dev>
24
 *
25
 * @internal
26
 */
27
#[AsCommand(name: 'check', description: 'Checks if configured files/directories comply with configured rules.')]
28
final class CheckCommand extends FixCommand
29
{
30
    /** @TODO PHP 8.0 - remove the property */
31
    protected static $defaultName = 'check'; // @phpstan-ignore property.parentPropertyFinalByPhpDoc
32

33
    /** @TODO PHP 8.0 - remove the property */
34
    protected static $defaultDescription = 'Checks if configured files/directories comply with configured rules.'; // @phpstan-ignore property.parentPropertyFinalByPhpDoc
35

36
    public function __construct(ToolInfoInterface $toolInfo)
37
    {
38
        parent::__construct($toolInfo);
1✔
39
    }
40

41
    public function getHelp(): string
42
    {
43
        $help = explode('<comment>--dry-run</comment>', parent::getHelp());
×
44

UNCOV
45
        return substr($help[0], 0, strrpos($help[0], "\n") - 1)
×
UNCOV
46
            .substr($help[1], strpos($help[1], "\n"));
×
47
    }
48

49
    protected function configure(): void
50
    {
51
        parent::configure();
1✔
52

53
        $this->setDefinition([
1✔
54
            ...array_values($this->getDefinition()->getArguments()),
1✔
55
            ...array_values(array_filter(
1✔
56
                $this->getDefinition()->getOptions(),
1✔
57
                static fn (InputOption $option): bool => 'dry-run' !== $option->getName()
1✔
58
            )),
1✔
59
        ]);
1✔
60
    }
61

62
    protected function isDryRun(InputInterface $input): bool
63
    {
UNCOV
64
        return true;
×
65
    }
66
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc