I've found a few problems:
- All rules don't have REPEATABLE flag.
Each, Nested rules (but suddenly not Group, Composite) don't work at all without additional attributes.
We have great example with composition of attributes, but configuring an inheritance have to be different.
How it's configuring now.
How it should be configured:
final class ChartsData
{
#[Each(
rules: [
new HasMany(Chart::class),
],
incorrectInputMessage: 'Custom message 1.',
message: 'Custom message 2.'
)]
private array $charts;
}
But HasMany and HasOne aren't Rules, so they can't be passed into rules. We need to make another rule something like "as from $classname". The implementation and name are up to developer.
I'll make a pr with tests those should pass
I've found a few problems:
Each,Nestedrules (but suddenly notGroup,Composite) don't work at all without additional attributes.We have great example with composition of attributes, but configuring an inheritance have to be different.
How it's configuring now.
How it should be configured:
But
HasManyandHasOnearen'tRules, so they can't be passed intorules. We need to make another rule something like "as from $classname". The implementation and name are up to developer.I'll make a pr with tests those should pass