The following are deprecated:
* `Ramsey\Uuid\Codec\OrderedTimeCodec`
* `Ramsey\Uuid\Codec\TimestampFirstCombCodec`
* `Ramsey\Uuid\Codec\TimestampLastCombCodec`
* `Ramsey\Uuid\Generator\CombGenerator`
Similarly to UUIDs, a hexadecimal can never be empty, this PR documents
it as such.
More and more libraries are starting to enforce stricter typing, I was
dealing with a library that required a `non-empty-string` which
hexadecimal isn't (is, but isn't documented that it is) which requires
either baselining false positives are adding redundant assertions.
Fixed deprecation warning for str_getcsv in php 8.4, since the default
parameter will change, by providing the parameter explicitly.
Sidenote: some of the vendor packages still have the same issue with
deprecation warnings when running code maintenance tools. They should be
updated as well.
Closes#587
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.
`substr()` only fails when one of the inputs is not a `string`, but that no longer
holds true as per `php:^8.0`, since the input must be a `string` upfront.