class Json extends Base

Json importer class

Properties

protected string $_name
protected $_classes from Base
protected string $file

Methods

string
getName()

Returns the name.

from Base
boolean
setName(string $name)

Sets the name.

from Base
array
getClasses()

Returns all declared classes.

from Base
__construct(string $json)

Creates the instance.

array
load()

Reads the feature file defined in the constructor and uses the JSON serializer to return all datas as associative array.

Details

in Base at line 30
final string getName()

Returns the name.

Return Value

string

in Base at line 41
final boolean setName(string $name)

Sets the name.

Parameters

string $name

Return Value

boolean

in Base at line 57
array getClasses()

Returns all declared classes.

We need this way, because the autoloader will try to include the class file if we use "class_exists" or similar functions.

Return Value

array

at line 39
__construct(string $json)

Creates the instance.

Parameters

string $json The full filename of a JSON file that will be read inside of the load method.

at line 51
array load()

Reads the feature file defined in the constructor and uses the JSON serializer to return all datas as associative array.

Return Value

array The features array, in the following format: array( 'features' => array( 'group' => array( 'feature1name' => array( 'method1' => array( 'param1' => 'param1value', 'param2' => 'param2value' ), 'methodN' => array( 'param1' => 'param1value', 'param2' => 'param2value' ) ), 'featureNname' => array() ... ) ) );

Exceptions

Importer