-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The Fiedsch\Data\Augmentation\Rules\TokenRule generates unique tokens by using getUniqueToken() without stating this in its name.
This method is slowed down by the uniqueness checks when large amounts of tokens are generated.
While we could use
$augmentor->addRule('token', new class implements AugmentationRule {
public function __invoke(Augmentor $augmentor, array $data): array
{
return ['token' => $augmentor['token']->createToken()];
}
});to generate tokens without uniqueness checks an idea might be to introduce a constructor in TokenRule that allows to specify if tokens are to be generated unique or not (with unique being the default for BC reasons). With that change we could use
$augmentor->addRule('token', new TokenRule(false));Metadata
Metadata
Assignees
Labels
No labels