scheb/implementation-iterator
最新稳定版本:v1.0.0
Composer 安装命令:
composer require scheb/implementation-iterator
包简介
Iterates a PSR-4 compliant directory for implementations of a class/interface
README 文档
README
This library creates an iterator for a PSR-4 compliant folder structure and searches it for all implementations/extensions of an interface/class. Abstract implementations and the class itself will be ignored.
Usage
$iterator = new \Scheb\ImplementationIterator("src/", "Root\Namespace", "Some\Class\Or\Interface"); foreach ($iterator as $className) { echo $className . "\n"; }
Will return something like:
Root\Namespace\Foo\Implementation
Root\Namespace\Bar\OtherImplementation
...
Alternatively you can also have an iterator, which returns ReflectionClass instances instead of the class name:
$iterator = new \Scheb\ImplementationReflectionIterator("src/", "Root\Namespace", "Some\Class\Or\Interface"); foreach ($iterator as $reflection) { echo $reflection->getName() . "\n"; }
License
This library is available under the MIT license.
统计信息
- 总下载量: 11.03k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-22