Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^3.5
->^4.0
Release Notes
ramsey/uuid (ramsey/uuid)
v4.7.4
Compare Source
Fixed
^0.11
.Stringable
interface toUuidInterface
.OrderedTimeCodec
reported in#494.
v4.7.3
Compare Source
Fixed
have replaced the 4.7.2 tag with a new tag that points to the correct commit,
but I am creating this tag to help notify users and automated processes who
might have already updated to the bad 4.7.2 tag.
v4.7.2
Compare Source
Fixed
Uuid::isValid()
to prevent incorrect typeinference (#486).
a commit in the 5.x branch.
v4.7.1
Compare Source
Fixed
v4.7.0
Compare Source
Added
Uuid::fromHexadecimal()
andUuidFactory::fromHexadecimal()
. Thesemethods are not required by the interfaces.
Fixed
00:00:00:00:00:00
).v4.6.0
Compare Source
Added
[draft-ietf-uuidrev-rfc4122bis-00, section 5.8][version8]. While still an
Internet-Draft, version 8 is stable and unlikely to change in any way that
breaks compatibility.
Ramsey\Uuid\Uuid::uuid8()
to generate version 8 UUIDs.Ramsey\Uuid\Rfc4122\UuidV8
.Ramsey\Uuid\Uuid::UUID_TYPE_CUSTOM
exists for version 8 UUIDs.Fixed
v4.5.1
Compare Source
Fixed
v4.5.0
Compare Source
Added
Nonstandard
namespace tothe
Rfc4122
namespace. Version 6 UUIDs are defined in[draft-ietf-uuidrev-rfc4122bis-00, section 5.6][version6]. While still an
Internet-Draft version 6 is stable and unlikely to change in any way that
breaks compatibility.
[draft-ietf-uuidrev-rfc4122bis-00, section 5.7][version7]. While still an
Internet-Draft, version 7 is stable and unlikely to change in any way that
breaks compatibility.
Ramsey\Uuid\Uuid::uuid7()
to generate version 7 UUIDs.Ramsey\Uuid\Rfc4122\UuidV7
.Ramsey\Uuid\Uuid::UUID_TYPE_UNIX_TIME
exists for version7 UUIDs.
Ramsey\Uuid\Converter\Time\UnixTimeConverter
andRamsey\Uuid\Generator\UnixTimeGenerator
to support version 7 UUID generation.Ramsey\Uuid\Uuid::MAX
andRamsey\Uuid\Rfc4122\MaxUuid
.Changed
^0.8.8
.Deprecated
The following will be removed in ramsey/uuid 5.0.0:
Ramsey\Uuid\Nonstandard\UuidV6
is deprecated in favor ofRamsey\Uuid\Rfc4122\UuidV6
.Ramsey\Uuid\Uuid::UUID_TYPE_PEABODY
; useRamsey\Uuid\Uuid::UUID_TYPE_REORDERED_TIME
instead.Fixed
Ramsey\Uuid\Uuid::isValid()
, Psalm now asserts the UUID is anon-empty-string when it is valid.
getVariant()
nowreturns a
2
when called on a nil UUID.v4.4.0
Compare Source
Changed
UuidInterface::getUrn()
.v4.3.1
Compare Source
Deprecated
The following will be removed in ramsey/uuid 5.0.0:
Ramsey\Uuid\Generator\RandomLibAdapter
v4.3.0
Compare Source
Changed
Composer will do the right thing for your environment and select a compatible
version of this library.
ext-ctype
extension. For applications that run in environments wherethe
ext-ctype
is not present, please require a polyfill, such assymfony/polyfill-ctype.
iterable<UuidBuilderInterface>
instead ofBuilderCollection
types.iterable<NodeProviderInterface>
instead ofNodeProviderCollection
types.Deprecated
The following will be removed in ramsey/uuid 5.0.0:
Ramsey\Uuid\Builder\BuilderCollection
Ramsey\Uuid\Provider\Node\NodeProviderCollection
Fixed
LazyUuidFromString
.v4.2.3
Compare Source
Fixed
^8.0
in the PHP version requirement.v4.2.2
Compare Source
Fixed
~8.1.0
to prevent installations on 8.2until the library is ready.
v4.2.1
Compare Source
Fixed
Uuid::fromString()
signature. The change fromstring
tonon-empty-string
on the parameter annotation introduced aBC break for those using static analysis tools. This release reverts this
change and provides an assertion to guard against empty strings.
See ramsey/uuid#383.
v4.2.0
Compare Source
Added
Ramsey\Uuid\Exception\UuidExceptionInterface
for all ramsey/uuidexceptions to implement. See ramsey/uuid#340.
Fixed
See ramsey/uuid#361.
v4.1.3
Compare Source
Fixed
^8.0
in the PHP version requirement.v4.1.2
Compare Source
Fixed
~8.0.0
to indicate it does not support PHP 8.1.v4.1.1
Compare Source
Fixed
v4.1.0
Compare Source
Changed
Uuid::fromString()
,Uuid::fromBytes()
,UuidInterface#toString()
, andUuidInterface#getBytes()
. See PR#324 for more information.
v4.0.3
Compare Source
Fixed
^8.0
in the PHP version requirement.v4.0.2
Compare Source
Fixed
~8.0.0
to indicate it does not support PHP 8.1.v4.0.1
Compare Source
Fixed
allowed_classes
beingset to
false
. For details, see ramsey/uuid#303and ramsey/collection#47.
v4.0.0
Compare Source
Added
including the static method
Uuid::uuid6()
, which returns aNonstandard\UuidV6
instance.method
Uuid::uuid2()
, which returns anRfc4122\UuidV2
instance.UUIDs or creating UUIDs from existing strings, bytes, or integers, if the UUID
is an RFC 4122 variant, one of these instances will be returned:
Rfc4122\UuidV1
Rfc4122\UuidV2
Rfc4122\UuidV3
Rfc4122\UuidV4
Rfc4122\UuidV5
Rfc4122\NilUuid
(non-RFC 4122 variant) UUIDs:
Nonstandard\UuidV6
Guid\Guid
Nonstandard\Uuid
Uuid::fromDateTime()
to create version 1 UUIDs from instances of\DateTimeInterface
.\DateTimeInterface
instance returned byUuidInterface::getDateTime()
(and now
Rfc4122\UuidV1::getDateTime()
) now includes microseconds, asspecified by the version 1 UUID.
Validator\ValidatorInterface
andValidator\GenericValidator
to allowflexibility in validating UUIDs/GUIDs.
relaxed validation pattern found in the 3.x series of ramsey/uuid.
Rfc4122\Validator
that may be used for strict validation ofRFC 4122 UUID strings.
Uuid
throughFeatureSet::setValidator()
.getValidator()
andsetValidator()
toUuidFactory
.Provider\Node\StaticNodeProvider
to assist in setting a custom staticnode value with the multicast bit set for version 1 UUIDs.
Exception\BuilderNotFoundException
-Thrown to indicate that no suitable UUID builder could be found.
Exception\DateTimeException
-Thrown to indicate that the PHP DateTime extension encountered an
exception/error.
Exception\DceSecurityException
-Thrown to indicate an exception occurred while dealing with DCE Security
(version 2) UUIDs.
Exception\InvalidArgumentException
-Thrown to indicate that the argument received is not valid. This extends the
built-in PHP
\InvalidArgumentException
, so there should be no BC breakswith ramsey/uuid throwing this exception, if you are catching the PHP
exception.
Exception\InvalidBytesException
-Thrown to indicate that the bytes being operated on are invalid in some way.
Exception\NameException
-Thrown to indicate that an error occurred while attempting to hash a
namespace and name.
Exception\NodeException
-Throw to indicate that attempting to fetch or create a node ID encountered
an error.
Exception\RandomSourceException
-Thrown to indicate that the source of random data encountered an error.
Exception\TimeSourceException
-Thrown to indicate that the source of time encountered an error.
Exception\UnableToBuildUuidException
-Thrown to indicate a builder is unable to build a UUID.
Builder\FallbackBuilder
, used byFeatureSet
to help decidewhether to return a
Uuid
orNonstandard\Uuid
when decoding aUUID string or bytes.
Rfc4122\UuidInterface
to specifically represent RFC 4122 variant UUIDs.Rfc4122\UuidBuilder
to build RFC 4122 variant UUIDs. This replaces theexisting
Builder\DefaultUuidBuilder
, which is now deprecated.Math\CalculatorInterface
for representing calculators to performarithmetic operations on integers.
Math\BrickMathCalculator
, which is the default calculator used by thislibrary when math cannot be performed in native PHP due to integer size
limitations. The calculator is configurable and may be changed, if desired.
Converter\Number\GenericNumberConverter
andConverter\Time\GenericTimeConverter
which will use the calculator providedto convert numbers and time to values for UUIDs.
Type\Hexadecimal
,Type\Integer
,Type\Decimal
, andType\Time
for improved type-safety when dealing with arbitrary string values.
Type\TypeInterface
that each of the ramsey/uuid types implements.Fields\FieldsInterface
andRfc4122\FieldsInterface
to definefield layouts for UUID variants. The implementations
Rfc4122\Fields
,Guid\Fields
, andNonstandard\Fields
store the 16-byte,binary string representation of the UUID internally, and these manage
conversion of the binary string into the hexadecimal field values.
Builder\BuilderCollection
andProvider\Node\NodeProviderCollection
.These are typed collections for providing builders and node providers to
Builder\FallbackBuilder
andProvider\Node\FallbackNodeProvider
, respectively.Generator\NameGeneratorInterface
to support alternate methods ofgenerating bytes for version 3 and version 5 name-based UUID. By default,
ramsey/uuid uses the
Generator\DefaultNameGenerator
, which uses the standardalgorithm this library has used since the beginning. You may choose to use the
new
Generator\PeclUuidNameGenerator
to make use of the newuuid_generate_md5()
anduuid_generate_sha1()
functions inext-uuid version 1.1.0.
Changed
functionality.
types. This should not cause any BC breaks if typehints target
UuidInterface
:Uuid::uuid1
returnsRfc4122\UuidV1
Uuid::uuid3
returnsRfc4122\UuidV3
Uuid::uuid4
returnsRfc4122\UuidV4
Uuid::uuid5
returnsRfc4122\UuidV5
Type\Hexadecimal
for the$node
parameter forUuidFactoryInterface::uuid1()
. This is in addition to theint|string
typesalready accepted, so there are no BC breaks.
Type\Hexadecimal
is now therecommended type to pass for
$node
.Uuid::fromString()
,Uuid::fromBytes()
, andUuid::fromInteger()
will now return either anRfc4122\UuidInterface
instance or an instance of
Nonstandard\Uuid
, depending on whether the inputcontains an RFC 4122 variant UUID with a valid version identifier. Both
implement
UuidInterface
, so BC breaks should not occur if typehints use theinterface.
Uuid::getFields()
to return an instance ofFields\FieldsInterface
.Previously, it returned an array of integer values (on 64-bit systems only).
Uuid::getDateTime()
now returns an instance of\DateTimeImmutable
insteadof
\DateTime
.UuidInterface
:getHex()
now returns aType\Hexadecimal
instance.getInteger()
now returns aType\Integer
instance. TheType\Integer
instance holds a string representation of a 128-bit integer. You may then
use a math library of your choice (bcmath, gmp, etc.) to operate on the
string integer.
getDateTime()
now returns\DateTimeInterface
instead of\DateTime
.__toString()
method.getFields()
method. It returns an instance ofFields\FieldsInterface
.UuidFactoryInterface
:uuid2()
uuid6()
fromDateTime()
fromInteger()
getValidator()
result in BC breaks, since the new exceptions extend from built-in PHP
exceptions that this library previously threw.
Exception\UnsupportedOperationException
is now descended from\LogicException
. Previously, it descended from\RuntimeException
.Uuid
:Uuid
fromarray $fields
toRfc4122\FieldsInterface $fields
.Converter\TimeConverterInterface $timeConverter
as the fourthrequired constructor parameter for
Uuid
.Builder\UuidBuilderInterface::build()
from
array $fields
tostring $bytes
. Rather than accepting an array ofhexadecimal strings as UUID fields, the
build()
method now expects a bytestring.
Converter\TimeConverterInterface $timeConverter
as the second requiredconstructor parameter for
Rfc4122\UuidBuilder
. This also affects thenow-deprecated
Builder\DefaultUuidBuilder
, since this class now inheritsfrom
Rfc4122\UuidBuilder
.convertTime()
method toConverter\TimeConverterInterface
.getTime()
method toProvider\TimeProviderInterface
. It replaces thecurrentTime()
method.Provider\Node\FallbackNodeProvider
now accepts only aProvider\Node\NodeProviderCollection
as its constructor parameter.Provider\Time\FixedTimeProvider
no longer accepts an array but accepts onlyType\Time
instances.Provider\NodeProviderInterface::getNode()
now returnsType\Hexadecimal
instead of
string|false|null
.Converter/TimeConverterInterface::calculateTime()
now returnsType\Hexadecimal
instead ofarray
. The value is the full UUID timestampvalue (count of 100-nanosecond intervals since the Gregorian calendar epoch)
in hexadecimal format.
NumberConverterInterface
to accept and return string valuesinstead of
mixed
; this simplifies the interface and makes it consistent.Generator\DefaultTimeGenerator
no longer adds the variant and version bitsto the bytes it returns. These must be applied to the bytes afterwards.
OrderedTimeCodec
now checkswhether the UUID is an RFC 4122 variant, version 1 UUID. If not, it will throw
an exception—
InvalidArgumentException
when usingOrderedTimeCodec::encodeBinary()
andUnsupportedOperationException
whenusing
OrderedTimeCodec::decodeBytes()
.Deprecated
The following functionality is deprecated and will be removed in ramsey/uuid
5.0.0.
UuidInterface
andUuid
are deprecated. Use theircounterparts on the
Rfc4122\FieldsInterface
returned byUuid::getFields()
.getClockSeqHiAndReservedHex()
getClockSeqLowHex()
getClockSequenceHex()
getFieldsHex()
getNodeHex()
getTimeHiAndVersionHex()
getTimeLowHex()
getTimeMidHex()
getTimestampHex()
getVariant()
getVersion()
Uuid
are deprecated. Use theRfc4122\FieldsInterface
instance returned by
Uuid::getFields()
to get theType\Hexadecimal
valuefor these fields. You may use the new
Math\CalculatorInterface::toIntegerValue()
method to convert the
Type\Hexadecimal
instances to instances ofType\Integer
. This library providesMath\BrickMathCalculator
, which may beused for this purpose, or you may use the arbitrary-precision arithemetic
library of your choice.
getClockSeqHiAndReserved()
getClockSeqLow()
getClockSequence()
getNode()
getTimeHiAndVersion()
getTimeLow()
getTimeMid()
getTimestamp()
getDateTime()
onUuidInterface
andUuid
is deprecated. Use this methodonly on instances of
Rfc4122\UuidV1
orNonstandard\UuidV6
.getUrn()
onUuidInterface
andUuid
is deprecated. It is available onRfc4122\UuidInterface
and classes that implement it.you may obtain the same information by calling
UuidInterface::getHex()
andsplitting the return value in half.
UuidInterface::getLeastSignificantBitsHex()
UuidInterface::getMostSignificantBitsHex()
Uuid::getLeastSignificantBitsHex()
Uuid::getMostSignificantBitsHex()
Uuid::getLeastSignificantBits()
Uuid::getMostSignificantBits()
UuidInterface::getNumberConverter()
andUuid::getNumberConverter()
aredeprecated. There is no alternative recommendation, so plan accordingly.
Builder\DefaultUuidBuilder
is deprecated; transition toRfc4122\UuidBuilder
.Converter\Number\BigNumberConverter
is deprecated; transition toConverter\Number\GenericNumberConverter
.Converter\Time\BigNumberTimeConverter
is deprecated; transition toConverter\Time\GenericTimeConverter
.These are no longer necessary; this library now behaves the same on 32-bit and
64-bit systems.
Builder\DegradedUuidBuilder
Converter\Number\DegradedNumberConverter
Converter\Time\DegradedTimeConverter
DegradedUuid
Uuid::UUID_TYPE_IDENTIFIER
constant is deprecated. UseUuid::UUID_TYPE_DCE_SECURITY
instead.Uuid::VALID_PATTERN
constant is deprecated. UseValidator\GenericValidator::getPattern()
orRfc4122\Validator::getPattern()
instead.
Removed
Generator\RandomBytesGenerator
as a suitable replacement:Generator\MtRandGenerator
Generator\OpenSslGenerator
Generator\SodiumRandomGenerator
Exception\UnsatisfiedDependencyException
. This library no longerthrows this exception.
Provider\TimeProviderInterface::currentTime()
. UseProvider\TimeProviderInterface::getTime()
instead.v3.9.7
Compare Source
Fixed
#[ReturnTypeWillChange]
toUuid::jsonSerialize()
method.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.