Skip to content

Add CallbackRule rule #781

Description

@vjik

This is analogue of Callback but it returns a different rule that is already being applied.

Example of usage:

/**
 * @var array<int, string>
 */
private readonly array $categories;

#[CallbackRule(method: categoryIdRule)]
public int|null $categoryId = null;

private function categoryIdRule(): RuleInterface
{
    return new In(array_keys($this->categories));
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions