Nightfirecat / RealmEye-API

An easy way to access your character data via RealmEye.
MIT License
13 stars 7 forks source link

Store item definitions in square-bracket-defined arrays #46

Closed Nightfirecat closed 7 years ago

Nightfirecat commented 7 years ago

So long as item definitions are stored as arrays in a flat PHP file, they should be stored with [...] instead of array(...) for clarity.

$php_substitution_pattern = '$1=>Array($3),';
// should be something like
$php_substitution_pattern = '$1=>[$3],';

and

$php_definitions = '<?php $ITEMS=Array(' . "\n";
// should be something like
$php_definitions = '<?php $ITEMS=[' . "\n";

and

$php_definitions = substr($php_definitions, 0, -2) . "\n" . ');';
// should be something like
$php_definitions = substr($php_definitions, 0, -2) . "\n" . '];';