Upgrading ramsey/uuid 3 to 4
Breaking3.9.7 → 4.9.4Breaking4Platform1Deprecated28New40Changed58Fixed34Other1
BreakingUpgrade verdict
4 breaking changes and a platform requirement change.
In plain terms
- Remove the following bytes generators and recommend Generator\RandomBytesGenerator as a suitable replacement.
- Remove Exception\UnsatisfiedDependencyException.
- Remove the method Provider\TimeProviderInterface::currentTime().
- Remove currentTime() method from Provider\Time\FixedTimeProvider and Provider\Time\SystemTimeProvider; it had previously been removed from Provider\TimeProviderInterface.
Must act Top 5 of 27 that need code or config changes
ramsey/uuid publishes an official migration guide for version 4. It covers more than the release notes do.
Upgrade guide ↗PHP requirement changed in 4.3.0: ^5.4 | ^7.0 | ^8.0 → ^8.0.
What you must change
Breaking4
Remove the following bytes generators and recommend Generator\RandomBytesGenerator as a suitable replacement.
Generator\RandomBytesGeneratorGenerator\MtRandGeneratorGenerator\OpenSslGeneratorGenerator\SodiumRandomGeneratorRemove Exception\UnsatisfiedDependencyException.
Exception\UnsatisfiedDependencyExceptionRemove the method Provider\TimeProviderInterface::currentTime().
Provider\TimeProviderInterface::currentTime()Provider\TimeProviderInterface::getTime()Remove currentTime() method from Provider\Time\FixedTimeProvider and Provider\Time\SystemTimeProvider; it had previously been removed from Provider\TimeProviderInterface.
currentTime()Provider\Time\FixedTimeProviderProvider\Time\SystemTimeProviderProvider\TimeProviderInterfacePlatform1
Remove support for PHP 7.2, 7.3, and 7.4.
Deprecations to plan for
Deprecated22
Deprecates Ramsey\Uuid\Codec\OrderedTimeCodec, to be removed in 5.0.0; migrate to version 6 UUIDs.
Ramsey\Uuid\Codec\OrderedTimeCodecDeprecates Ramsey\Uuid\Codec\TimestampFirstCombCodec, to be removed in 5.0.0; migrate to version 7 UUIDs.
Ramsey\Uuid\Codec\TimestampFirstCombCodecDeprecates Ramsey\Uuid\Codec\TimestampLastCombCodec, to be removed in 5.0.0; use Ramsey\Uuid\Codec\StringCodec instead.
Ramsey\Uuid\Codec\TimestampLastCombCodecRamsey\Uuid\Codec\StringCodecDeprecates Ramsey\Uuid\Generator\CombGenerator, to be removed in 5.0.0; migrate to version 7 UUIDs.
Ramsey\Uuid\Generator\CombGeneratorRamsey\Uuid\Nonstandard\UuidV6 is deprecated in favor of Ramsey\Uuid\Rfc4122\UuidV6.
Ramsey\Uuid\Nonstandard\UuidV6Ramsey\Uuid\Rfc4122\UuidV6Ramsey\Uuid\Uuid::UUID_TYPE_PEABODY; use Ramsey\Uuid\Uuid::UUID_TYPE_REORDERED_TIME instead.
Ramsey\Uuid\Uuid::UUID_TYPE_PEABODYRamsey\Uuid\Uuid::UUID_TYPE_REORDERED_TIMERamsey\Uuid\Generator\RandomLibAdapter.
Ramsey\Uuid\Generator\RandomLibAdapterRamsey\Uuid\Builder\BuilderCollection.
Ramsey\Uuid\Builder\BuilderCollectionRamsey\Uuid\Provider\Node\NodeProviderCollection.
Ramsey\Uuid\Provider\Node\NodeProviderCollectionDependency on ramsey/collection.
The Uuid::UUID_TYPE_IDENTIFIER constant is deprecated.
Uuid::UUID_TYPE_IDENTIFIERUuid::UUID_TYPE_DCE_SECURITYThe Uuid::VALID_PATTERN constant is deprecated.
Uuid::VALID_PATTERNValidator\GenericValidator::getPattern()Rfc4122\Validator::getPattern()Validator\GenericValidator::VALID_PATTERNThe following methods from UuidInterface and Uuid are deprecated.
UuidInterfaceUuidRfc4122\FieldsInterfaceUuid::getFields()getClockSeqHiAndReservedHex()getClockSeqLowHex()Type\HexadecimalMath\CalculatorInterface::toIntegerValue()Type\IntegergetClockSeqHiAndReserved()getClockSeqLow()getDateTime() on UuidInterface and Uuid is deprecated.
getDateTime()UuidInterfaceUuidRfc4122\UuidV1Nonstandard\UuidV6getUrn() on UuidInterface and Uuid is deprecated.
getUrn()UuidInterfaceUuidRfc4122\UuidInterfaceThe following methods are deprecated and have no direct replacements.
UuidInterface::getHex()UuidInterface::getLeastSignificantBitsHex()UuidInterface::getMostSignificantBitsHex()Uuid::getLeastSignificantBitsHex()Uuid::getMostSignificantBitsHex()Uuid::getLeastSignificantBits()The classes for representing and generating degraded UUIDs are deprecated.
Builder\DegradedUuidBuilderConverter\Number\DegradedNumberConverterConverter\Time\DegradedTimeConverterDegradedUuidUuidInterface::getNumberConverter() and Uuid::getNumberConverter() are deprecated.
UuidInterface::getNumberConverter()Uuid::getNumberConverter()Builder\DefaultUuidBuilder is deprecated; transition to Rfc4122\UuidBuilder.
Builder\DefaultUuidBuilderRfc4122\UuidBuilderConverter\Number\BigNumberConverter is deprecated; transition to Converter\Number\GenericNumberConverter.
Converter\Number\BigNumberConverterConverter\Number\GenericNumberConverterConverter\Time\BigNumberTimeConverter is deprecated; transition to Converter\Time\GenericTimeConverter.
Converter\Time\BigNumberTimeConverterConverter\Time\GenericTimeConverterProvider\TimeProviderInterface::currentTime() is deprecated; transition to the getTimestamp() method on the same interface.
Provider\TimeProviderInterface::currentTime()getTimestamp()