This pull request changes the way annotations with non-constant arguments are emitted.
Single argument
// Declaration in user code
#[Verify(fn() => extension_loaded('pcntl')]
// Previous behavior
#[Verify(eval: 'fn() => extension_loaded(\'pcntl\')')]
// Code that is emitted now
#[Verify(eval: ['fn() => extension_loaded(\'pcntl\')'])]
Multiple (and named) arguments
// Declaration in user code
#[Verify(fn() => extension_loaded('pcntl'), optional: true)]
// Previous behavior created an ambiguity with supplying a single value with the respective array
#[Verify(eval: '[\'0\' => fn() => extension_loaded(\'pcntl\'), \'optional\' => true]')]
// Code that is emitted now
#[Verify(eval: ['fn() => extension_loaded(\'pcntl\'))', 'optional' => 'true'])]
The array notation is supported by the following changes:
This pull request changes the way annotations with non-constant arguments are emitted.
Single argument
Multiple (and named) arguments
The array notation is supported by the following changes:
See also https://github.com/xp-framework/rfc/issues/338