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

keradus / PHP-CS-Fixer / 13614616960

01 Mar 2025 10:06PM UTC coverage: 94.929% (-0.03%) from 94.959%
13614616960

push

github

keradus
bumped version

28060 of 29559 relevant lines covered (94.93%)

43.05 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
    protected static $defaultName = 'check';
31

32
    protected static $defaultDescription = 'Checks if configured files/directories comply with configured rules.';
33

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

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

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

47
    protected function configure(): void
48
    {
49
        parent::configure();
1✔
50

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

60
    protected function isDryRun(InputInterface $input): bool
61
    {
62
        return true;
×
63
    }
64
}
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