hamboldt/php-doc-reader

Reads configurations from comments in PHP, converting them from JSON to arrays.

v1.0.2 2016-05-10 12:02 UTC

This package is not auto-updated.

Last update: 2024-11-13 10:47:05 UTC


README

License Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads

Reads configuration assets in objects and elements, just like in the example below:

composer require hamboldt/php-doc-reader

Example

<?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');