In every case, where values are possible (e.g. constant, parameter and property values) there can also be expressions, which are valid, some examples:
// value:
const FOO = 'bar';
// expr:
const FOO = self::BAR;
yet, this isn't realizable with the current API, as the API only works with values (though var_export() is used). This is very tricky. The following is absolutely legal:
$const->setValue('self::BAR');
// will turn into:
const FOO = 'self::BAR';
Would make sense to differentiate between them by adding a new method setExpression():
$const->setExpression('self::BAR');
// will turn into:
const FOO = self::BAR;
This would work pretty easy for simple statements, what about complex ones (e.g. nested arrays?, see also #10).
Ideas?
In every case, where values are possible (e.g. constant, parameter and property values) there can also be expressions, which are valid, some examples:
yet, this isn't realizable with the current API, as the API only works with values (though
var_export()is used). This is very tricky. The following is absolutely legal:Would make sense to differentiate between them by adding a new method
setExpression():This would work pretty easy for simple statements, what about complex ones (e.g. nested arrays?, see also #10).
Ideas?