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

keradus / PHP-CS-Fixer / 22042339290

15 Feb 2026 08:14PM UTC coverage: 92.957% (-0.2%) from 93.171%
22042339290

push

github

keradus
test: check PHP env in CI jobs

29302 of 31522 relevant lines covered (92.96%)

44.04 hits per line

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

94.12
/src/Console/Internal/Application.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\Internal;
16

17
use PhpCsFixer\Console\Application as PublicApplication;
18
use PhpCsFixer\Console\Command\HelpCommand;
19
use PhpCsFixer\Console\Internal\Command\DecodeIdCommand;
20
use PhpCsFixer\Console\Internal\Command\DocumentationCommand;
21
use PhpCsFixer\Console\Internal\Command\ParseCommand;
22
use Symfony\Component\Console\Application as BaseApplication;
23
use Symfony\Component\Console\Command\Command;
24
use Symfony\Component\Console\Command\CompleteCommand;
25
use Symfony\Component\Console\Command\DumpCompletionCommand;
26
use Symfony\Component\Console\Command\ListCommand;
27
use Symfony\Component\Filesystem\Filesystem;
28

29
/**
30
 * @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
31
 *
32
 * @internal
33
 *
34
 * @no-named-arguments Parameter names are not covered by the backward compatibility promise.
35
 */
36
final class Application extends BaseApplication
37
{
38
    public function __construct(
39
        ?Filesystem $filesystem = null
40
    ) {
41
        $filesystem ??= new Filesystem();
1✔
42

43
        parent::__construct(
1✔
44
            \sprintf('%s - %s', PublicApplication::NAME, 'internal'),
1✔
45
            PublicApplication::VERSION,
1✔
46
        );
1✔
47

48
        $this->add(new DecodeIdCommand());
1✔
49
        $this->add(new DocumentationCommand($filesystem));
1✔
50
        $this->add(new ParseCommand());
1✔
51
    }
52

53
    // polyfill for `add` method, as it is not available in Symfony 8.0
54
    public function add(Command $command): ?Command
55
    {
56
        if (method_exists($this, 'addCommand')) { // @phpstan-ignore-line
1✔
57
            return $this->addCommand($command);
1✔
58
        }
59

60
        return parent::add($command); // @phpstan-ignore-line
×
61
    }
62

63
    public function getLongVersion(): string
64
    {
65
        return str_replace(
1✔
66
            PublicApplication::NAME,
1✔
67
            $this->getName(),
1✔
68
            PublicApplication::getAboutWithRuntime(true),
1✔
69
        );
1✔
70
    }
71

72
    protected function getDefaultCommands(): array
73
    {
74
        return [new HelpCommand(), new ListCommand(), new CompleteCommand(), new DumpCompletionCommand()];
1✔
75
    }
76
}
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