jbzoo/pimpledumper
最新稳定版本:1.2.2
Composer 安装命令:
composer require jbzoo/pimpledumper
包简介
Easy way to auto create pimple.json and .phpstorm.meta.php for Pimple Container
README 文档
README
Simple way to auto create pimple.json and .phpstorm.meta.php
Install
composer require jbzoo/pimpledumper
Install and activate Silex Plugin in PhpStorm settings
Usage
<?php require_once './vendor/autoload.php'; // composer autoload.php // Get needed classes use JBZoo\PimpleDumper\PimpleDumper; use Pimple\Container; // Init container $container = new Container(); $container['somekey'] = function() { return new SomeClass(); }; // Auto dump pimple.json on PimpleDumper destructor (or PHP die) $container->register(new PimpleDumper()); // register service // Manually (in the end of script!) $dumper = new PimpleDumper(); $dumper->dumpPimple($container); // Create new pimple.json $dumper->dumpPimple($container, true); // Append to current pimple.json $dumper->dumpPhpstorm($container); // Create new .phpstorm.meta.php (experimental!)
Output example
pimple.json
[
{
"name": "somekey",
"type": "class",
"value": "SomeClass"
}
]
.phpstorm.meta.php (experimental!)
<?php /** * ProcessWire PhpStorm Meta * * This file is not a CODE, it makes no sense and won't run or validate * Its AST serves PhpStorm IDE as DATA source to make advanced type inference decisions. * * @see https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata */ namespace PHPSTORM_META { $STATIC_METHOD_TYPES = [ new \Pimple\Container => [ '' == '@', 'somekey' instanceof SomeClass, ], ]; }
Result
Unit tests and check code style
make make test-all
License
MIT
统计信息
- 总下载量: 328.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 15
- 点击次数: 1
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-03