met_mw/phpstormmetagenerator

PhpStorm 元文件生成器 (.phpstorm.meta.php)。

v1.0.0 2016-06-27 12:29 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:20:06 UTC


README

Build Status Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License

PhpStorm 元文件生成器 (.phpstorm.meta.php)。

安装

composer require met_mw/phpstormmetagenerator

示例

请参阅包根目录下的 "example" 文件夹。

use PhpStormMetaGenerator\Drivers\HostCMS\AdminEntitiesDriver;
use PhpStormMetaGenerator\Drivers\HostCMS\EntitiesDriver;
use PhpStormMetaGenerator\MetaGenerator;

// Replace it by project root path
const CMS_FOLDER = '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR
    . 'tests' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'hostcms' . DIRECTORY_SEPARATOR;

// Meta-file path
$phpStormMetaFilePath = CMS_FOLDER . '.phpstorm.meta.php';
// Modules directory path
$entitiesPath = CMS_FOLDER . 'modules';
// Administrator's area classes directory path
$adminEntitiesPath = CMS_FOLDER . 'adminentities';

$metaGenerator = new MetaGenerator($phpStormMetaFilePath);
$metaGenerator->addDriver(new DriverEntities($entitiesPath)) // Add entities driver
    ->addDriver(new DriverAdminEntities($adminEntitiesPath)) // Add admin-entities driver
    ->scan()
    ->printFile();

许可证

met-mw/PhpStormMetaGenerator 包是开源软件,许可证为 MIT 协议