ContainerLoader
实现 LoaderInterface兼容 PSR-11 的命令加载器。
最终
| 自 |
2.0.0 |
|---|---|
| 包 |
Joomla 框架 |
方法
__construct
构造函数。
__construct(\Psr\Container\ContainerInterface container, mixed||string|int commandMap) :
| 自 |
2.0.0 |
|---|
参数
- container
ContainerInterface用于加载命令服务的容器。- commandMap
array<string|int, mixed>一个数组,其中命令名称作为键,服务 ID 作为值。
响应
混合
get
加载命令。
get( name) : \Joomla\Console\Command\AbstractCommand
getNames
获取已注册命令的名称。
getNames() : string||string|int
| 自 |
2.0.0 |
|---|
响应
array<string|int, string>
has
检查命令是否存在。
has( name) :
| 自 |
2.0.0 |
|---|
参数
- name
string要检查的命令。
响应
布尔值
属性
container
服务容器。
| 自 |
2.0.0 |
|---|
类型(s)
ContainerInterface
commandMap
命令名称到服务 ID 的映射。
| 自 |
2.0.0 |
|---|
类型(s)
array<string|int, string>