Commit Graph

464 Commits

Author SHA1 Message Date
Ben Ramsey d2382419f3 Merge branch '4.x' into 5.x 2025-06-25 18:42:16 -05:00
Ben Ramsey 4ca249e960 Ignore the "result unused" error in tests from the PHPStan config 2025-06-25 08:24:36 -05:00
Brandon Morrison aa18ce15d5 Fix pure annotations (#605)
Coming from https://github.com/ramsey/uuid/pull/603, this is an attempt
to fix the errors raised by the current phpstan settings.

I went through each of the errors raised by phpstan with the following
approach.

- If a method is part of an `@immutable` class, we can consider it pure,
  assuming it only affects internal variables.
- If a potentially pure method is calling a class's method that is only
  swapped during testing (and not during normal usage), then we can
  consider the calling method pure.
- If a class is marked deprecated, don't bother with attempting to mark
  it pure or immutable.
2025-06-25 08:24:36 -05:00
Ben Ramsey eaa5e16923 Assert the length of time bytes is 6 2025-06-23 18:01:01 -05:00
Ben Ramsey f2956967f2 Update tests for testing bytes "rollover" 2025-06-23 17:32:33 -05:00
Ben Ramsey b40c069763 Remove errant echo statement from test.
[skip ci]
2025-06-23 15:27:20 -05:00
Ben Ramsey 7abc2f2035 Ensure tests are properly checking against the previous values 2025-06-22 17:38:46 -05:00
Ben Ramsey 76af496590 Merge branch '4.x' into 5.x 2025-05-31 20:55:42 -05:00
Ben Ramsey b21cb6d655 fix: max UUID should be variant 7, nil UUID should be variant 0 2025-05-31 20:12:03 -05:00
Ben Ramsey 74138a1c95 Remove deprecated classes
* Codec\OrderedTimeCodec
* Codec\TimestampFirstCombCodec
* Codec\TimestampLastCombCodec
* Generator\CombGenerator
* Nonstandard\UuidV6
2025-05-31 19:11:35 -05:00
Ben Ramsey 0e5cc7b564 Merge branch '4.x' into 5.x 2025-05-31 18:59:27 -05:00
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 bbd78052d7 chore(deps-dev): upgrade PHPUnit to v11.5 2025-05-26 01:54:17 -05:00
Ben Ramsey 17d7307f81 chore: bump minimum PHP version and lock packages for PHP 8.2.0 2025-05-25 23:28:05 -05:00
Ben Ramsey 82d4b5f92a Merge branch '4.x' into 5.x 2025-05-25 21:55:49 -05:00
Ben Ramsey bdd1b2f71f chore(deps-dev): upgrade remaining development dependencies 2025-05-25 19:37:26 -05:00
Ben Ramsey e82d747fbd Merge branch '4.x' into 5.x 2025-05-25 18:34:47 -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
Ben Ramsey d8ade1e1d2 Merge branch '4.x' into 5.x 2025-05-25 12:49:19 -05:00
Viktor Szépe 00945e11a4 Fix typo in SystemDceSecurityProviderTest (#510) 2023-11-07 23:25:47 -06:00
Ben Ramsey d04a1b479e Merge branch '4.x' into 5.x 2023-04-15 18:38:51 -05:00
Wermeille Bastien 628d3dfc55 Fix Unserialize error with OrderedTimeCodec #494 (#496) 2023-04-15 17:59:43 -05:00
Maximilian Bösing bf2bee216a Add explicit Stringable interface to UuidInterface (#491)
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>
2023-02-07 10:14:23 -06:00
Ben Ramsey 008f6cea26 Merge branch '4.x' into 5.x 2023-01-11 19:45:14 -06: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
Ben Ramsey c94add912b Merge branch '4.x' into 5.x 2023-01-01 15:15:10 -06:00
zedar187 77e33bc7be feat(SystemNodeProvider): dismiss zero'd mac address (#468)
Co-authored-by: Ben Ramsey <ben@benramsey.com>
2022-12-19 15:30:41 -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 0ba1ffb029 fix: ensure monotonicity for version 7 UUIDs 2022-11-05 16:29:26 -05:00
Ben Ramsey 283468905a refactor: improve string encoding performance of non-lazy UUIDs 2022-09-16 11:45:41 -05:00
Ben Ramsey 4000e896f9 refactor: remove dependency on ext-ctype 2022-09-16 09:43:44 -05:00
Ben Ramsey a180174b0e fix: update validation to support versions 6 & 7 2022-09-15 22:14:34 -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 483b9c9de0 feat: narrow the clock sequence type hints 2022-08-13 10:43:35 -05:00
Ben Ramsey 4e2fc803c6 feat: introduce TimeBasedUuidFactoryInterface 2022-08-13 10:21:59 -05:00
Ben Ramsey da8b9aba80 feat: add new BinaryUtils::applyVersionAndVariant() method 2022-08-12 21:14:07 -05:00
Ben Ramsey 8c0a06654e feat: introduce Version enum and use instead of constants 2022-08-12 20:10:51 -05:00
Ben Ramsey 3d3bf1b518 Update types throughout the code base 2022-08-09 18:23:17 -05:00
Ben Ramsey 86520a0d27 Merge branch '4.x' into 5.x 2022-08-09 10:07:10 -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 069d74fdce Remove deprecated Uuid::UUID_TYPE_IDENTIFIER constant 2022-08-05 16:55:10 -05:00
Ben Ramsey b551e4645d Remove deprecated Uuid::VALID_PATTERN constant 2022-08-05 16:52:23 -05:00
Ben Ramsey 346f840e21 Merge branch '4.x' into 5.x 2022-08-05 15:17:01 -05:00