Skip to content

Use a generic unique values generators across the whole project #1124

@norberttech

Description

@norberttech

Just like we are now going to use Hash\Algorithm across whole project thanks to #1122 by @mleczakm I think we could do the same with Unique values.

Recently @stloyd replaced all uniquid() with bin2hex(random_bytes(...)) in #1102 but I think we should take it to another level and create a UniqueFactory with following methods:

UniqueFactory::string(int $length) : string
UniqueFactory::int(int $start, int $end) : int

and that should be enough to replace most of our current use cases where we are using bin2hex(random_bytes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions