alex-oleshkevich/classnames
最新稳定版本:1.2
Composer 安装命令:
composer require alex-oleshkevich/classnames
包简介
A missing class name extractor from PHP files.
README 文档
README
This library extracts entity names from php files.
Supports plain classes, multiple entity per file, classes within curly namespaces, etc.
Installation
composer install alex-oleshkevich/classnames
Example
$extractor = new \ClassNames\ClassNames; $classes = $extractor->getClassNames('/path/to/file.php'); // or $interfaces = $extractor->getInterfaceNames('/path/to/file.php'); // or $traits = $extractor->getTraitNames('/path/to/file.php');
All functions listed above return a plain array of found entities.
// file "/path/to/file.php" namespace TestAsset { class Asset {} class Asset2 {} } $extractor = new \ClassNames\ClassNames; $classes = $extractor->getClassNames('/path/to/file.php'); print_r($classes); /** * Array * ( * [0] => TestAsset\Asset * [1] => TestAsset\Asset2 * ) */
统计信息
- 总下载量: 27.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-22