The following are deprecated:
* `Ramsey\Uuid\Codec\OrderedTimeCodec`
* `Ramsey\Uuid\Codec\TimestampFirstCombCodec`
* `Ramsey\Uuid\Codec\TimestampLastCombCodec`
* `Ramsey\Uuid\Generator\CombGenerator`
Even tho, the `Stringable` interface is implicit on all objects containing the method `__toString`, it is recommended by PHP to explicitly setting that interface.
From php.net documentation:
> [...] Unlike most interfaces, **Stringable** is implicitly present on any class that has the magic `__toString()` method defined, although it can and should be declared explicitly.
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
* Assert, for psalm, the string is non-empty if validation passes
* Adds a test for SA asserting that valid string are also non-empty
* Suppress PHPStan error for unsupported conditional type assertion
* Check SA tools don't complain about non-empty-string as input parameter to `Uuid::isValid()`
This patch is based on https://github.com/ramsey/uuid/pull/405
As discussed in https://github.com/ramsey/uuid/pull/405#discussion_r832095457, the `ramsey/collection`
dependency can be phased out.
Doing so via direct removal is not feasible without a clear BC break, so this change only deprecates:
* `Ramsey\Uuid\Builder\BuilderCollection`
* `Ramsey\Uuid\Provider\Node\NodeProviderCollection`
These classes will then be removed in `5.0.0`, along with the `ramsey/collection` dependency.
With this change, `Uuid::uuid1()`, `Uuid::uuid2()` and so forth now produce a `LazyUuidFromString` instance, which
is both more memory efficient and comparable to `Uuid::fromString()` instances in other tools, such as within
PHPUnit's `Assertion::assertEqual()`, which would reject any two objects not matching each other's types.
Before this patch, `Assertion::assertEquals(Uuid::uuid5(...), Uuid::fromString(...))` would always fail due to
different subtypes produced by the two factory methods.