Class CommandScanner
Scans the filesystem for command classes.
Implementation detail behind CommandCollection's discovery methods.
Not part of the supported public API - use CommandCollection
(e.g. discoverDirectory()) instead.
Method Summary
-
scanApp() public
Scan the application for shells & commands.
-
scanCore() public
Scan CakePHP internals for shells & commands.
-
scanDir() public
Scan a directory for .php files and return the class names that should be within them.
-
scanPlugin() public
Scan the named plugin for shells and commands
Method Detail
scanApp() ¶ public
scanApp(): array
Scan the application for shells & commands.
Returns
arrayA list of command metadata.
scanCore() ¶ public
scanCore(): array
Scan CakePHP internals for shells & commands.
Returns
arrayA list of command metadata.
scanDir() ¶ public
scanDir(string $path, string $namespace, string $prefix = '', array<string> $hide = []): array
Scan a directory for .php files and return the class names that should be within them.
Parameters
-
string$path The directory to read. Must end with a trailing directory separator.
-
string$namespace The namespace the shells live in.
-
string$prefix optional The prefix to apply to commands for their full name.
-
array<string>$hide optional A list of command names to hide as they are internal commands.
Returns
arrayThe list of shell info arrays based on scanning the filesystem and inflection.
scanPlugin() ¶ public
scanPlugin(string $plugin): array
Scan the named plugin for shells and commands
Parameters
-
string$plugin The named plugin.
Returns
arrayA list of command metadata.