-
-
Notifications
You must be signed in to change notification settings - Fork 0
DevToolsCommandLoader
Responsible for dynamically discovering and loading Symfony Console commands within the DevTools context. This class extends the ContainerCommandLoader and integrates with a PSR-11 compatible container to lazily instantiate commands.
The implementation MUST scan a predefined directory for PHP classes representing console commands and SHALL only register classes that:
- Are instantiable
- Extend the Symfony\Component\Console\Command\Command base class
- Declare the Symfony\Component\Console\Attribute\AsCommand attribute
The command name MUST be extracted from the AsCommand attribute metadata and used as the key in the command map. Classes that do not meet these criteria MUST NOT be included in the command map.
- Full name:
\FastForward\DevTools\Console\CommandLoader\DevToolsCommandLoader - Parent class:
ContainerCommandLoader - This class is marked as final and can't be subclassed
- This class is a Final class
Constructs the DevToolsCommandLoader.
public __construct(\Symfony\Component\Finder\Finder $finder, \Psr\Container\ContainerInterface $container): mixedThis constructor initializes the command loader by scanning the Command directory for classes that are instantiable and have the AsCommand attribute. It builds a command map associating command names with their respective classes.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$finder |
\Symfony\Component\Finder\Finder | |
$container |
\Psr\Container\ContainerInterface |