hamboldt / php-doc-reader
从PHP注释中读取配置,将它们从JSON转换为数组。
v1.0.2
2016-05-10 12:02 UTC
Requires (Dev)
- php: >=5.4.0
- phpunit/phpunit: 4.8.1
This package is not auto-updated.
Last update: 2024-09-18 10:06:59 UTC
README
读取对象和元素中的配置资源,就像以下示例所示
composer require hamboldt/php-doc-reader
示例
<?php /** * Look this amazing configurable class. * @configure {"config_name":"config_value"} */ class MyConfigurableClass { /** * Look this amazing configurable property! * @configure {"config_name":"config_value"} */ public $property; } // array("config_name" => "config_value") PhpDocReader\Reader::getConfig('MyConfigurableClass'); // array("config_name" => "config_value") PhpDocReader\Reader::getConfig('MyConfigurableClass', 'property');