Description
Description
Following #57542, I'd like to review our usages of the uniqid()
function. It is currently considered for deprecation and removal.
I'm not sure if this the RFC for the deprecation will actually pass, but I agree with the motives behind that proposal. We should stop using that function.
We have quite a few usages in our codebase that can be clustered by the following concerns:
Generate a collision-free temporary file.
The tempnam()
function should be good enough for this purpose. And if it's not, maybe we can add a safer replacement to the Filesystem component?
Generate a collision-free random value for tests
It might be even better to work with a constant value in such situations.
Salt for a random string
We might as well just use random_bytes()
in such situations.
Generate a collision-free identifier
A UUIDv7 would probably be better suited in these cases. That would mean that we would need to pull symfony/uid
as a dependency in several packages, but that seems reasonable to me.
Example
No response