Ben Ramsey
6bd7221484
Clean up docblocks, code, and note new deprecations
...
The following are deprecated:
* `Ramsey\Uuid\Codec\OrderedTimeCodec`
* `Ramsey\Uuid\Codec\TimestampFirstCombCodec`
* `Ramsey\Uuid\Codec\TimestampLastCombCodec`
* `Ramsey\Uuid\Generator\CombGenerator`
2025-05-31 17:20:12 -05:00
Ben Ramsey
76cbc566e2
chore(deps-dev): upgrade PHPStan
2025-05-25 16:52:53 -05:00
Ben Ramsey
691c2c816e
chore(deps-dev): remove Psalm
2025-05-25 14:53:53 -05:00
Markus Staab
558009ce4c
Prevent PHPStan error: 'Uuid::fromString() on a separate line has no effect.' ( #552 )
...
Co-authored-by: Ben Ramsey <ben@benramsey.com >
2024-05-18 14:34:25 -05:00
Wermeille Bastien
628d3dfc55
Fix Unserialize error with OrderedTimeCodec #494 ( #496 )
2023-04-15 17:59:43 -05:00
George Steel
4a14ce0c62
fix: Amends psalm assertion syntax on Uuid::isValid() to prevent incorrect type inference ( #486 )
...
* fix: Amends psalm assertion syntax on `Uuid::isValid()` to prevent incorrect type inference
* Add static analysis test case for invalid input
2023-01-10 16:09:08 -06:00
Marcel Berteler
5e24bfd390
feat: add Uuid:fromHexadecimal() ( #309 )
...
Co-authored-by: mberteler <marcel.berteler@capetown.gov.za >
Co-authored-by: Ben Ramsey <ben@benramsey.com >
2022-12-19 15:18:32 -06:00
Ben Ramsey
55d8833b06
feat: support version 8, custom UUIDs
2022-11-05 17:57:29 -05:00
Ben Ramsey
ae247f1dcd
chore: clean up types and PHP 8-ify the code
2022-09-15 22:14:04 -05:00
Ben Ramsey
685c2f3f23
feat: support max UUIDs
2022-09-14 20:44:24 -05:00
Ben Ramsey
4f4deb1dd6
feat: add UUIDv7 documentation and customization
2022-09-14 18:21:10 -05:00
Ben Ramsey
aa1e488afa
feat: support version 7 (Unix Epoch time) UUIDs
2022-09-13 22:13:33 -05:00
Ben Ramsey
078feed166
chore: update nomenclature
2022-09-12 20:56:42 -05:00
Ben Ramsey
b78bcda2d1
feat: move UuidV6 to the Rfc4122 namespace
2022-09-12 19:41:46 -05:00
Ben Ramsey
89905d1948
chore: remove deprecation notices
2022-09-12 19:41:45 -05:00
Ben Ramsey
2083110316
feat: deprecate variant and version constants
2022-08-12 20:18:40 -05:00
George Steel
b4dff559ab
Assert non-empty-string when UUID is valid ( #410 )
...
* 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()`
2022-08-09 10:04:36 -05:00
Ben Ramsey
7b3eaf32c7
Deprecate Uuid::setFactory() and Uuid::getFactory()
2022-08-05 17:34:18 -05:00
Ben Ramsey
55693967d7
Deprecate direct instantiation of Ramsey\Uuid\Uuid
2022-08-05 17:28:11 -05:00
Ben Ramsey
f1891183f9
Upgrade PHPStan
2022-08-05 14:46:56 -05:00
Ben Ramsey
115ec653d8
Un-deprecate UuidInterface::getUrn()
2022-03-27 20:55:27 -05:00
hubipe
e3e9179f27
LazyUuidFromString for valid UUIDs in uppercase ( #401 )
2022-01-29 13:05:59 -06:00
Graham Campbell
2ed177534e
Ignore serialization shape checking for code coverage purposes
2021-09-05 14:03:47 +01:00
Graham Campbell
0997de99a2
Add support for PHP 8.1
2021-09-05 12:41:13 +01:00
Chris Smith
8fa223b1af
Fix soft BC break of Uuid::fromString()
...
Uses an assertion to indicate the `$uuid` variable cannot be an empty
string, satisfying docblock on `LazyUuidFromString`.
2021-08-09 12:51:40 +01:00
Ben Ramsey
06f8e67792
Merge pull request #361 from slevomat/patch-1
...
Serialization should not use internal codec
2021-08-06 16:25:27 -05:00
Ben Ramsey
c005f69d6e
chore: update package files
2021-08-06 14:05:57 -05:00
Jan Langer
ef25479d05
Serialization should not use internal codec
2021-02-05 17:36:26 +01:00
Marco Pivetta
a621ca9e81
Uuid::uuid3() uses impure Uuid::getFactory() API - suppressing it from purity static analysis checks
2020-07-09 14:04:20 +02:00
Marco Pivetta
b805572537
Ensure that Uuid::uuidX() generators produce instances equivalent to Uuid::fromString() and Uuid::fromBytes()
...
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.
2020-07-09 13:57:30 +02:00
Marco Pivetta
910e3e459c
Adjusted comment wording: s/string/strict (typo)
...
Co-authored-by: Jacob Dreesen <jacob@hdreesen.de >
2020-07-09 13:57:30 +02:00
Marco Pivetta
1f0cd71d93
Applied fixes and suppressions (sadly) to match psalm/phpstan code quality guidelines
...
We have a lot of deprecated API in here which shouldn't exist in first place, but that
will luckily disappear with v5.0.0 :-)
2020-07-09 13:57:30 +02:00
Marco Pivetta
1ce3f55673
Applied automated CS fixes according to project CS settings
2020-07-09 13:57:30 +02:00
Marco Pivetta
0f68910bf2
Optimized Uuid::fromBytes() de-serialization to use LazyUuidFromString where possible
2020-07-09 13:57:30 +02:00
Marco Pivetta
569e93ac4e
Re-implemented Uuid::fromString() so it produces a LazyUuidFromString when possible
...
This should speed up `Uuid::fromString()` massively, leading to much shallower execution
paths when `toString()` and similar simplistic API is required.
2020-07-09 13:57:30 +02:00
Ben Ramsey
22ee596348
Make serialize(UuidInterface) more compact
...
Resolves #318
2020-07-08 15:27:19 -05:00
Ben Ramsey
ba8fff1d3a
Fix collection deserialization errors
2020-03-29 15:13:32 -05:00
Marco Pivetta
c8e8b7b693
Marking Uuid::uuid3() as pure as well: it produces same values for same input
2020-03-23 10:18:21 +01:00
Marco Pivetta
e830b23d77
Marking Uuid::uuid5() as pure: same input leads to same output, and no I/O under normal operational constraints
2020-03-23 10:18:21 +01:00
Ben Ramsey
b31703e7c9
Improve documentation
2020-03-04 22:50:39 -06:00
Ben Ramsey
cbd6a45a6a
[ci skip] Update documentation
2020-03-01 23:59:58 -06:00
Ben Ramsey
bb78f0e598
Simplify comparison algorithm
2020-03-01 16:19:40 -06:00
Ben Ramsey
19a91b7522
Add missing convenience methods for UuidV2
2020-02-29 11:29:12 -06:00
Ben Ramsey
fec93008bc
Accept Type\Hexadecimal for the first parameter to uuid1()
2020-02-24 14:34:40 -06:00
Ben Ramsey
ab3c89fb8e
Change the $node parameter from mixed to ?Hexadecimal
2020-02-24 13:44:03 -06:00
Ben Ramsey
614fc69b45
Add use statements for PHP functions
2020-02-23 16:13:31 -06:00
Ben Ramsey
a8bbc2f58a
Add ValidatorInterface::getPattern() and set constants to private
2020-02-23 16:12:52 -06:00
Ben Ramsey
cc2bf6f8ef
Support version 6 UUIDs
...
See the following:
* https://github.com/uuid6/uuid6-ietf-draft
* http://gh.peabody.io/uuidv6/
2020-02-22 22:41:15 -06:00
Ben Ramsey
65b0c091c0
Deprecate VALID_PATTERN, UUID_TYPE_IDENTIFIER; suggest replacements
2020-02-21 13:37:06 -06:00
Ben Ramsey
f42afcecbb
Rename Type\IntegerValue to Type\Integer
...
Rename `Type\IntegerValue` to `Type\Integer`. It was originally named
`IntegerValue` because static analysis sees `Integer` in docblock
annotations and treats it as the native `int` type. `Integer` is not a
reserved word in PHP, so it should be named `Integer` for consistency
with other types in this library. When using it, a class alias prevents
static analysis from complaining.
2020-02-21 11:59:49 -06:00