Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
DevToolsCommandProvider
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getCommands
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5/**
6 * This file is part of fast-forward/dev-tools.
7 *
8 * This source file is subject to the license bundled
9 * with this source code in the file LICENSE.
10 *
11 * @copyright Copyright (c) 2026 Felipe SayĆ£o Lobato Abreu <github@mentordosnerds.com>
12 * @license   https://opensource.org/licenses/MIT MIT License
13 *
14 * @see       https://github.com/php-fast-forward/dev-tools
15 * @see       https://github.com/php-fast-forward
16 * @see       https://datatracker.ietf.org/doc/html/rfc2119
17 */
18
19namespace FastForward\DevTools\Composer\Capability;
20
21use FastForward\DevTools\Command\AbstractCommand;
22use Composer\Plugin\Capability\CommandProvider as CommandProviderCapability;
23use FastForward\DevTools\Command\CodeStyleCommand;
24use FastForward\DevTools\Command\DocsCommand;
25use FastForward\DevTools\Command\PhpDocCommand;
26use FastForward\DevTools\Command\RefactorCommand;
27use FastForward\DevTools\Command\ReportsCommand;
28use FastForward\DevTools\Command\StandardsCommand;
29use FastForward\DevTools\Command\TestsCommand;
30use FastForward\DevTools\Command\WikiCommand;
31
32/**
33 * Provides a registry of custom dev-tools commands mapped for Composer integration.
34 * This capability struct MUST implement the defined `CommandProviderCapability`.
35 */
36final class DevToolsCommandProvider implements CommandProviderCapability
37{
38    /**
39     * Dispatches the comprehensive collection of CLI commands.
40     *
41     * The method MUST yield an array of instantiated command classes representing the tools.
42     * It SHALL be queried by the Composer plugin dynamically during runtime execution.
43     *
44     * @return array<int, AbstractCommand> the commands defined within the toolset
45     */
46    public function getCommands()
47    {
48        return [
49            new CodeStyleCommand(),
50            new RefactorCommand(),
51            new TestsCommand(),
52            new PhpDocCommand(),
53            new DocsCommand(),
54            new StandardsCommand(),
55            new ReportsCommand(),
56            new WikiCommand(),
57        ];
58    }
59}