create-prisma-php-app 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (574) hide show
  1. package/package.json +11 -4
  2. package/vendor/brick/math/.editorconfig +0 -15
  3. package/vendor/brick/math/.gitattributes +0 -11
  4. package/vendor/brick/math/.github/FUNDING.yml +0 -1
  5. package/vendor/brick/math/.github/workflows/ci.yml +0 -80
  6. package/vendor/brick/math/CHANGELOG.md +0 -445
  7. package/vendor/brick/math/LICENSE +0 -20
  8. package/vendor/brick/math/README.md +0 -247
  9. package/vendor/brick/math/composer.json +0 -34
  10. package/vendor/brick/math/phpunit.php +0 -51
  11. package/vendor/brick/math/phpunit.xml +0 -13
  12. package/vendor/brick/math/psalm.xml +0 -28
  13. package/vendor/brick/math/random-tests.php +0 -162
  14. package/vendor/brick/math/src/BigDecimal.php +0 -786
  15. package/vendor/brick/math/src/BigInteger.php +0 -1079
  16. package/vendor/brick/math/src/BigNumber.php +0 -512
  17. package/vendor/brick/math/src/BigRational.php +0 -445
  18. package/vendor/brick/math/src/Exception/DivisionByZeroException.php +0 -35
  19. package/vendor/brick/math/src/Exception/IntegerOverflowException.php +0 -23
  20. package/vendor/brick/math/src/Exception/MathException.php +0 -12
  21. package/vendor/brick/math/src/Exception/NegativeNumberException.php +0 -12
  22. package/vendor/brick/math/src/Exception/NumberFormatException.php +0 -33
  23. package/vendor/brick/math/src/Exception/RoundingNecessaryException.php +0 -19
  24. package/vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php +0 -75
  25. package/vendor/brick/math/src/Internal/Calculator/GmpCalculator.php +0 -108
  26. package/vendor/brick/math/src/Internal/Calculator/NativeCalculator.php +0 -581
  27. package/vendor/brick/math/src/Internal/Calculator.php +0 -676
  28. package/vendor/brick/math/src/RoundingMode.php +0 -107
  29. package/vendor/brick/math/tests/AbstractTestCase.php +0 -86
  30. package/vendor/brick/math/tests/BigDecimalTest.php +0 -2596
  31. package/vendor/brick/math/tests/BigIntegerTest.php +0 -3782
  32. package/vendor/brick/math/tests/BigNumberTest.php +0 -53
  33. package/vendor/brick/math/tests/BigRationalTest.php +0 -993
  34. package/vendor/brick/math/tests/CalculatorDetectTest.php +0 -25
  35. package/vendor/brick/math/tests/Internal/Calculator/NativeCalculatorTest.php +0 -87
  36. package/vendor/firebase/php-jwt/.gitattributes +0 -9
  37. package/vendor/firebase/php-jwt/.github/release-please.yml +0 -3
  38. package/vendor/firebase/php-jwt/.github/workflows/tests.yml +0 -57
  39. package/vendor/firebase/php-jwt/.php-cs-fixer.dist.php +0 -24
  40. package/vendor/firebase/php-jwt/CHANGELOG.md +0 -170
  41. package/vendor/firebase/php-jwt/LICENSE +0 -30
  42. package/vendor/firebase/php-jwt/README.md +0 -424
  43. package/vendor/firebase/php-jwt/composer.json +0 -42
  44. package/vendor/firebase/php-jwt/phpstan.neon.dist +0 -5
  45. package/vendor/firebase/php-jwt/phpunit.xml.dist +0 -18
  46. package/vendor/firebase/php-jwt/src/BeforeValidException.php +0 -18
  47. package/vendor/firebase/php-jwt/src/CachedKeySet.php +0 -268
  48. package/vendor/firebase/php-jwt/src/ExpiredException.php +0 -18
  49. package/vendor/firebase/php-jwt/src/JWK.php +0 -349
  50. package/vendor/firebase/php-jwt/src/JWT.php +0 -669
  51. package/vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php +0 -20
  52. package/vendor/firebase/php-jwt/src/Key.php +0 -64
  53. package/vendor/firebase/php-jwt/src/SignatureInvalidException.php +0 -7
  54. package/vendor/firebase/php-jwt/tests/CachedKeySetTest.php +0 -598
  55. package/vendor/firebase/php-jwt/tests/JWKTest.php +0 -172
  56. package/vendor/firebase/php-jwt/tests/JWTTest.php +0 -543
  57. package/vendor/firebase/php-jwt/tests/data/ec-jwkset.json +0 -40
  58. package/vendor/firebase/php-jwt/tests/data/ecdsa-private.pem +0 -18
  59. package/vendor/firebase/php-jwt/tests/data/ecdsa-public.pem +0 -9
  60. package/vendor/firebase/php-jwt/tests/data/ecdsa256-private.pem +0 -4
  61. package/vendor/firebase/php-jwt/tests/data/ecdsa384-private.pem +0 -6
  62. package/vendor/firebase/php-jwt/tests/data/ecdsa384-public.pem +0 -5
  63. package/vendor/firebase/php-jwt/tests/data/ed25519-1.pub +0 -1
  64. package/vendor/firebase/php-jwt/tests/data/ed25519-1.sec +0 -1
  65. package/vendor/firebase/php-jwt/tests/data/ed25519-jwkset.json +0 -11
  66. package/vendor/firebase/php-jwt/tests/data/rsa-jwkset.json +0 -18
  67. package/vendor/firebase/php-jwt/tests/data/rsa-with-passphrase.pem +0 -42
  68. package/vendor/firebase/php-jwt/tests/data/rsa1-private.pem +0 -27
  69. package/vendor/firebase/php-jwt/tests/data/rsa1-public.pub +0 -9
  70. package/vendor/firebase/php-jwt/tests/data/rsa2-private.pem +0 -27
  71. package/vendor/firebase/php-jwt/tests/data/secp256k1-private.pem +0 -5
  72. package/vendor/firebase/php-jwt/tests/data/secp256k1-public.pem +0 -4
  73. package/vendor/graham-campbell/result-type/.gitattributes +0 -9
  74. package/vendor/graham-campbell/result-type/.github/CODE_OF_CONDUCT.md +0 -132
  75. package/vendor/graham-campbell/result-type/.github/CONTRIBUTING.md +0 -31
  76. package/vendor/graham-campbell/result-type/.github/FUNDING.yml +0 -2
  77. package/vendor/graham-campbell/result-type/.github/SECURITY.md +0 -14
  78. package/vendor/graham-campbell/result-type/.github/workflows/tests.yml +0 -40
  79. package/vendor/graham-campbell/result-type/CHANGELOG.md +0 -43
  80. package/vendor/graham-campbell/result-type/LICENSE +0 -21
  81. package/vendor/graham-campbell/result-type/README.md +0 -42
  82. package/vendor/graham-campbell/result-type/composer.json +0 -33
  83. package/vendor/graham-campbell/result-type/phpunit.xml.dist +0 -13
  84. package/vendor/graham-campbell/result-type/src/Error.php +0 -121
  85. package/vendor/graham-campbell/result-type/src/Result.php +0 -69
  86. package/vendor/graham-campbell/result-type/src/Success.php +0 -120
  87. package/vendor/graham-campbell/result-type/tests/ResultTest.php +0 -95
  88. package/vendor/hidehalo/nanoid-php/.editorconfig +0 -15
  89. package/vendor/hidehalo/nanoid-php/.gitattributes +0 -8
  90. package/vendor/hidehalo/nanoid-php/.github/workflows/php.yml +0 -49
  91. package/vendor/hidehalo/nanoid-php/.styleci.yml +0 -1
  92. package/vendor/hidehalo/nanoid-php/CHANGELOG.md +0 -36
  93. package/vendor/hidehalo/nanoid-php/CODE_OF_CONDUCT.md +0 -74
  94. package/vendor/hidehalo/nanoid-php/CONTRIBUTING.md +0 -32
  95. package/vendor/hidehalo/nanoid-php/ISSUE_TEMPLATE.md +0 -27
  96. package/vendor/hidehalo/nanoid-php/LICENSE.md +0 -21
  97. package/vendor/hidehalo/nanoid-php/PULL_REQUEST_TEMPLATE.md +0 -43
  98. package/vendor/hidehalo/nanoid-php/README.md +0 -108
  99. package/vendor/hidehalo/nanoid-php/benchmark/benchmark.php +0 -24
  100. package/vendor/hidehalo/nanoid-php/composer.json +0 -62
  101. package/vendor/hidehalo/nanoid-php/examples/basic_usage.php +0 -24
  102. package/vendor/hidehalo/nanoid-php/examples/custom_formated.php +0 -29
  103. package/vendor/hidehalo/nanoid-php/phpunit.xml +0 -31
  104. package/vendor/hidehalo/nanoid-php/src/Client.php +0 -120
  105. package/vendor/hidehalo/nanoid-php/src/Core.php +0 -31
  106. package/vendor/hidehalo/nanoid-php/src/CoreInterface.php +0 -19
  107. package/vendor/hidehalo/nanoid-php/src/Generator.php +0 -13
  108. package/vendor/hidehalo/nanoid-php/src/GeneratorInterface.php +0 -13
  109. package/vendor/hidehalo/nanoid-php/tests/ClientTest.php +0 -76
  110. package/vendor/hidehalo/nanoid-php/tests/CoreTest.php +0 -37
  111. package/vendor/hidehalo/nanoid-php/tests/GeneratorTest.php +0 -34
  112. package/vendor/hidehalo/nanoid-php/tests/Support/DummyGenerator.php +0 -20
  113. package/vendor/paragonie/random_compat/.gitattributes +0 -14
  114. package/vendor/paragonie/random_compat/.scrutinizer.yml +0 -4
  115. package/vendor/paragonie/random_compat/.travis.yml +0 -59
  116. package/vendor/paragonie/random_compat/CHANGELOG.md +0 -3
  117. package/vendor/paragonie/random_compat/LICENSE +0 -22
  118. package/vendor/paragonie/random_compat/RATIONALE.md +0 -36
  119. package/vendor/paragonie/random_compat/README.md +0 -232
  120. package/vendor/paragonie/random_compat/SECURITY.md +0 -108
  121. package/vendor/paragonie/random_compat/build-phar.sh +0 -5
  122. package/vendor/paragonie/random_compat/composer.json +0 -34
  123. package/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey +0 -5
  124. package/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc +0 -11
  125. package/vendor/paragonie/random_compat/lib/random.php +0 -32
  126. package/vendor/paragonie/random_compat/other/build_phar.php +0 -57
  127. package/vendor/paragonie/random_compat/other/ide_stubs/COM.php +0 -20
  128. package/vendor/paragonie/random_compat/other/ide_stubs/README.md +0 -7
  129. package/vendor/paragonie/random_compat/other/ide_stubs/com_exception.php +0 -11
  130. package/vendor/paragonie/random_compat/other/ide_stubs/libsodium.php +0 -90
  131. package/vendor/paragonie/random_compat/phpunit.sh +0 -60
  132. package/vendor/paragonie/random_compat/phpunit.xml.dist +0 -31
  133. package/vendor/paragonie/random_compat/psalm-autoload.php +0 -9
  134. package/vendor/paragonie/random_compat/psalm.xml +0 -19
  135. package/vendor/paragonie/random_compat/tests/full/DieHardTest.php +0 -61
  136. package/vendor/paragonie/random_compat/tests/full/StatTest.php +0 -52
  137. package/vendor/paragonie/random_compat/tests/specific/capicom.php +0 -7
  138. package/vendor/paragonie/random_compat/tests/specific/dev_urandom.php +0 -7
  139. package/vendor/paragonie/random_compat/tests/specific/libsodium.php +0 -7
  140. package/vendor/paragonie/random_compat/tests/specific/libsodium_legacy.php +0 -7
  141. package/vendor/paragonie/random_compat/tests/specific/mcrypt.php +0 -7
  142. package/vendor/paragonie/random_compat/tests/unit/RandomBytesTest.php +0 -80
  143. package/vendor/paragonie/random_compat/tests/unit/RandomIntTest.php +0 -63
  144. package/vendor/paragonie/random_compat/tests/unit/UtilityTest.php +0 -95
  145. package/vendor/paragonie/random_compat/tests/unit_with_basedir/RandomBytesTest.php +0 -100
  146. package/vendor/paragonie/random_compat/tests/unit_with_basedir/RandomIntTest.php +0 -82
  147. package/vendor/paragonie/random_compat/tests/unit_with_basedir/UtilityTest.php +0 -95
  148. package/vendor/phpoption/phpoption/.gitattributes +0 -14
  149. package/vendor/phpoption/phpoption/.github/CODE_OF_CONDUCT.md +0 -132
  150. package/vendor/phpoption/phpoption/.github/CONTRIBUTING.md +0 -30
  151. package/vendor/phpoption/phpoption/.github/FUNDING.yml +0 -2
  152. package/vendor/phpoption/phpoption/.github/SECURITY.md +0 -14
  153. package/vendor/phpoption/phpoption/.github/workflows/static.yml +0 -74
  154. package/vendor/phpoption/phpoption/.github/workflows/tests.yml +0 -40
  155. package/vendor/phpoption/phpoption/LICENSE +0 -201
  156. package/vendor/phpoption/phpoption/Makefile +0 -26
  157. package/vendor/phpoption/phpoption/README.md +0 -194
  158. package/vendor/phpoption/phpoption/composer.json +0 -52
  159. package/vendor/phpoption/phpoption/phpstan-baseline.neon +0 -32
  160. package/vendor/phpoption/phpoption/phpstan.neon.dist +0 -8
  161. package/vendor/phpoption/phpoption/phpunit.xml.dist +0 -13
  162. package/vendor/phpoption/phpoption/psalm.xml +0 -12
  163. package/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php +0 -175
  164. package/vendor/phpoption/phpoption/src/PhpOption/None.php +0 -136
  165. package/vendor/phpoption/phpoption/src/PhpOption/Option.php +0 -434
  166. package/vendor/phpoption/phpoption/src/PhpOption/Some.php +0 -169
  167. package/vendor/phpoption/phpoption/tests/PhpOption/Tests/EnsureTest.php +0 -77
  168. package/vendor/phpoption/phpoption/tests/PhpOption/Tests/LazyOptionTest.php +0 -200
  169. package/vendor/phpoption/phpoption/tests/PhpOption/Tests/NoneTest.php +0 -153
  170. package/vendor/phpoption/phpoption/tests/PhpOption/Tests/OptionTest.php +0 -160
  171. package/vendor/phpoption/phpoption/tests/PhpOption/Tests/SomeTest.php +0 -194
  172. package/vendor/phpoption/phpoption/tests/bootstrap.php +0 -8
  173. package/vendor/phpoption/phpoption/vendor-bin/phpstan/composer.json +0 -8
  174. package/vendor/phpoption/phpoption/vendor-bin/psalm/composer.json +0 -8
  175. package/vendor/ramsey/uuid/.editorconfig +0 -16
  176. package/vendor/ramsey/uuid/.gitattributes +0 -26
  177. package/vendor/ramsey/uuid/.github/CODEOWNERS +0 -1
  178. package/vendor/ramsey/uuid/.github/FUNDING.yml +0 -2
  179. package/vendor/ramsey/uuid/.github/ISSUE_TEMPLATE/Bug_Report.md +0 -35
  180. package/vendor/ramsey/uuid/.github/ISSUE_TEMPLATE/Feature_Request.md +0 -31
  181. package/vendor/ramsey/uuid/.github/ISSUE_TEMPLATE/Question.md +0 -19
  182. package/vendor/ramsey/uuid/.github/ISSUE_TEMPLATE/config.yml +0 -1
  183. package/vendor/ramsey/uuid/.github/dependabot.yml +0 -15
  184. package/vendor/ramsey/uuid/.github/pull_request_template.md +0 -27
  185. package/vendor/ramsey/uuid/.github/workflows/continuous-integration.yml +0 -181
  186. package/vendor/ramsey/uuid/.github/workflows/merge-dependabot-upgrades.yml +0 -24
  187. package/vendor/ramsey/uuid/.readthedocs.yml +0 -11
  188. package/vendor/ramsey/uuid/CHANGELOG.md +0 -1511
  189. package/vendor/ramsey/uuid/CODE_OF_CONDUCT.md +0 -73
  190. package/vendor/ramsey/uuid/CONTRIBUTING.md +0 -171
  191. package/vendor/ramsey/uuid/LICENSE +0 -19
  192. package/vendor/ramsey/uuid/README.md +0 -83
  193. package/vendor/ramsey/uuid/SECURITY.md +0 -170
  194. package/vendor/ramsey/uuid/build/.gitignore +0 -6
  195. package/vendor/ramsey/uuid/build/cache/.gitkeep +0 -0
  196. package/vendor/ramsey/uuid/build/logs/.gitkeep +0 -0
  197. package/vendor/ramsey/uuid/captainhook.json +0 -105
  198. package/vendor/ramsey/uuid/codecov.yml +0 -29
  199. package/vendor/ramsey/uuid/composer.json +0 -106
  200. package/vendor/ramsey/uuid/composer.lock +0 -7208
  201. package/vendor/ramsey/uuid/docs/Makefile +0 -20
  202. package/vendor/ramsey/uuid/docs/README.md +0 -36
  203. package/vendor/ramsey/uuid/docs/_static/.gitkeep +0 -0
  204. package/vendor/ramsey/uuid/docs/conf.py +0 -103
  205. package/vendor/ramsey/uuid/docs/copyright.rst +0 -18
  206. package/vendor/ramsey/uuid/docs/customize/calculators.rst +0 -75
  207. package/vendor/ramsey/uuid/docs/customize/factory.rst +0 -93
  208. package/vendor/ramsey/uuid/docs/customize/ordered-time-codec.rst +0 -86
  209. package/vendor/ramsey/uuid/docs/customize/timestamp-first-comb-codec.rst +0 -72
  210. package/vendor/ramsey/uuid/docs/customize/validators.rst +0 -39
  211. package/vendor/ramsey/uuid/docs/customize.rst +0 -56
  212. package/vendor/ramsey/uuid/docs/database.rst +0 -260
  213. package/vendor/ramsey/uuid/docs/faq.rst +0 -132
  214. package/vendor/ramsey/uuid/docs/index.rst +0 -51
  215. package/vendor/ramsey/uuid/docs/introduction.rst +0 -31
  216. package/vendor/ramsey/uuid/docs/nonstandard/guid.rst +0 -152
  217. package/vendor/ramsey/uuid/docs/nonstandard/other.rst +0 -49
  218. package/vendor/ramsey/uuid/docs/nonstandard/version6.rst +0 -17
  219. package/vendor/ramsey/uuid/docs/nonstandard.rst +0 -40
  220. package/vendor/ramsey/uuid/docs/quickstart.rst +0 -112
  221. package/vendor/ramsey/uuid/docs/reference/calculators.rst +0 -168
  222. package/vendor/ramsey/uuid/docs/reference/exceptions.rst +0 -92
  223. package/vendor/ramsey/uuid/docs/reference/fields-fieldsinterface.rst +0 -16
  224. package/vendor/ramsey/uuid/docs/reference/guid-fields.rst +0 -13
  225. package/vendor/ramsey/uuid/docs/reference/guid-guid.rst +0 -20
  226. package/vendor/ramsey/uuid/docs/reference/helper.rst +0 -62
  227. package/vendor/ramsey/uuid/docs/reference/name-based-namespaces.rst +0 -31
  228. package/vendor/ramsey/uuid/docs/reference/nonstandard-fields.rst +0 -13
  229. package/vendor/ramsey/uuid/docs/reference/nonstandard-uuid.rst +0 -20
  230. package/vendor/ramsey/uuid/docs/reference/nonstandard-uuidv6.rst +0 -34
  231. package/vendor/ramsey/uuid/docs/reference/rfc4122-fieldsinterface.rst +0 -78
  232. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidinterface.rst +0 -20
  233. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv1.rst +0 -21
  234. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv2.rst +0 -47
  235. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv3.rst +0 -13
  236. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv4.rst +0 -13
  237. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv5.rst +0 -13
  238. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv6.rst +0 -31
  239. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv7.rst +0 -20
  240. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv8.rst +0 -13
  241. package/vendor/ramsey/uuid/docs/reference/rfc4122-version.rst +0 -87
  242. package/vendor/ramsey/uuid/docs/reference/timebaseduuidinterface.rst +0 -16
  243. package/vendor/ramsey/uuid/docs/reference/types.rst +0 -79
  244. package/vendor/ramsey/uuid/docs/reference/uuid.rst +0 -161
  245. package/vendor/ramsey/uuid/docs/reference/uuidfactoryinterface.rst +0 -102
  246. package/vendor/ramsey/uuid/docs/reference/uuidinterface.rst +0 -60
  247. package/vendor/ramsey/uuid/docs/reference/validators.rst +0 -34
  248. package/vendor/ramsey/uuid/docs/reference/variant.rst +0 -32
  249. package/vendor/ramsey/uuid/docs/reference.rst +0 -37
  250. package/vendor/ramsey/uuid/docs/requirements.txt +0 -3
  251. package/vendor/ramsey/uuid/docs/rfc4122/version1.rst +0 -192
  252. package/vendor/ramsey/uuid/docs/rfc4122/version2.rst +0 -273
  253. package/vendor/ramsey/uuid/docs/rfc4122/version3.rst +0 -68
  254. package/vendor/ramsey/uuid/docs/rfc4122/version4.rst +0 -39
  255. package/vendor/ramsey/uuid/docs/rfc4122/version5.rst +0 -108
  256. package/vendor/ramsey/uuid/docs/rfc4122/version6.rst +0 -213
  257. package/vendor/ramsey/uuid/docs/rfc4122/version7.rst +0 -173
  258. package/vendor/ramsey/uuid/docs/rfc4122/version8.rst +0 -51
  259. package/vendor/ramsey/uuid/docs/rfc4122.rst +0 -67
  260. package/vendor/ramsey/uuid/docs/testing.rst +0 -199
  261. package/vendor/ramsey/uuid/docs/tidelift.rst +0 -74
  262. package/vendor/ramsey/uuid/docs/upgrading/2-to-3.rst +0 -31
  263. package/vendor/ramsey/uuid/docs/upgrading/3-to-4.rst +0 -512
  264. package/vendor/ramsey/uuid/docs/upgrading.rst +0 -11
  265. package/vendor/ramsey/uuid/phpbench.json +0 -10
  266. package/vendor/ramsey/uuid/phpcs.xml.dist +0 -476
  267. package/vendor/ramsey/uuid/phpstan-tests.neon +0 -32
  268. package/vendor/ramsey/uuid/phpstan.neon.dist +0 -25
  269. package/vendor/ramsey/uuid/phpunit.xml.dist +0 -26
  270. package/vendor/ramsey/uuid/psalm-baseline.xml +0 -133
  271. package/vendor/ramsey/uuid/psalm.xml +0 -25
  272. package/vendor/ramsey/uuid/resources/vagrant/README.md +0 -10
  273. package/vendor/ramsey/uuid/resources/vagrant/freebsd/README.md +0 -15
  274. package/vendor/ramsey/uuid/resources/vagrant/freebsd/Vagrantfile +0 -35
  275. package/vendor/ramsey/uuid/resources/vagrant/linux/README.md +0 -15
  276. package/vendor/ramsey/uuid/resources/vagrant/linux/Vagrantfile +0 -27
  277. package/vendor/ramsey/uuid/resources/vagrant/windows/README.md +0 -16
  278. package/vendor/ramsey/uuid/resources/vagrant/windows/Vagrantfile +0 -22
  279. package/vendor/ramsey/uuid/src/BinaryUtils.php +0 -106
  280. package/vendor/ramsey/uuid/src/Builder/FallbackBuilder.php +0 -68
  281. package/vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php +0 -39
  282. package/vendor/ramsey/uuid/src/Codec/CodecInterface.php +0 -67
  283. package/vendor/ramsey/uuid/src/Codec/GuidStringCodec.php +0 -82
  284. package/vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php +0 -114
  285. package/vendor/ramsey/uuid/src/Codec/StringCodec.php +0 -128
  286. package/vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php +0 -105
  287. package/vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php +0 -51
  288. package/vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php +0 -48
  289. package/vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php +0 -53
  290. package/vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php +0 -118
  291. package/vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php +0 -163
  292. package/vendor/ramsey/uuid/src/Converter/Time/UnixTimeConverter.php +0 -90
  293. package/vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php +0 -58
  294. package/vendor/ramsey/uuid/src/Exception/BuilderNotFoundException.php +0 -24
  295. package/vendor/ramsey/uuid/src/Exception/DateTimeException.php +0 -24
  296. package/vendor/ramsey/uuid/src/Exception/DceSecurityException.php +0 -25
  297. package/vendor/ramsey/uuid/src/Exception/InvalidArgumentException.php +0 -24
  298. package/vendor/ramsey/uuid/src/Exception/InvalidBytesException.php +0 -24
  299. package/vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php +0 -25
  300. package/vendor/ramsey/uuid/src/Exception/NameException.php +0 -25
  301. package/vendor/ramsey/uuid/src/Exception/NodeException.php +0 -24
  302. package/vendor/ramsey/uuid/src/Exception/RandomSourceException.php +0 -27
  303. package/vendor/ramsey/uuid/src/Exception/TimeSourceException.php +0 -24
  304. package/vendor/ramsey/uuid/src/Exception/UnableToBuildUuidException.php +0 -24
  305. package/vendor/ramsey/uuid/src/Exception/UnsupportedOperationException.php +0 -24
  306. package/vendor/ramsey/uuid/src/Exception/UuidExceptionInterface.php +0 -21
  307. package/vendor/ramsey/uuid/src/FeatureSet.php +0 -395
  308. package/vendor/ramsey/uuid/src/Fields/FieldsInterface.php +0 -42
  309. package/vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php +0 -70
  310. package/vendor/ramsey/uuid/src/Generator/CombGenerator.php +0 -124
  311. package/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php +0 -139
  312. package/vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php +0 -53
  313. package/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php +0 -51
  314. package/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php +0 -131
  315. package/vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php +0 -30
  316. package/vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php +0 -38
  317. package/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php +0 -52
  318. package/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php +0 -37
  319. package/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php +0 -39
  320. package/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php +0 -45
  321. package/vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php +0 -30
  322. package/vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php +0 -31
  323. package/vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php +0 -45
  324. package/vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php +0 -38
  325. package/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php +0 -170
  326. package/vendor/ramsey/uuid/src/Guid/Fields.php +0 -208
  327. package/vendor/ramsey/uuid/src/Guid/Guid.php +0 -61
  328. package/vendor/ramsey/uuid/src/Guid/GuidBuilder.php +0 -79
  329. package/vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php +0 -226
  330. package/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php +0 -145
  331. package/vendor/ramsey/uuid/src/Math/CalculatorInterface.php +0 -106
  332. package/vendor/ramsey/uuid/src/Math/RoundingMode.php +0 -146
  333. package/vendor/ramsey/uuid/src/Nonstandard/Fields.php +0 -154
  334. package/vendor/ramsey/uuid/src/Nonstandard/Uuid.php +0 -37
  335. package/vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php +0 -78
  336. package/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php +0 -113
  337. package/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php +0 -236
  338. package/vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php +0 -41
  339. package/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php +0 -54
  340. package/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php +0 -69
  341. package/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php +0 -74
  342. package/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php +0 -190
  343. package/vendor/ramsey/uuid/src/Provider/NodeProviderInterface.php +0 -30
  344. package/vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php +0 -57
  345. package/vendor/ramsey/uuid/src/Provider/Time/SystemTimeProvider.php +0 -33
  346. package/vendor/ramsey/uuid/src/Provider/TimeProviderInterface.php +0 -28
  347. package/vendor/ramsey/uuid/src/Rfc4122/Fields.php +0 -214
  348. package/vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php +0 -129
  349. package/vendor/ramsey/uuid/src/Rfc4122/MaxTrait.php +0 -41
  350. package/vendor/ramsey/uuid/src/Rfc4122/MaxUuid.php +0 -27
  351. package/vendor/ramsey/uuid/src/Rfc4122/NilTrait.php +0 -41
  352. package/vendor/ramsey/uuid/src/Rfc4122/NilUuid.php +0 -27
  353. package/vendor/ramsey/uuid/src/Rfc4122/TimeTrait.php +0 -55
  354. package/vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php +0 -116
  355. package/vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php +0 -30
  356. package/vendor/ramsey/uuid/src/Rfc4122/UuidV1.php +0 -61
  357. package/vendor/ramsey/uuid/src/Rfc4122/UuidV2.php +0 -119
  358. package/vendor/ramsey/uuid/src/Rfc4122/UuidV3.php +0 -58
  359. package/vendor/ramsey/uuid/src/Rfc4122/UuidV4.php +0 -58
  360. package/vendor/ramsey/uuid/src/Rfc4122/UuidV5.php +0 -58
  361. package/vendor/ramsey/uuid/src/Rfc4122/UuidV6.php +0 -30
  362. package/vendor/ramsey/uuid/src/Rfc4122/UuidV7.php +0 -63
  363. package/vendor/ramsey/uuid/src/Rfc4122/UuidV8.php +0 -65
  364. package/vendor/ramsey/uuid/src/Rfc4122/Validator.php +0 -45
  365. package/vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php +0 -87
  366. package/vendor/ramsey/uuid/src/Rfc4122/Version.php +0 -139
  367. package/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php +0 -57
  368. package/vendor/ramsey/uuid/src/TimeBasedUuidFactoryInterface.php +0 -48
  369. package/vendor/ramsey/uuid/src/TimeBasedUuidInterface.php +0 -30
  370. package/vendor/ramsey/uuid/src/Type/Decimal.php +0 -135
  371. package/vendor/ramsey/uuid/src/Type/Hexadecimal.php +0 -109
  372. package/vendor/ramsey/uuid/src/Type/Integer.php +0 -145
  373. package/vendor/ramsey/uuid/src/Type/NumberInterface.php +0 -28
  374. package/vendor/ramsey/uuid/src/Type/Time.php +0 -108
  375. package/vendor/ramsey/uuid/src/Type/TypeInterface.php +0 -45
  376. package/vendor/ramsey/uuid/src/Uuid.php +0 -645
  377. package/vendor/ramsey/uuid/src/UuidFactory.php +0 -503
  378. package/vendor/ramsey/uuid/src/UuidFactoryInterface.php +0 -184
  379. package/vendor/ramsey/uuid/src/UuidInterface.php +0 -114
  380. package/vendor/ramsey/uuid/src/Validator/GenericValidator.php +0 -45
  381. package/vendor/ramsey/uuid/src/Validator/ValidatorInterface.php +0 -39
  382. package/vendor/ramsey/uuid/src/Variant.php +0 -60
  383. package/vendor/ramsey/uuid/src/functions.php +0 -160
  384. package/vendor/ramsey/uuid/tests/BinaryUtilsTest.php +0 -381
  385. package/vendor/ramsey/uuid/tests/Builder/FallbackBuilderTest.php +0 -198
  386. package/vendor/ramsey/uuid/tests/Codec/GuidStringCodecTest.php +0 -118
  387. package/vendor/ramsey/uuid/tests/Codec/OrderedTimeCodecTest.php +0 -258
  388. package/vendor/ramsey/uuid/tests/Codec/StringCodecTest.php +0 -149
  389. package/vendor/ramsey/uuid/tests/Converter/Number/GenericNumberConverterTest.php +0 -28
  390. package/vendor/ramsey/uuid/tests/Converter/Time/GenericTimeConverterTest.php +0 -147
  391. package/vendor/ramsey/uuid/tests/Converter/Time/PhpTimeConverterTest.php +0 -199
  392. package/vendor/ramsey/uuid/tests/Converter/Time/UnixTimeConverterTest.php +0 -202
  393. package/vendor/ramsey/uuid/tests/Encoder/TimestampFirstCombCodecTest.php +0 -105
  394. package/vendor/ramsey/uuid/tests/Encoder/TimestampLastCombCodecTest.php +0 -106
  395. package/vendor/ramsey/uuid/tests/ExpectedBehaviorTest.php +0 -573
  396. package/vendor/ramsey/uuid/tests/FeatureSetTest.php +0 -88
  397. package/vendor/ramsey/uuid/tests/FunctionsTest.php +0 -151
  398. package/vendor/ramsey/uuid/tests/Generator/CombGeneratorTest.php +0 -134
  399. package/vendor/ramsey/uuid/tests/Generator/DceSecurityGeneratorTest.php +0 -282
  400. package/vendor/ramsey/uuid/tests/Generator/DefaultNameGeneratorTest.php +0 -83
  401. package/vendor/ramsey/uuid/tests/Generator/DefaultTimeGeneratorTest.php +0 -202
  402. package/vendor/ramsey/uuid/tests/Generator/NameGeneratorFactoryTest.php +0 -19
  403. package/vendor/ramsey/uuid/tests/Generator/PeclUuidNameGeneratorTest.php +0 -107
  404. package/vendor/ramsey/uuid/tests/Generator/PeclUuidRandomGeneratorTest.php +0 -30
  405. package/vendor/ramsey/uuid/tests/Generator/PeclUuidTimeGeneratorTest.php +0 -30
  406. package/vendor/ramsey/uuid/tests/Generator/RandomBytesGeneratorTest.php +0 -70
  407. package/vendor/ramsey/uuid/tests/Generator/RandomGeneratorFactoryTest.php +0 -19
  408. package/vendor/ramsey/uuid/tests/Generator/TimeGeneratorFactoryTest.php +0 -33
  409. package/vendor/ramsey/uuid/tests/Generator/UnixTimeGeneratorTest.php +0 -204
  410. package/vendor/ramsey/uuid/tests/Guid/FieldsTest.php +0 -235
  411. package/vendor/ramsey/uuid/tests/Guid/GuidBuilderTest.php +0 -33
  412. package/vendor/ramsey/uuid/tests/Math/BrickMathCalculatorTest.php +0 -116
  413. package/vendor/ramsey/uuid/tests/Nonstandard/FieldsTest.php +0 -84
  414. package/vendor/ramsey/uuid/tests/Nonstandard/UuidBuilderTest.php +0 -33
  415. package/vendor/ramsey/uuid/tests/Nonstandard/UuidV6Test.php +0 -192
  416. package/vendor/ramsey/uuid/tests/Provider/Dce/SystemDceSecurityProviderTest.php +0 -505
  417. package/vendor/ramsey/uuid/tests/Provider/Node/FallbackNodeProviderTest.php +0 -87
  418. package/vendor/ramsey/uuid/tests/Provider/Node/RandomNodeProviderTest.php +0 -124
  419. package/vendor/ramsey/uuid/tests/Provider/Node/StaticNodeProviderTest.php +0 -58
  420. package/vendor/ramsey/uuid/tests/Provider/Node/SystemNodeProviderTest.php +0 -950
  421. package/vendor/ramsey/uuid/tests/Provider/Time/FixedTimeProviderTest.php +0 -41
  422. package/vendor/ramsey/uuid/tests/Provider/Time/SystemTimeProviderTest.php +0 -20
  423. package/vendor/ramsey/uuid/tests/Rfc4122/FieldsTest.php +0 -260
  424. package/vendor/ramsey/uuid/tests/Rfc4122/UuidBuilderTest.php +0 -145
  425. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV1Test.php +0 -123
  426. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV2Test.php +0 -214
  427. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV3Test.php +0 -56
  428. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV4Test.php +0 -56
  429. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV5Test.php +0 -56
  430. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV6Test.php +0 -221
  431. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV7Test.php +0 -131
  432. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV8Test.php +0 -56
  433. package/vendor/ramsey/uuid/tests/Rfc4122/ValidatorTest.php +0 -122
  434. package/vendor/ramsey/uuid/tests/Rfc4122/VariantTraitTest.php +0 -109
  435. package/vendor/ramsey/uuid/tests/TestCase.php +0 -29
  436. package/vendor/ramsey/uuid/tests/Type/DecimalTest.php +0 -305
  437. package/vendor/ramsey/uuid/tests/Type/HexadecimalTest.php +0 -112
  438. package/vendor/ramsey/uuid/tests/Type/IntegerTest.php +0 -235
  439. package/vendor/ramsey/uuid/tests/Type/TimeTest.php +0 -120
  440. package/vendor/ramsey/uuid/tests/UuidFactoryTest.php +0 -233
  441. package/vendor/ramsey/uuid/tests/UuidTest.php +0 -1910
  442. package/vendor/ramsey/uuid/tests/Validator/GenericValidatorTest.php +0 -98
  443. package/vendor/ramsey/uuid/tests/benchmark/GuidConversionBench.php +0 -43
  444. package/vendor/ramsey/uuid/tests/benchmark/NonLazyUuidConversionBench.php +0 -39
  445. package/vendor/ramsey/uuid/tests/benchmark/UuidFieldExtractionBench.php +0 -86
  446. package/vendor/ramsey/uuid/tests/benchmark/UuidGenerationBench.php +0 -113
  447. package/vendor/ramsey/uuid/tests/benchmark/UuidSerializationBench.php +0 -206
  448. package/vendor/ramsey/uuid/tests/benchmark/UuidStringConversionBench.php +0 -257
  449. package/vendor/ramsey/uuid/tests/bootstrap.php +0 -12
  450. package/vendor/ramsey/uuid/tests/static-analysis/UuidIsImmutable.php +0 -96
  451. package/vendor/ramsey/uuid/tests/static-analysis/UuidIsNeverEmpty.php +0 -36
  452. package/vendor/ramsey/uuid/tests/static-analysis/ValidUuidIsNonEmpty.php +0 -44
  453. package/vendor/ramsey/uuid/tests/static-analysis/stubs.php +0 -33
  454. package/vendor/symfony/polyfill-ctype/Ctype.php +0 -232
  455. package/vendor/symfony/polyfill-ctype/LICENSE +0 -19
  456. package/vendor/symfony/polyfill-ctype/README.md +0 -12
  457. package/vendor/symfony/polyfill-ctype/bootstrap.php +0 -50
  458. package/vendor/symfony/polyfill-ctype/bootstrap80.php +0 -46
  459. package/vendor/symfony/polyfill-ctype/composer.json +0 -41
  460. package/vendor/symfony/polyfill-mbstring/LICENSE +0 -19
  461. package/vendor/symfony/polyfill-mbstring/Mbstring.php +0 -947
  462. package/vendor/symfony/polyfill-mbstring/README.md +0 -13
  463. package/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +0 -119
  464. package/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +0 -1397
  465. package/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +0 -5
  466. package/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +0 -1489
  467. package/vendor/symfony/polyfill-mbstring/bootstrap.php +0 -151
  468. package/vendor/symfony/polyfill-mbstring/bootstrap80.php +0 -147
  469. package/vendor/symfony/polyfill-mbstring/composer.json +0 -41
  470. package/vendor/symfony/polyfill-php80/LICENSE +0 -19
  471. package/vendor/symfony/polyfill-php80/Php80.php +0 -115
  472. package/vendor/symfony/polyfill-php80/PhpToken.php +0 -103
  473. package/vendor/symfony/polyfill-php80/README.md +0 -25
  474. package/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +0 -31
  475. package/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +0 -16
  476. package/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +0 -20
  477. package/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +0 -16
  478. package/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +0 -16
  479. package/vendor/symfony/polyfill-php80/bootstrap.php +0 -42
  480. package/vendor/symfony/polyfill-php80/composer.json +0 -40
  481. package/vendor/vlucas/phpdotenv/.editorconfig +0 -15
  482. package/vendor/vlucas/phpdotenv/.gitattributes +0 -17
  483. package/vendor/vlucas/phpdotenv/.github/CODE_OF_CONDUCT.md +0 -132
  484. package/vendor/vlucas/phpdotenv/.github/CONTRIBUTING.md +0 -30
  485. package/vendor/vlucas/phpdotenv/.github/FUNDING.yml +0 -2
  486. package/vendor/vlucas/phpdotenv/.github/SECURITY.md +0 -14
  487. package/vendor/vlucas/phpdotenv/.github/workflows/static.yml +0 -74
  488. package/vendor/vlucas/phpdotenv/.github/workflows/tests.yml +0 -70
  489. package/vendor/vlucas/phpdotenv/LICENSE +0 -30
  490. package/vendor/vlucas/phpdotenv/Makefile +0 -26
  491. package/vendor/vlucas/phpdotenv/README.md +0 -363
  492. package/vendor/vlucas/phpdotenv/UPGRADING.md +0 -196
  493. package/vendor/vlucas/phpdotenv/composer.json +0 -60
  494. package/vendor/vlucas/phpdotenv/phpstan-baseline.neon +0 -21
  495. package/vendor/vlucas/phpdotenv/phpstan.neon.dist +0 -7
  496. package/vendor/vlucas/phpdotenv/phpunit.xml.dist +0 -13
  497. package/vendor/vlucas/phpdotenv/psalm-baseline.xml +0 -28
  498. package/vendor/vlucas/phpdotenv/psalm.xml +0 -13
  499. package/vendor/vlucas/phpdotenv/src/Dotenv.php +0 -267
  500. package/vendor/vlucas/phpdotenv/src/Exception/ExceptionInterface.php +0 -12
  501. package/vendor/vlucas/phpdotenv/src/Exception/InvalidEncodingException.php +0 -12
  502. package/vendor/vlucas/phpdotenv/src/Exception/InvalidFileException.php +0 -12
  503. package/vendor/vlucas/phpdotenv/src/Exception/InvalidPathException.php +0 -12
  504. package/vendor/vlucas/phpdotenv/src/Exception/ValidationException.php +0 -12
  505. package/vendor/vlucas/phpdotenv/src/Loader/Loader.php +0 -47
  506. package/vendor/vlucas/phpdotenv/src/Loader/LoaderInterface.php +0 -20
  507. package/vendor/vlucas/phpdotenv/src/Loader/Resolver.php +0 -65
  508. package/vendor/vlucas/phpdotenv/src/Parser/Entry.php +0 -59
  509. package/vendor/vlucas/phpdotenv/src/Parser/EntryParser.php +0 -300
  510. package/vendor/vlucas/phpdotenv/src/Parser/Lexer.php +0 -58
  511. package/vendor/vlucas/phpdotenv/src/Parser/Lines.php +0 -127
  512. package/vendor/vlucas/phpdotenv/src/Parser/Parser.php +0 -53
  513. package/vendor/vlucas/phpdotenv/src/Parser/ParserInterface.php +0 -19
  514. package/vendor/vlucas/phpdotenv/src/Parser/Value.php +0 -88
  515. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php +0 -15
  516. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/ApacheAdapter.php +0 -89
  517. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/ArrayAdapter.php +0 -80
  518. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/EnvConstAdapter.php +0 -89
  519. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/GuardedWriter.php +0 -85
  520. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/ImmutableWriter.php +0 -110
  521. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php +0 -48
  522. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiWriter.php +0 -64
  523. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/PutenvAdapter.php +0 -91
  524. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReaderInterface.php +0 -17
  525. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReplacingWriter.php +0 -104
  526. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php +0 -89
  527. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/WriterInterface.php +0 -27
  528. package/vendor/vlucas/phpdotenv/src/Repository/AdapterRepository.php +0 -107
  529. package/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php +0 -272
  530. package/vendor/vlucas/phpdotenv/src/Repository/RepositoryInterface.php +0 -51
  531. package/vendor/vlucas/phpdotenv/src/Store/File/Paths.php +0 -44
  532. package/vendor/vlucas/phpdotenv/src/Store/File/Reader.php +0 -81
  533. package/vendor/vlucas/phpdotenv/src/Store/FileStore.php +0 -72
  534. package/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php +0 -141
  535. package/vendor/vlucas/phpdotenv/src/Store/StoreInterface.php +0 -17
  536. package/vendor/vlucas/phpdotenv/src/Store/StringStore.php +0 -37
  537. package/vendor/vlucas/phpdotenv/src/Util/Regex.php +0 -112
  538. package/vendor/vlucas/phpdotenv/src/Util/Str.php +0 -98
  539. package/vendor/vlucas/phpdotenv/src/Validator.php +0 -209
  540. package/vendor/vlucas/phpdotenv/tests/Dotenv/DotenvTest.php +0 -387
  541. package/vendor/vlucas/phpdotenv/tests/Dotenv/Loader/LoaderTest.php +0 -86
  542. package/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/EntryParserTest.php +0 -234
  543. package/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LexerTest.php +0 -40
  544. package/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LinesTest.php +0 -53
  545. package/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/ParserTest.php +0 -98
  546. package/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ArrayAdapterTest.php +0 -57
  547. package/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/EnvConstAdapterTest.php +0 -75
  548. package/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/PutenvAdapterTest.php +0 -52
  549. package/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ServerConstAdapterTest.php +0 -75
  550. package/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/RepositoryTest.php +0 -305
  551. package/vendor/vlucas/phpdotenv/tests/Dotenv/Store/StoreTest.php +0 -141
  552. package/vendor/vlucas/phpdotenv/tests/Dotenv/ValidatorTest.php +0 -479
  553. package/vendor/vlucas/phpdotenv/tests/fixtures/env/.env +0 -5
  554. package/vendor/vlucas/phpdotenv/tests/fixtures/env/assertions.env +0 -18
  555. package/vendor/vlucas/phpdotenv/tests/fixtures/env/booleans.env +0 -33
  556. package/vendor/vlucas/phpdotenv/tests/fixtures/env/commented.env +0 -15
  557. package/vendor/vlucas/phpdotenv/tests/fixtures/env/empty.env +0 -1
  558. package/vendor/vlucas/phpdotenv/tests/fixtures/env/example.env +0 -1
  559. package/vendor/vlucas/phpdotenv/tests/fixtures/env/exported.env +0 -7
  560. package/vendor/vlucas/phpdotenv/tests/fixtures/env/immutable.env +0 -1
  561. package/vendor/vlucas/phpdotenv/tests/fixtures/env/integers.env +0 -17
  562. package/vendor/vlucas/phpdotenv/tests/fixtures/env/large.env +0 -2
  563. package/vendor/vlucas/phpdotenv/tests/fixtures/env/multibyte.env +0 -3
  564. package/vendor/vlucas/phpdotenv/tests/fixtures/env/multiline.env +0 -14
  565. package/vendor/vlucas/phpdotenv/tests/fixtures/env/multiple.env +0 -4
  566. package/vendor/vlucas/phpdotenv/tests/fixtures/env/mutable.env +0 -1
  567. package/vendor/vlucas/phpdotenv/tests/fixtures/env/nested.env +0 -15
  568. package/vendor/vlucas/phpdotenv/tests/fixtures/env/quoted.env +0 -11
  569. package/vendor/vlucas/phpdotenv/tests/fixtures/env/specialchars.env +0 -8
  570. package/vendor/vlucas/phpdotenv/tests/fixtures/env/unicodevarnames.env +0 -2
  571. package/vendor/vlucas/phpdotenv/tests/fixtures/env/utf8-with-bom-encoding.env +0 -3
  572. package/vendor/vlucas/phpdotenv/tests/fixtures/env/windows.env +0 -1
  573. package/vendor/vlucas/phpdotenv/vendor-bin/phpstan/composer.json +0 -16
  574. package/vendor/vlucas/phpdotenv/vendor-bin/psalm/composer.json +0 -9
@@ -1,1910 +0,0 @@
1
- <?php
2
-
3
- declare(strict_types=1);
4
-
5
- namespace Ramsey\Uuid\Test;
6
-
7
- use BadMethodCallException;
8
- use Brick\Math\BigDecimal;
9
- use Brick\Math\RoundingMode;
10
- use DateTimeImmutable;
11
- use DateTimeInterface;
12
- use Mockery;
13
- use Mockery\MockInterface;
14
- use PHPUnit\Framework\MockObject\MockObject;
15
- use Ramsey\Uuid\Codec\StringCodec;
16
- use Ramsey\Uuid\Codec\TimestampFirstCombCodec;
17
- use Ramsey\Uuid\Codec\TimestampLastCombCodec;
18
- use Ramsey\Uuid\Converter\Number\GenericNumberConverter;
19
- use Ramsey\Uuid\Converter\TimeConverterInterface;
20
- use Ramsey\Uuid\Exception\DateTimeException;
21
- use Ramsey\Uuid\Exception\InvalidArgumentException;
22
- use Ramsey\Uuid\Exception\InvalidUuidStringException;
23
- use Ramsey\Uuid\Exception\UnsupportedOperationException;
24
- use Ramsey\Uuid\FeatureSet;
25
- use Ramsey\Uuid\Generator\CombGenerator;
26
- use Ramsey\Uuid\Generator\RandomGeneratorFactory;
27
- use Ramsey\Uuid\Generator\RandomGeneratorInterface;
28
- use Ramsey\Uuid\Guid\Guid;
29
- use Ramsey\Uuid\Lazy\LazyUuidFromString;
30
- use Ramsey\Uuid\Math\BrickMathCalculator;
31
- use Ramsey\Uuid\Nonstandard\UuidV6;
32
- use Ramsey\Uuid\Provider\Node\RandomNodeProvider;
33
- use Ramsey\Uuid\Provider\Time\FixedTimeProvider;
34
- use Ramsey\Uuid\Rfc4122\Fields;
35
- use Ramsey\Uuid\Rfc4122\FieldsInterface;
36
- use Ramsey\Uuid\Rfc4122\UuidBuilder;
37
- use Ramsey\Uuid\Rfc4122\UuidV1;
38
- use Ramsey\Uuid\Rfc4122\UuidV7;
39
- use Ramsey\Uuid\Rfc4122\UuidV8;
40
- use Ramsey\Uuid\Rfc4122\Version;
41
- use Ramsey\Uuid\Type\Hexadecimal;
42
- use Ramsey\Uuid\Type\Time;
43
- use Ramsey\Uuid\Uuid;
44
- use Ramsey\Uuid\UuidFactory;
45
- use Ramsey\Uuid\UuidFactoryInterface;
46
- use Ramsey\Uuid\UuidInterface;
47
- use Ramsey\Uuid\Validator\GenericValidator;
48
- use Ramsey\Uuid\Validator\ValidatorInterface;
49
- use Ramsey\Uuid\Variant;
50
- use Stringable;
51
- use stdClass;
52
-
53
- use function base64_decode;
54
- use function base64_encode;
55
- use function gmdate;
56
- use function hex2bin;
57
- use function json_encode;
58
- use function serialize;
59
- use function str_pad;
60
- use function strlen;
61
- use function strtotime;
62
- use function strtoupper;
63
- use function substr;
64
- use function uniqid;
65
- use function unserialize;
66
- use function usleep;
67
-
68
- class UuidTest extends TestCase
69
- {
70
- protected function setUp(): void
71
- {
72
- Uuid::setFactory(new UuidFactory());
73
- }
74
-
75
- public function testFromString(): void
76
- {
77
- $this->assertSame(
78
- 'ff6f8cb0-c57d-11e1-9b21-0800200c9a66',
79
- Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66')
80
- ->toString()
81
- );
82
- }
83
-
84
- public function testFromHexadecimal(): void
85
- {
86
- $hex = new Hexadecimal('0x1EA78DEB37CE625E8F1A025041000001');
87
- $uuid = Uuid::fromHexadecimal($hex);
88
- $this->assertInstanceOf(Uuid::class, $uuid);
89
- $this->assertEquals('1ea78deb-37ce-625e-8f1a-025041000001', $uuid->toString());
90
- }
91
-
92
- public function testFromHexadecimalShort(): void
93
- {
94
- $hex = new Hexadecimal('0x1EA78DEB37CE625E8F1A0250410000');
95
-
96
- $this->expectException(InvalidUuidStringException::class);
97
- $this->expectExceptionMessage('Invalid UUID string:');
98
-
99
- Uuid::fromHexadecimal($hex);
100
- }
101
-
102
- public function testFromHexadecimalThrowsWhenMethodDoesNotExist(): void
103
- {
104
- $factory = Mockery::mock(UuidFactoryInterface::class);
105
- Uuid::setFactory($factory);
106
-
107
- $hex = new Hexadecimal('0x1EA78DEB37CE625E8F1A025041000001');
108
-
109
- $this->expectException(BadMethodCallException::class);
110
- $this->expectExceptionMessage('The method fromHexadecimal() does not exist on the provided factory');
111
-
112
- Uuid::fromHexadecimal($hex);
113
- }
114
-
115
- /**
116
- * Tests that UUID and GUID's have the same textual representation but not
117
- * the same binary representation.
118
- */
119
- public function testFromGuidString(): void
120
- {
121
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
122
-
123
- Uuid::setFactory(new UuidFactory(new FeatureSet(true)));
124
-
125
- $guid = Guid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
126
-
127
- // UUID's and GUID's share the same textual representation.
128
- $this->assertSame($uuid->toString(), $guid->toString());
129
-
130
- // But not the same binary representation.
131
- $this->assertNotSame($uuid->getBytes(), $guid->getBytes());
132
- }
133
-
134
- public function testFromStringWithCurlyBraces(): void
135
- {
136
- $uuid = Uuid::fromString('{ff6f8cb0-c57d-11e1-9b21-0800200c9a66}');
137
- $this->assertSame('ff6f8cb0-c57d-11e1-9b21-0800200c9a66', $uuid->toString());
138
- }
139
-
140
- public function testFromStringWithInvalidUuidString(): void
141
- {
142
- $this->expectException(InvalidUuidStringException::class);
143
- $this->expectExceptionMessage('Invalid UUID string:');
144
-
145
- Uuid::fromString('ff6f8cb0-c57d-11e1-9b21');
146
- }
147
-
148
- public function testFromStringWithLeadingNewLine(): void
149
- {
150
- $this->expectException(InvalidUuidStringException::class);
151
- $this->expectExceptionMessage('Invalid UUID string:');
152
-
153
- Uuid::fromString("\nd0d5f586-21d1-470c-8088-55c8857728dc");
154
- }
155
-
156
- public function testFromStringWithTrailingNewLine(): void
157
- {
158
- $this->expectException(InvalidUuidStringException::class);
159
- $this->expectExceptionMessage('Invalid UUID string:');
160
-
161
- Uuid::fromString("d0d5f586-21d1-470c-8088-55c8857728dc\n");
162
- }
163
-
164
- public function testFromStringWithUrn(): void
165
- {
166
- $uuid = Uuid::fromString('urn:uuid:ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
167
- $this->assertSame('ff6f8cb0-c57d-11e1-9b21-0800200c9a66', $uuid->toString());
168
- }
169
-
170
- public function testFromStringWithEmptyString(): void
171
- {
172
- $this->expectException(InvalidUuidStringException::class);
173
- $this->expectExceptionMessage('Invalid UUID string: ');
174
-
175
- /** @phpstan-ignore-next-line */
176
- Uuid::fromString('');
177
- }
178
-
179
- public function testFromStringUppercase(): void
180
- {
181
- $uuid = Uuid::fromString('FF6F8CB0-C57D-11E1-9B21-0800200C9A66');
182
- $this->assertSame('ff6f8cb0-c57d-11e1-9b21-0800200c9a66', $uuid->toString());
183
- }
184
-
185
- public function testFromStringLazyUuidFromUppercase(): void
186
- {
187
- $this->assertInstanceOf(LazyUuidFromString::class, Uuid::fromString('FF6F8CB0-C57D-11E1-9B21-0800200C9A66'));
188
- }
189
-
190
- public function testFromStringWithNilUuid(): void
191
- {
192
- $uuid = Uuid::fromString(Uuid::NIL);
193
-
194
- /** @var Fields $fields */
195
- $fields = $uuid->getFields();
196
-
197
- $this->assertSame('00000000-0000-0000-0000-000000000000', $uuid->toString());
198
- $this->assertTrue($fields->isNil());
199
- $this->assertFalse($fields->isMax());
200
- }
201
-
202
- public function testFromStringWithMaxUuid(): void
203
- {
204
- $uuid = Uuid::fromString(Uuid::MAX);
205
-
206
- /** @var Fields $fields */
207
- $fields = $uuid->getFields();
208
-
209
- $this->assertSame('ffffffff-ffff-ffff-ffff-ffffffffffff', $uuid->toString());
210
- $this->assertFalse($fields->isNil());
211
- $this->assertTrue($fields->isMax());
212
- }
213
-
214
- public function testGetBytes(): void
215
- {
216
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
217
- $this->assertSame(16, strlen($uuid->getBytes()));
218
- $this->assertSame('/2+MsMV9EeGbIQgAIAyaZg==', base64_encode($uuid->getBytes()));
219
- }
220
-
221
- public function testGetClockSeqHiAndReservedHex(): void
222
- {
223
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
224
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
225
- $this->assertSame('9b', $uuid->getFields()->getClockSeqHiAndReserved()->toString());
226
- }
227
-
228
- public function testGetClockSeqLowHex(): void
229
- {
230
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
231
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
232
- $this->assertSame('21', $uuid->getFields()->getClockSeqLow()->toString());
233
- }
234
-
235
- public function testGetClockSequenceHex(): void
236
- {
237
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
238
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
239
- $this->assertSame('1b21', $uuid->getFields()->getClockSeq()->toString());
240
- }
241
-
242
- public function testGetDateTime(): void
243
- {
244
- // Check a recent date
245
- /** @var UuidV1 $uuid */
246
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
247
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
248
- $this->assertSame('2012-07-04T02:14:34+00:00', $uuid->getDateTime()->format('c'));
249
- $this->assertSame('1341368074.491000', $uuid->getDateTime()->format('U.u'));
250
-
251
- // Check an old date
252
- /** @var UuidV1 $uuid */
253
- $uuid = Uuid::fromString('0901e600-0154-1000-9b21-0800200c9a66');
254
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
255
- $this->assertSame('1582-10-16T16:34:04+00:00', $uuid->getDateTime()->format('c'));
256
- $this->assertSame('-12219146756.000000', $uuid->getDateTime()->format('U.u'));
257
-
258
- // Check a future date
259
- /** @var UuidV1 $uuid */
260
- $uuid = Uuid::fromString('ff9785f6-ffff-1fff-9669-00007ffffffe');
261
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
262
- $this->assertSame('5236-03-31T21:20:59+00:00', $uuid->getDateTime()->format('c'));
263
- $this->assertSame('103072857659.999999', $uuid->getDateTime()->format('U.u'));
264
-
265
- // Check the last possible time supported by v1 UUIDs
266
- // See inline comments in
267
- // {@see \Ramsey\Uuid\Test\Converter\Time\GenericTimeConverterTest::provideCalculateTime()}
268
- /** @var UuidV1 $uuid */
269
- $uuid = Uuid::fromString('fffffffa-ffff-1fff-8b1e-acde48001122');
270
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
271
- $this->assertSame('5236-03-31T21:21:00+00:00', $uuid->getDateTime()->format('c'));
272
- $this->assertSame('103072857660.684697', $uuid->getDateTime()->format('U.u'));
273
-
274
- // Check the oldest date
275
- /** @var UuidV1 $uuid */
276
- $uuid = Uuid::fromString('00000000-0000-1000-9669-00007ffffffe');
277
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
278
- $this->assertSame('1582-10-15T00:00:00+00:00', $uuid->getDateTime()->format('c'));
279
- $this->assertSame('-12219292800.000000', $uuid->getDateTime()->format('U.u'));
280
-
281
- // The Unix epoch
282
- /** @var UuidV1 $uuid */
283
- $uuid = Uuid::fromString('13814000-1dd2-11b2-9669-00007ffffffe');
284
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
285
- $this->assertSame('1970-01-01T00:00:00+00:00', $uuid->getDateTime()->format('c'));
286
- $this->assertSame('0.000000', $uuid->getDateTime()->format('U.u'));
287
- }
288
-
289
- public function testGetDateTimeForUuidV6(): void
290
- {
291
- // Check a recent date
292
- /** @var UuidV6 $uuid */
293
- $uuid = Uuid::fromString('1e1c57df-f6f8-6cb0-9b21-0800200c9a66');
294
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
295
- $this->assertSame('2012-07-04T02:14:34+00:00', $uuid->getDateTime()->format('c'));
296
- $this->assertSame('1341368074.491000', $uuid->getDateTime()->format('U.u'));
297
-
298
- // Check an old date
299
- /** @var UuidV6 $uuid */
300
- $uuid = Uuid::fromString('00001540-901e-6600-9b21-0800200c9a66');
301
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
302
- $this->assertSame('1582-10-16T16:34:04+00:00', $uuid->getDateTime()->format('c'));
303
- $this->assertSame('-12219146756.000000', $uuid->getDateTime()->format('U.u'));
304
-
305
- // Check a future date
306
- /** @var UuidV6 $uuid */
307
- $uuid = Uuid::fromString('ffffffff-f978-65f6-9669-00007ffffffe');
308
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
309
- $this->assertSame('5236-03-31T21:20:59+00:00', $uuid->getDateTime()->format('c'));
310
- $this->assertSame('103072857659.999999', $uuid->getDateTime()->format('U.u'));
311
-
312
- // Check the last possible time supported by UUIDs
313
- // See inline comments in
314
- // {@see \Ramsey\Uuid\Test\Converter\Time\GenericTimeConverterTest::provideCalculateTime()}
315
- /** @var UuidV6 $uuid */
316
- $uuid = Uuid::fromString('ffffffff-ffff-6ffa-8b1e-acde48001122');
317
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
318
- $this->assertSame('5236-03-31T21:21:00+00:00', $uuid->getDateTime()->format('c'));
319
- $this->assertSame('103072857660.684697', $uuid->getDateTime()->format('U.u'));
320
-
321
- // Check the oldest date
322
- /** @var UuidV6 $uuid */
323
- $uuid = Uuid::fromString('00000000-0000-6000-9669-00007ffffffe');
324
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
325
- $this->assertSame('1582-10-15T00:00:00+00:00', $uuid->getDateTime()->format('c'));
326
- $this->assertSame('-12219292800.000000', $uuid->getDateTime()->format('U.u'));
327
-
328
- // The Unix epoch
329
- /** @var UuidV6 $uuid */
330
- $uuid = Uuid::fromString('1b21dd21-3814-6000-9669-00007ffffffe');
331
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
332
- $this->assertSame('1970-01-01T00:00:00+00:00', $uuid->getDateTime()->format('c'));
333
- $this->assertSame('0.000000', $uuid->getDateTime()->format('U.u'));
334
- }
335
-
336
- public function testGetDateTimeFromNonVersion1Uuid(): void
337
- {
338
- // Using a version 4 UUID to test
339
- $uuid = Uuid::fromString('bf17b594-41f2-474f-bf70-4c90220f75de');
340
-
341
- $this->assertInstanceOf(LazyUuidFromString::class, $uuid);
342
-
343
- $this->expectException(UnsupportedOperationException::class);
344
- $this->expectExceptionMessage('Not a time-based UUID');
345
-
346
- $uuid->getDateTime();
347
- }
348
-
349
- public function testGetFields(): void
350
- {
351
- /** @var Uuid $uuid */
352
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
353
-
354
- $this->assertInstanceOf(FieldsInterface::class, $uuid->getFields());
355
- }
356
-
357
- public function testGetNodeHex(): void
358
- {
359
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
360
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
361
- $this->assertSame('0800200c9a66', $uuid->getFields()->getNode()->toString());
362
- }
363
-
364
- public function testGetTimeHiAndVersionHex(): void
365
- {
366
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
367
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
368
- $this->assertSame('11e1', $uuid->getFields()->getTimeHiAndVersion()->toString());
369
- }
370
-
371
- public function testGetTimeLowHex(): void
372
- {
373
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
374
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
375
- $this->assertSame('ff6f8cb0', $uuid->getFields()->getTimeLow()->toString());
376
- }
377
-
378
- public function testGetTimeMidHex(): void
379
- {
380
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
381
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
382
- $this->assertSame('c57d', $uuid->getFields()->getTimeMid()->toString());
383
- }
384
-
385
- public function testGetTimestampHex(): void
386
- {
387
- // Check for a recent date
388
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
389
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
390
- $this->assertSame('1e1c57dff6f8cb0', $uuid->getFields()->getTimestamp()->toString());
391
-
392
- // Check for an old date
393
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
394
- $uuid = Uuid::fromString('0901e600-0154-1000-9b21-0800200c9a66');
395
- $this->assertSame('00001540901e600', $uuid->getFields()->getTimestamp()->toString());
396
- }
397
-
398
- public function testGetTimestampHexFromNonVersion1Uuid(): void
399
- {
400
- // Using a version 4 UUID to test
401
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
402
- $uuid = Uuid::fromString('bf17b594-41f2-474f-bf70-4c90220f75de');
403
-
404
- // This threw an exception in versions of ramsey/uuid earlier than 5.0.0.
405
- // The test is here now to ensure we don't throw an exception.
406
- $this->assertSame('74f41f2bf17b594', $uuid->getFields()->getTimestamp()->toString());
407
- }
408
-
409
- public function testGetUrn(): void
410
- {
411
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
412
- $this->assertSame('urn:uuid:ff6f8cb0-c57d-11e1-9b21-0800200c9a66', $uuid->getUrn());
413
- }
414
-
415
- /**
416
- * @param non-empty-string $uuid
417
- *
418
- * @dataProvider provideVariousVariantUuids
419
- */
420
- public function testGetVariantForVariousVariantUuids(string $uuid, Variant $variant): void
421
- {
422
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuidInstance */
423
- $uuidInstance = Uuid::fromString($uuid);
424
- $this->assertSame($variant, $uuidInstance->getFields()->getVariant());
425
- }
426
-
427
- /**
428
- * @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification
429
- */
430
- public function provideVariousVariantUuids(): array
431
- {
432
- return [
433
- ['ff6f8cb0-c57d-11e1-0b21-0800200c9a66', Variant::ReservedNcs],
434
- ['ff6f8cb0-c57d-11e1-1b21-0800200c9a66', Variant::ReservedNcs],
435
- ['ff6f8cb0-c57d-11e1-2b21-0800200c9a66', Variant::ReservedNcs],
436
- ['ff6f8cb0-c57d-11e1-3b21-0800200c9a66', Variant::ReservedNcs],
437
- ['ff6f8cb0-c57d-11e1-4b21-0800200c9a66', Variant::ReservedNcs],
438
- ['ff6f8cb0-c57d-11e1-5b21-0800200c9a66', Variant::ReservedNcs],
439
- ['ff6f8cb0-c57d-11e1-6b21-0800200c9a66', Variant::ReservedNcs],
440
- ['ff6f8cb0-c57d-11e1-7b21-0800200c9a66', Variant::ReservedNcs],
441
- ['ff6f8cb0-c57d-11e1-8b21-0800200c9a66', Variant::Rfc4122],
442
- ['ff6f8cb0-c57d-11e1-9b21-0800200c9a66', Variant::Rfc4122],
443
- ['ff6f8cb0-c57d-11e1-ab21-0800200c9a66', Variant::Rfc4122],
444
- ['ff6f8cb0-c57d-11e1-bb21-0800200c9a66', Variant::Rfc4122],
445
- ['ff6f8cb0-c57d-11e1-cb21-0800200c9a66', Variant::ReservedMicrosoft],
446
- ['ff6f8cb0-c57d-11e1-db21-0800200c9a66', Variant::ReservedMicrosoft],
447
- ['ff6f8cb0-c57d-11e1-eb21-0800200c9a66', Variant::ReservedFuture],
448
- ['ff6f8cb0-c57d-11e1-fb21-0800200c9a66', Variant::ReservedFuture],
449
- ];
450
- }
451
-
452
- public function testGetVersionForVersion1(): void
453
- {
454
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
455
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
456
- $this->assertSame(Version::Time, $uuid->getFields()->getVersion());
457
- }
458
-
459
- public function testGetVersionForVersion2(): void
460
- {
461
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
462
- $uuid = Uuid::fromString('6fa459ea-ee8a-2ca4-894e-db77e160355e');
463
- $this->assertSame(Version::DceSecurity, $uuid->getFields()->getVersion());
464
- }
465
-
466
- public function testGetVersionForVersion3(): void
467
- {
468
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
469
- $uuid = Uuid::fromString('6fa459ea-ee8a-3ca4-894e-db77e160355e');
470
- $this->assertSame(Version::HashMd5, $uuid->getFields()->getVersion());
471
- }
472
-
473
- public function testGetVersionForVersion4(): void
474
- {
475
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
476
- $uuid = Uuid::fromString('6fabf0bc-603a-42f2-925b-d9f779bd0032');
477
- $this->assertSame(Version::Random, $uuid->getFields()->getVersion());
478
- }
479
-
480
- public function testGetVersionForVersion5(): void
481
- {
482
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
483
- $uuid = Uuid::fromString('886313e1-3b8a-5372-9b90-0c9aee199e5d');
484
- $this->assertSame(Version::HashSha1, $uuid->getFields()->getVersion());
485
- }
486
-
487
- public function testToString(): void
488
- {
489
- // Check with a recent date
490
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
491
- $this->assertSame('ff6f8cb0-c57d-11e1-9b21-0800200c9a66', $uuid->toString());
492
- $this->assertSame('ff6f8cb0-c57d-11e1-9b21-0800200c9a66', (string) $uuid);
493
- $this->assertSame(
494
- 'ff6f8cb0-c57d-11e1-9b21-0800200c9a66',
495
- (static fn (Stringable $uuid) => (string) $uuid)($uuid)
496
- );
497
-
498
- // Check with an old date
499
- $uuid = Uuid::fromString('0901e600-0154-1000-9b21-0800200c9a66');
500
- $this->assertSame('0901e600-0154-1000-9b21-0800200c9a66', $uuid->toString());
501
- $this->assertSame('0901e600-0154-1000-9b21-0800200c9a66', (string) $uuid);
502
- $this->assertSame(
503
- '0901e600-0154-1000-9b21-0800200c9a66',
504
- (static fn (Stringable $uuid) => (string) $uuid)($uuid)
505
- );
506
- }
507
-
508
- public function testUuid1(): void
509
- {
510
- /** @var UuidV1 $uuid */
511
- $uuid = Uuid::uuid1();
512
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
513
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
514
- $this->assertSame(Version::Time, $uuid->getFields()->getVersion());
515
- }
516
-
517
- public function testUuid1WithNodeAndClockSequence(): void
518
- {
519
- /** @var UuidV1 $uuid */
520
- $uuid = Uuid::uuid1('0800200c9a66', 0x1669);
521
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
522
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
523
- $this->assertSame(Version::Time, $uuid->getFields()->getVersion());
524
- $this->assertSame('1669', $uuid->getFields()->getClockSeq()->toString());
525
- $this->assertSame('0800200c9a66', $uuid->getFields()->getNode()->toString());
526
- $this->assertSame('9669-0800200c9a66', substr($uuid->toString(), 19));
527
- }
528
-
529
- public function testUuid1WithHexadecimalObjectNodeAndClockSequence(): void
530
- {
531
- /** @var UuidV1 $uuid */
532
- $uuid = Uuid::uuid1(new Hexadecimal('0800200c9a66'), 0x1669);
533
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
534
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
535
- $this->assertSame(Version::Time, $uuid->getFields()->getVersion());
536
- $this->assertSame('1669', $uuid->getFields()->getClockSeq()->toString());
537
- $this->assertSame('0800200c9a66', $uuid->getFields()->getNode()->toString());
538
- $this->assertSame('9669-0800200c9a66', substr($uuid->toString(), 19));
539
- }
540
-
541
- public function testUuid1WithHexadecimalNode(): void
542
- {
543
- /** @var UuidV1 $uuid */
544
- $uuid = Uuid::uuid1('7160355e');
545
-
546
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
547
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
548
- $this->assertSame(Version::Time, $uuid->getFields()->getVersion());
549
- $this->assertSame('00007160355e', $uuid->getFields()->getNode()->toString());
550
- }
551
-
552
- public function testUuid1WithHexadecimalObjectNode(): void
553
- {
554
- /** @var UuidV1 $uuid */
555
- $uuid = Uuid::uuid1(new Hexadecimal('7160355e'));
556
-
557
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
558
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
559
- $this->assertSame(Version::Time, $uuid->getFields()->getVersion());
560
- $this->assertSame('00007160355e', $uuid->getFields()->getNode()->toString());
561
- }
562
-
563
- public function testUuid1WithMixedCaseHexadecimalNode(): void
564
- {
565
- /** @var UuidV1 $uuid */
566
- $uuid = Uuid::uuid1('71B0aD5e');
567
-
568
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
569
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
570
- $this->assertSame(Version::Time, $uuid->getFields()->getVersion());
571
- $this->assertSame('000071b0ad5e', $uuid->getFields()->getNode()->toString());
572
- }
573
-
574
- public function testUuid1WithOutOfBoundsNode(): void
575
- {
576
- $this->expectException(InvalidArgumentException::class);
577
- $this->expectExceptionMessage('Invalid node value');
578
-
579
- Uuid::uuid1('9223372036854775808');
580
- }
581
-
582
- public function testUuid1WithNonHexadecimalNode(): void
583
- {
584
- $this->expectException(InvalidArgumentException::class);
585
- $this->expectExceptionMessage('Invalid node value');
586
-
587
- Uuid::uuid1('db77e160355g');
588
- }
589
-
590
- public function testUuid1WithNon48bitNumber(): void
591
- {
592
- $this->expectException(InvalidArgumentException::class);
593
- $this->expectExceptionMessage('Invalid node value');
594
-
595
- Uuid::uuid1('db77e160355ef');
596
- }
597
-
598
- public function testUuid1WithRandomNode(): void
599
- {
600
- Uuid::setFactory(new UuidFactory(new FeatureSet(false, false, true)));
601
-
602
- /** @var UuidV1 $uuid */
603
- $uuid = Uuid::uuid1();
604
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
605
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
606
- $this->assertSame(Version::Time, $uuid->getFields()->getVersion());
607
- }
608
-
609
- public function testUuid1WithUserGeneratedRandomNode(): void
610
- {
611
- /** @var UuidV1 $uuid */
612
- $uuid = Uuid::uuid1(new Hexadecimal((string) (new RandomNodeProvider())->getNode()));
613
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
614
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
615
- $this->assertSame(Version::Time, $uuid->getFields()->getVersion());
616
- }
617
-
618
- public function testUuid6(): void
619
- {
620
- /** @var UuidV6 $uuid */
621
- $uuid = Uuid::uuid6();
622
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
623
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
624
- $this->assertSame(Version::ReorderedTime, $uuid->getFields()->getVersion());
625
- }
626
-
627
- public function testUuid6WithNodeAndClockSequence(): void
628
- {
629
- /** @var UuidV6 $uuid */
630
- $uuid = Uuid::uuid6(new Hexadecimal('0800200c9a66'), 0x1669);
631
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
632
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
633
- $this->assertSame(Version::ReorderedTime, $uuid->getFields()->getVersion());
634
- $this->assertSame('1669', $uuid->getFields()->getClockSeq()->toString());
635
- $this->assertSame('0800200c9a66', $uuid->getFields()->getNode()->toString());
636
- $this->assertSame('9669-0800200c9a66', substr($uuid->toString(), 19));
637
- }
638
-
639
- public function testUuid6WithHexadecimalNode(): void
640
- {
641
- /** @var UuidV6 $uuid */
642
- $uuid = Uuid::uuid6(new Hexadecimal('7160355e'));
643
-
644
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
645
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
646
- $this->assertSame(Version::ReorderedTime, $uuid->getFields()->getVersion());
647
- $this->assertSame('00007160355e', $uuid->getFields()->getNode()->toString());
648
- }
649
-
650
- public function testUuid6WithMixedCaseHexadecimalNode(): void
651
- {
652
- /** @var UuidV6 $uuid */
653
- $uuid = Uuid::uuid6(new Hexadecimal('71B0aD5e'));
654
-
655
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
656
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
657
- $this->assertSame(Version::ReorderedTime, $uuid->getFields()->getVersion());
658
- $this->assertSame('000071b0ad5e', $uuid->getFields()->getNode()->toString());
659
- }
660
-
661
- public function testUuid6WithOutOfBoundsNode(): void
662
- {
663
- $this->expectException(InvalidArgumentException::class);
664
- $this->expectExceptionMessage('Invalid node value');
665
-
666
- Uuid::uuid6(new Hexadecimal('9223372036854775808'));
667
- }
668
-
669
- public function testUuid6WithNon48bitNumber(): void
670
- {
671
- $this->expectException(InvalidArgumentException::class);
672
- $this->expectExceptionMessage('Invalid node value');
673
-
674
- Uuid::uuid6(new Hexadecimal('db77e160355ef'));
675
- }
676
-
677
- public function testUuid6WithRandomNode(): void
678
- {
679
- Uuid::setFactory(new UuidFactory(new FeatureSet(false, false, true)));
680
-
681
- /** @var UuidV6 $uuid */
682
- $uuid = Uuid::uuid6();
683
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
684
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
685
- $this->assertSame(Version::ReorderedTime, $uuid->getFields()->getVersion());
686
- }
687
-
688
- public function testUuid6WithUserGeneratedRandomNode(): void
689
- {
690
- /** @var UuidV6 $uuid */
691
- $uuid = Uuid::uuid6(new Hexadecimal((string) (new RandomNodeProvider())->getNode()));
692
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
693
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
694
- $this->assertSame(Version::ReorderedTime, $uuid->getFields()->getVersion());
695
- }
696
-
697
- public function testUuid7(): void
698
- {
699
- /** @var UuidV7 $uuid */
700
- $uuid = Uuid::uuid7();
701
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
702
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
703
- $this->assertSame(Version::UnixTime, $uuid->getFields()->getVersion());
704
- }
705
-
706
- public function testUuid7ThrowsExceptionForUnsupportedFactory(): void
707
- {
708
- /** @var UuidFactoryInterface&MockInterface $factory */
709
- $factory = Mockery::mock(UuidFactoryInterface::class);
710
-
711
- Uuid::setFactory($factory);
712
-
713
- $this->expectException(UnsupportedOperationException::class);
714
- $this->expectExceptionMessage('The provided factory does not support the uuid7() method');
715
-
716
- Uuid::uuid7();
717
- }
718
-
719
- public function testUuid7WithDateTime(): void
720
- {
721
- $dateTime = new DateTimeImmutable('@281474976710.655');
722
-
723
- /** @var UuidV7 $uuid */
724
- $uuid = Uuid::uuid7($dateTime);
725
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
726
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
727
- $this->assertSame(Version::UnixTime, $uuid->getFields()->getVersion());
728
- $this->assertSame(
729
- '10889-08-02T05:31:50.655+00:00',
730
- $uuid->getDateTime()->format(DateTimeInterface::RFC3339_EXTENDED),
731
- );
732
- }
733
-
734
- public function testUuid7SettingTheClockBackwards(): void
735
- {
736
- $dates = [
737
- new DateTimeImmutable('now'),
738
- new DateTimeImmutable('last year'),
739
- new DateTimeImmutable('1979-01-01 00:00:00.000000'),
740
- ];
741
-
742
- foreach ($dates as $dateTime) {
743
- /** @var UuidV7 $previous */
744
- $previous = Uuid::uuid7($dateTime);
745
-
746
- for ($i = 0; $i < 25; $i++) {
747
- /** @var UuidV7 $uuid */
748
- $uuid = Uuid::uuid7($dateTime);
749
- $this->assertGreaterThan(0, $uuid->compareTo($previous));
750
- $this->assertSame($dateTime->format('Y-m-d H:i'), $uuid->getDateTime()->format('Y-m-d H:i'));
751
- $previous = $uuid;
752
- }
753
- }
754
- }
755
-
756
- public function testUuid7WithMinimumDateTime(): void
757
- {
758
- $dateTime = new DateTimeImmutable('1979-01-01 00:00:00.000000');
759
-
760
- /** @var UuidV7 $uuid */
761
- $uuid = Uuid::uuid7($dateTime);
762
- $this->assertInstanceOf(DateTimeInterface::class, $uuid->getDateTime());
763
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
764
- $this->assertSame(Version::UnixTime, $uuid->getFields()->getVersion());
765
-
766
- $this->assertSame(
767
- '1979-01-01T00:00:00.000+00:00',
768
- $uuid->getDateTime()->format(DateTimeInterface::RFC3339_EXTENDED),
769
- );
770
- }
771
-
772
- public function testUuid7EachUuidIsMonotonicallyIncreasing(): void
773
- {
774
- /** @var UuidV7 $previous */
775
- $previous = Uuid::uuid7();
776
-
777
- for ($i = 0; $i < 25; $i++) {
778
- /** @var UuidV7 $uuid */
779
- $uuid = Uuid::uuid7();
780
- $now = gmdate('Y-m-d H:i');
781
- $this->assertGreaterThan(0, $uuid->compareTo($previous));
782
- $this->assertSame($now, $uuid->getDateTime()->format('Y-m-d H:i'));
783
- $previous = $uuid;
784
- }
785
- }
786
-
787
- public function testUuid7EachUuidFromSameDateTimeIsMonotonicallyIncreasing(): void
788
- {
789
- $dateTime = new DateTimeImmutable();
790
-
791
- /** @var UuidV7 $previous */
792
- $previous = Uuid::uuid7($dateTime);
793
-
794
- for ($i = 0; $i < 25; $i++) {
795
- /** @var UuidV7 $uuid */
796
- $uuid = Uuid::uuid7($dateTime);
797
- $this->assertGreaterThan(0, $uuid->compareTo($previous));
798
- $this->assertSame($dateTime->format('Y-m-d H:i'), $uuid->getDateTime()->format('Y-m-d H:i'));
799
- $previous = $uuid;
800
- }
801
- }
802
-
803
- public function testUuid8(): void
804
- {
805
- /** @var UuidV8 $uuid */
806
- $uuid = Uuid::uuid8("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff");
807
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
808
- $this->assertSame(Version::Custom, $uuid->getFields()->getVersion());
809
- }
810
-
811
- public function testUuid8ThrowsExceptionForUnsupportedFactory(): void
812
- {
813
- /** @var UuidFactoryInterface&MockInterface $factory */
814
- $factory = Mockery::mock(UuidFactoryInterface::class);
815
-
816
- Uuid::setFactory($factory);
817
-
818
- $this->expectException(UnsupportedOperationException::class);
819
- $this->expectExceptionMessage('The provided factory does not support the uuid8() method');
820
-
821
- Uuid::uuid8("\x00\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc\xdd\xee\xff");
822
- }
823
-
824
- /**
825
- * Tests known version-3 UUIDs
826
- *
827
- * Taken from the Python UUID tests in
828
- * http://hg.python.org/cpython/file/2f4c4db9aee5/Lib/test/test_uuid.py
829
- *
830
- * @param non-empty-string $uuid
831
- * @param non-empty-string $ns
832
- *
833
- * @dataProvider provideUuid3WithKnownUuids
834
- */
835
- public function testUuid3WithKnownUuids(string $uuid, string $ns, string $name): void
836
- {
837
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uobj1 */
838
- $uobj1 = Uuid::uuid3($ns, $name);
839
-
840
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uobj2 */
841
- $uobj2 = Uuid::uuid3(Uuid::fromString($ns), $name);
842
-
843
- $this->assertSame(Variant::Rfc4122, $uobj1->getFields()->getVariant());
844
- $this->assertSame(Version::HashMd5, $uobj1->getFields()->getVersion());
845
- $this->assertSame(Uuid::fromString($uuid)->toString(), $uobj1->toString());
846
- $this->assertTrue($uobj1->equals($uobj2));
847
- }
848
-
849
- /**
850
- * @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification
851
- */
852
- public function provideUuid3WithKnownUuids(): array
853
- {
854
- return [
855
- [
856
- 'uuid' => '6fa459ea-ee8a-3ca4-894e-db77e160355e',
857
- 'ns' => Uuid::NAMESPACE_DNS,
858
- 'name' => 'python.org',
859
- ],
860
- [
861
- 'uuid' => '9fe8e8c4-aaa8-32a9-a55c-4535a88b748d',
862
- 'ns' => Uuid::NAMESPACE_URL,
863
- 'name' => 'http://python.org/',
864
- ],
865
- [
866
- 'uuid' => 'dd1a1cef-13d5-368a-ad82-eca71acd4cd1',
867
- 'ns' => Uuid::NAMESPACE_OID,
868
- 'name' => '1.3.6.1',
869
- ],
870
- [
871
- 'uuid' => '658d3002-db6b-3040-a1d1-8ddd7d189a4d',
872
- 'ns' => Uuid::NAMESPACE_X500,
873
- 'name' => 'c=ca',
874
- ],
875
- ];
876
- }
877
-
878
- public function testUuid4(): void
879
- {
880
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
881
- $uuid = Uuid::uuid4();
882
- $this->assertSame(Variant::Rfc4122, $uuid->getFields()->getVariant());
883
- $this->assertSame(Version::Random, $uuid->getFields()->getVersion());
884
- }
885
-
886
- /**
887
- * Tests that generated UUID's using timestamp last COMB are sequential
888
- */
889
- public function testUuid4TimestampLastComb(): void
890
- {
891
- $mock = $this->getMockBuilder(RandomGeneratorInterface::class)->getMock();
892
- $mock->expects($this->any())
893
- ->method('generate')
894
- ->willReturnCallback(function ($length) {
895
- // Makes first fields of UUIDs equal
896
- return hex2bin(str_pad('', $length * 2, '0'));
897
- });
898
-
899
- $factory = new UuidFactory();
900
- $generator = new CombGenerator($mock, $factory->getNumberConverter());
901
- $codec = new TimestampLastCombCodec($factory->getUuidBuilder());
902
- $factory->setRandomGenerator($generator);
903
- $factory->setCodec($codec);
904
-
905
- $previous = $factory->uuid4();
906
-
907
- for ($i = 0; $i < 1000; $i++) {
908
- usleep(100);
909
- $uuid = $factory->uuid4();
910
- $this->assertGreaterThan($previous->toString(), $uuid->toString());
911
-
912
- $previous = $uuid;
913
- }
914
- }
915
-
916
- /**
917
- * Tests that generated UUID's using timestamp first COMB are sequential
918
- */
919
- public function testUuid4TimestampFirstComb(): void
920
- {
921
- $mock = $this->getMockBuilder(RandomGeneratorInterface::class)->getMock();
922
- $mock->expects($this->any())
923
- ->method('generate')
924
- ->willReturnCallback(function ($length) {
925
- // Makes first fields of UUIDs equal
926
- return hex2bin(str_pad('', $length * 2, '0'));
927
- });
928
-
929
- $factory = new UuidFactory();
930
- $generator = new CombGenerator($mock, $factory->getNumberConverter());
931
- $codec = new TimestampFirstCombCodec($factory->getUuidBuilder());
932
- $factory->setRandomGenerator($generator);
933
- $factory->setCodec($codec);
934
-
935
- $previous = $factory->uuid4();
936
-
937
- for ($i = 0; $i < 1000; $i++) {
938
- usleep(100);
939
- $uuid = $factory->uuid4();
940
- $this->assertGreaterThan($previous->toString(), $uuid->toString());
941
-
942
- $previous = $uuid;
943
- }
944
- }
945
-
946
- /**
947
- * Test that COMB UUID's have a version 4 flag
948
- */
949
- public function testUuid4CombVersion(): void
950
- {
951
- $factory = new UuidFactory();
952
- $generator = new CombGenerator(
953
- (new RandomGeneratorFactory())->getGenerator(),
954
- $factory->getNumberConverter()
955
- );
956
-
957
- $factory->setRandomGenerator($generator);
958
-
959
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
960
- $uuid = $factory->uuid4();
961
-
962
- $this->assertSame(Version::Random, $uuid->getFields()->getVersion());
963
- }
964
-
965
- /**
966
- * Tests known version-5 UUIDs
967
- *
968
- * Taken from the Python UUID tests in
969
- * http://hg.python.org/cpython/file/2f4c4db9aee5/Lib/test/test_uuid.py
970
- *
971
- * @param non-empty-string $uuid
972
- * @param non-empty-string $ns
973
- *
974
- * @dataProvider provideUuid5WithKnownUuids
975
- */
976
- public function testUuid5WithKnownUuids(string $uuid, string $ns, string $name): void
977
- {
978
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uobj1 */
979
- $uobj1 = Uuid::uuid5($ns, $name);
980
-
981
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uobj2 */
982
- $uobj2 = Uuid::uuid5(Uuid::fromString($ns), $name);
983
-
984
- $this->assertSame(Variant::Rfc4122, $uobj1->getFields()->getVariant());
985
- $this->assertSame(Version::HashSha1, $uobj1->getFields()->getVersion());
986
- $this->assertSame(Uuid::fromString($uuid)->toString(), $uobj1->toString());
987
- $this->assertTrue($uobj1->equals($uobj2));
988
- }
989
-
990
- /**
991
- * @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification
992
- */
993
- public function provideUuid5WithKnownUuids(): array
994
- {
995
- return [
996
- [
997
- 'uuid' => '886313e1-3b8a-5372-9b90-0c9aee199e5d',
998
- 'ns' => Uuid::NAMESPACE_DNS,
999
- 'name' => 'python.org',
1000
- ],
1001
- [
1002
- 'uuid' => '4c565f0d-3f5a-5890-b41b-20cf47701c5e',
1003
- 'ns' => Uuid::NAMESPACE_URL,
1004
- 'name' => 'http://python.org/',
1005
- ],
1006
- [
1007
- 'uuid' => '1447fa61-5277-5fef-a9b3-fbc6e44f4af3',
1008
- 'ns' => Uuid::NAMESPACE_OID,
1009
- 'name' => '1.3.6.1',
1010
- ],
1011
- [
1012
- 'uuid' => 'cc957dd1-a972-5349-98cd-874190002798',
1013
- 'ns' => Uuid::NAMESPACE_X500,
1014
- 'name' => 'c=ca',
1015
- ],
1016
- ];
1017
- }
1018
-
1019
- public function testCompareTo(): void
1020
- {
1021
- // $uuid1 and $uuid2 are identical
1022
- $uuid1 = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
1023
- $uuid2 = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
1024
-
1025
- // The next three UUIDs are used for comparing msb and lsb in
1026
- // the compareTo() method
1027
-
1028
- // msb are less than $uuid4, lsb are greater than $uuid5
1029
- $uuid3 = Uuid::fromString('44cca71e-d13d-11e1-a959-c8bcc8a476f4');
1030
-
1031
- // msb are greater than $uuid3, lsb are equal to those in $uuid3
1032
- $uuid4 = Uuid::fromString('44cca71e-d13d-11e2-a959-c8bcc8a476f4');
1033
-
1034
- // msb are equal to those in $uuid3, lsb are less than in $uuid3
1035
- $uuid5 = Uuid::fromString('44cca71e-d13d-11e1-a959-c8bcc8a476f3');
1036
-
1037
- $this->assertSame(0, $uuid1->compareTo($uuid2));
1038
- $this->assertSame(0, $uuid2->compareTo($uuid1));
1039
- $this->assertSame(-1, $uuid3->compareTo($uuid4));
1040
- $this->assertSame(1, $uuid4->compareTo($uuid3));
1041
- $this->assertSame(-1, $uuid5->compareTo($uuid3));
1042
- $this->assertSame(1, $uuid3->compareTo($uuid5));
1043
- }
1044
-
1045
- public function testCompareToReturnsZeroWhenDifferentCases(): void
1046
- {
1047
- $uuidString = 'ff6f8cb0-c57d-11e1-9b21-0800200c9a66';
1048
- // $uuid1 and $uuid2 are identical
1049
- $uuid1 = Uuid::fromString($uuidString);
1050
- $uuid2 = Uuid::fromString(strtoupper($uuidString));
1051
-
1052
- $this->assertSame(0, $uuid1->compareTo($uuid2));
1053
- $this->assertSame(0, $uuid2->compareTo($uuid1));
1054
- }
1055
-
1056
- public function testEqualsReturnsTrueWhenDifferentCases(): void
1057
- {
1058
- $uuidString = 'ff6f8cb0-c57d-11e1-9b21-0800200c9a66';
1059
- // $uuid1 and $uuid2 are identical
1060
- $uuid1 = Uuid::fromString($uuidString);
1061
- $uuid2 = Uuid::fromString(strtoupper($uuidString));
1062
-
1063
- $this->assertTrue($uuid1->equals($uuid2));
1064
- $this->assertTrue($uuid2->equals($uuid1));
1065
- }
1066
-
1067
- public function testEquals(): void
1068
- {
1069
- $uuid1 = Uuid::uuid5(Uuid::NAMESPACE_DNS, 'python.org');
1070
- $uuid2 = Uuid::uuid5(Uuid::NAMESPACE_DNS, 'python.org');
1071
- $uuid3 = Uuid::uuid5(Uuid::NAMESPACE_DNS, 'php.net');
1072
-
1073
- $this->assertTrue($uuid1->equals($uuid2));
1074
- $this->assertFalse($uuid1->equals($uuid3));
1075
- $this->assertFalse($uuid1->equals(new stdClass()));
1076
- }
1077
-
1078
- public function testCalculateUuidTime(): void
1079
- {
1080
- $timeOfDay = new FixedTimeProvider(new Time(1348845514, 277885));
1081
-
1082
- $featureSet = new FeatureSet();
1083
- $featureSet->setTimeProvider($timeOfDay);
1084
-
1085
- // For usec = 277885
1086
- Uuid::setFactory(new UuidFactory($featureSet));
1087
-
1088
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuidA */
1089
- $uuidA = Uuid::uuid1(0x00007ffffffe, 0x1669);
1090
-
1091
- $this->assertSame('c4dbe7e2-097f-11e2-9669-00007ffffffe', (string) $uuidA);
1092
- $this->assertSame('c4dbe7e2', $uuidA->getFields()->getTimeLow()->toString());
1093
- $this->assertSame('097f', $uuidA->getFields()->getTimeMid()->toString());
1094
- $this->assertSame('11e2', $uuidA->getFields()->getTimeHiAndVersion()->toString());
1095
-
1096
- // For usec = 0
1097
- $timeOfDay->setUsec(0);
1098
-
1099
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuidB */
1100
- $uuidB = Uuid::uuid1(0x00007ffffffe, 0x1669);
1101
-
1102
- $this->assertSame('c4b18100-097f-11e2-9669-00007ffffffe', (string) $uuidB);
1103
- $this->assertSame('c4b18100', $uuidB->getFields()->getTimeLow()->toString());
1104
- $this->assertSame('097f', $uuidB->getFields()->getTimeMid()->toString());
1105
- $this->assertSame('11e2', $uuidB->getFields()->getTimeHiAndVersion()->toString());
1106
-
1107
- // For usec = 999999
1108
- $timeOfDay->setUsec(999999);
1109
-
1110
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuidC */
1111
- $uuidC = Uuid::uuid1(0x00007ffffffe, 0x1669);
1112
-
1113
- $this->assertSame('c54a1776-097f-11e2-9669-00007ffffffe', (string) $uuidC);
1114
- $this->assertSame('c54a1776', $uuidC->getFields()->getTimeLow()->toString());
1115
- $this->assertSame('097f', $uuidC->getFields()->getTimeMid()->toString());
1116
- $this->assertSame('11e2', $uuidC->getFields()->getTimeHiAndVersion()->toString());
1117
- }
1118
-
1119
- public function testCalculateUuidTimeUpperLowerBounds(): void
1120
- {
1121
- // 5235-03-31T21:20:59+00:00
1122
- $timeOfDay = new FixedTimeProvider(new Time('103072857659', '999999'));
1123
-
1124
- $featureSet = new FeatureSet();
1125
- $featureSet->setTimeProvider($timeOfDay);
1126
-
1127
- Uuid::setFactory(new UuidFactory($featureSet));
1128
-
1129
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuidA */
1130
- $uuidA = Uuid::uuid1(0x00007ffffffe, 0x1669);
1131
-
1132
- $this->assertSame('ff9785f6-ffff-1fff-9669-00007ffffffe', (string) $uuidA);
1133
- $this->assertSame('ff9785f6', $uuidA->getFields()->getTimeLow()->toString());
1134
- $this->assertSame('ffff', $uuidA->getFields()->getTimeMid()->toString());
1135
- $this->assertSame('1fff', $uuidA->getFields()->getTimeHiAndVersion()->toString());
1136
-
1137
- // 1582-10-15T00:00:00+00:00
1138
- $timeOfDay = new FixedTimeProvider(new Time('-12219292800', '0'));
1139
-
1140
- $featureSet->setTimeProvider($timeOfDay);
1141
-
1142
- Uuid::setFactory(new UuidFactory($featureSet));
1143
-
1144
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuidB */
1145
- $uuidB = Uuid::uuid1(0x00007ffffffe, 0x1669);
1146
-
1147
- $this->assertSame('00000000-0000-1000-9669-00007ffffffe', (string) $uuidB);
1148
- $this->assertSame('00000000', $uuidB->getFields()->getTimeLow()->toString());
1149
- $this->assertSame('0000', $uuidB->getFields()->getTimeMid()->toString());
1150
- $this->assertSame('1000', $uuidB->getFields()->getTimeHiAndVersion()->toString());
1151
- }
1152
-
1153
- /**
1154
- * Iterates over a 3600-second period and tests to ensure that, for each
1155
- * second in the period, the 32-bit and 64-bit versions of the UUID match
1156
- */
1157
- public function test32BitMatch64BitForOneHourPeriod(): void
1158
- {
1159
- $currentTime = strtotime('2012-12-11T00:00:00+00:00');
1160
- $endTime = $currentTime + 3600;
1161
-
1162
- $timeOfDay = new FixedTimeProvider(new Time($currentTime, 0));
1163
-
1164
- $smallIntFeatureSet = new FeatureSet(false, true);
1165
- $smallIntFeatureSet->setTimeProvider($timeOfDay);
1166
-
1167
- $smallIntFactory = new UuidFactory($smallIntFeatureSet);
1168
-
1169
- $featureSet = new FeatureSet();
1170
- $featureSet->setTimeProvider($timeOfDay);
1171
-
1172
- $factory = new UuidFactory($featureSet);
1173
-
1174
- while ($currentTime <= $endTime) {
1175
- foreach ([0, 50000, 250000, 500000, 750000, 999999] as $usec) {
1176
- $timeOfDay->setSec($currentTime);
1177
- $timeOfDay->setUsec($usec);
1178
-
1179
- /** @var UuidV1 $uuid32 */
1180
- $uuid32 = $smallIntFactory->uuid1(0x00007ffffffe, 0x1669);
1181
-
1182
- /** @var UuidV1 $uuid64 */
1183
- $uuid64 = $factory->uuid1(0x00007ffffffe, 0x1669);
1184
-
1185
- $this->assertTrue(
1186
- $uuid32->equals($uuid64),
1187
- 'Breaks at ' . gmdate('r', $currentTime)
1188
- . "; 32-bit: {$uuid32->toString()}, 64-bit: {$uuid64->toString()}"
1189
- );
1190
-
1191
- // Assert that the time matches
1192
- $usecAdd = BigDecimal::of($usec)->dividedBy('1000000', 14, RoundingMode::HALF_UP);
1193
- $testTime = BigDecimal::of($currentTime)->plus($usecAdd)->toScale(0, RoundingMode::DOWN);
1194
- $this->assertSame((string) $testTime, (string) $uuid64->getDateTime()->getTimestamp());
1195
- $this->assertSame((string) $testTime, (string) $uuid32->getDateTime()->getTimestamp());
1196
- }
1197
-
1198
- $currentTime++;
1199
- }
1200
- }
1201
-
1202
- /**
1203
- * This method should respond to the result of the factory
1204
- */
1205
- public function testIsValid(): void
1206
- {
1207
- $argument = uniqid('passed argument ');
1208
-
1209
- /** @var MockObject & ValidatorInterface $validator */
1210
- $validator = $this->getMockBuilder(ValidatorInterface::class)->getMock();
1211
- $validator->expects($this->once())->method('validate')->with($argument)->willReturn(true);
1212
-
1213
- /** @var UuidFactory $factory */
1214
- $factory = Uuid::getFactory();
1215
- $factory->setValidator($validator);
1216
-
1217
- $this->assertTrue(Uuid::isValid($argument));
1218
-
1219
- // reset the static validator
1220
- $factory->setValidator(new GenericValidator());
1221
- }
1222
-
1223
- public function testUsingNilAsValidUuid(): void
1224
- {
1225
- self::assertSame(
1226
- '0cb17687-6ec7-324b-833a-f1d101a7edb7',
1227
- Uuid::uuid3(Uuid::NIL, 'randomtext')
1228
- ->toString()
1229
- );
1230
- self::assertSame(
1231
- '3b24c15b-1273-5628-ade4-fc67c6ede500',
1232
- Uuid::uuid5(Uuid::NIL, 'randomtext')
1233
- ->toString()
1234
- );
1235
- }
1236
-
1237
- public function testFromBytes(): void
1238
- {
1239
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
1240
- $bytes = $uuid->getBytes();
1241
-
1242
- $fromBytesUuid = Uuid::fromBytes($bytes);
1243
-
1244
- $this->assertTrue($uuid->equals($fromBytesUuid));
1245
- }
1246
-
1247
- public function testGuidBytesMatchesUuidWithSameString(): void
1248
- {
1249
- $uuidFactory = new UuidFactory(new FeatureSet(false));
1250
- $guidFactory = new UuidFactory(new FeatureSet(true));
1251
-
1252
- $uuid = $uuidFactory->fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
1253
- $bytes = $uuid->getBytes();
1254
-
1255
- // Swap the order of the bytes for a GUID.
1256
- $guidBytes = $bytes[3] . $bytes[2] . $bytes[1] . $bytes[0];
1257
- $guidBytes .= $bytes[5] . $bytes[4];
1258
- $guidBytes .= $bytes[7] . $bytes[6];
1259
- $guidBytes .= substr($bytes, 8);
1260
-
1261
- $guid = $guidFactory->fromBytes($guidBytes);
1262
-
1263
- $this->assertSame($uuid->toString(), $guid->toString());
1264
- $this->assertTrue($uuid->equals($guid));
1265
- }
1266
-
1267
- public function testGuidBytesProducesSameGuidString(): void
1268
- {
1269
- $guidFactory = new UuidFactory(new FeatureSet(true));
1270
-
1271
- $guid = $guidFactory->fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
1272
- $bytes = $guid->getBytes();
1273
-
1274
- $parsedGuid = $guidFactory->fromBytes($bytes);
1275
-
1276
- $this->assertSame($guid->toString(), $parsedGuid->toString());
1277
- $this->assertTrue($guid->equals($parsedGuid));
1278
- }
1279
-
1280
- public function testFromBytesArgumentTooShort(): void
1281
- {
1282
- $this->expectException(InvalidArgumentException::class);
1283
-
1284
- Uuid::fromBytes('thisisveryshort');
1285
- }
1286
-
1287
- public function testFromBytesArgumentTooLong(): void
1288
- {
1289
- $this->expectException(InvalidArgumentException::class);
1290
-
1291
- Uuid::fromBytes('thisisabittoolong');
1292
- }
1293
-
1294
- public function testFromInteger(): void
1295
- {
1296
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
1297
- $integer = $uuid->getInteger()->toString();
1298
-
1299
- $fromIntegerUuid = Uuid::fromInteger($integer);
1300
-
1301
- $this->assertTrue($uuid->equals($fromIntegerUuid));
1302
- }
1303
-
1304
- public function testFromDateTime(): void
1305
- {
1306
- /** @var UuidV1 $uuid */
1307
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-8b21-0800200c9a66');
1308
- $dateTime = $uuid->getDateTime();
1309
-
1310
- $fromDateTimeUuid = Uuid::fromDateTime($dateTime, new Hexadecimal('0800200c9a66'), 2849);
1311
-
1312
- $this->assertTrue($uuid->equals($fromDateTimeUuid));
1313
- }
1314
-
1315
- /**
1316
- * This test ensures that Ramsey\Uuid passes the same test cases
1317
- * as the Python UUID library.
1318
- *
1319
- * @param non-empty-string $string
1320
- * @param non-empty-string $curly
1321
- * @param non-empty-string $hex
1322
- * @param non-empty-string $bytes
1323
- * @param numeric-string $int
1324
- * @param string[] $fields
1325
- * @param non-empty-string $urn
1326
- *
1327
- * @dataProvider providePythonTests
1328
- */
1329
- public function testUuidPassesPythonTests(
1330
- string $string,
1331
- string $curly,
1332
- string $hex,
1333
- string $bytes,
1334
- string $int,
1335
- array $fields,
1336
- string $urn,
1337
- string $time,
1338
- string $clockSeq,
1339
- Variant $variant,
1340
- ?Version $version
1341
- ): void {
1342
- /** @var non-empty-string $base64DecodedBytes */
1343
- $base64DecodedBytes = base64_decode($bytes);
1344
-
1345
- $uuids = [
1346
- Uuid::fromString($string),
1347
- Uuid::fromString($curly),
1348
- Uuid::fromString($hex),
1349
- Uuid::fromBytes($base64DecodedBytes),
1350
- Uuid::fromString($urn),
1351
- Uuid::fromInteger($int),
1352
- ];
1353
-
1354
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
1355
- foreach ($uuids as $uuid) {
1356
- $this->assertSame($string, $uuid->toString());
1357
- $this->assertSame($hex, $uuid->getHex()->toString());
1358
- $this->assertSame($base64DecodedBytes, $uuid->getBytes());
1359
- $this->assertSame($int, $uuid->getInteger()->toString());
1360
- $this->assertSame($fields['time_low'], $uuid->getFields()->getTimeLow()->toString());
1361
- $this->assertSame($fields['time_mid'], $uuid->getFields()->getTimeMid()->toString());
1362
- $this->assertSame($fields['time_hi_and_version'], $uuid->getFields()->getTimeHiAndVersion()->toString());
1363
- $this->assertSame(
1364
- $fields['clock_seq_hi_and_reserved'],
1365
- $uuid->getFields()->getClockSeqHiAndReserved()->toString(),
1366
- );
1367
- $this->assertSame(
1368
- $fields['clock_seq_low'],
1369
- $uuid->getFields()->getClockSeqLow()->toString(),
1370
- );
1371
- $this->assertSame($fields['node'], $uuid->getFields()->getNode()->toString());
1372
- $this->assertSame($urn, $uuid->getUrn());
1373
- $this->assertSame($time, $uuid->getFields()->getTimestamp()->toString());
1374
- $this->assertSame($clockSeq, $uuid->getFields()->getClockSeq()->toString());
1375
- $this->assertSame($variant, $uuid->getFields()->getVariant());
1376
- $this->assertSame($version, $uuid->getFields()->getVersion());
1377
- }
1378
- }
1379
-
1380
- /**
1381
- * Taken from the Python UUID tests in
1382
- * http://hg.python.org/cpython/file/2f4c4db9aee5/Lib/test/test_uuid.py
1383
- *
1384
- * @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification
1385
- */
1386
- public function providePythonTests(): array
1387
- {
1388
- // This array is taken directly from the Python tests, more or less.
1389
- return [
1390
- [
1391
- 'string' => '00000000-0000-0000-0000-000000000000',
1392
- 'curly' => '{00000000-0000-0000-0000-000000000000}',
1393
- 'hex' => '00000000000000000000000000000000',
1394
- 'bytes' => 'AAAAAAAAAAAAAAAAAAAAAA==',
1395
- 'int' => '0',
1396
- 'fields' => [
1397
- 'time_low' => '00000000',
1398
- 'time_mid' => '0000',
1399
- 'time_hi_and_version' => '0000',
1400
- 'clock_seq_hi_and_reserved' => '00',
1401
- 'clock_seq_low' => '00',
1402
- 'node' => '000000000000',
1403
- ],
1404
- 'urn' => 'urn:uuid:00000000-0000-0000-0000-000000000000',
1405
- 'time' => '000000000000000',
1406
- 'clock_seq' => '0000',
1407
- // This is a departure from the Python tests. The Python tests
1408
- // are technically "correct" because all bits are set to zero,
1409
- // so it stands to reason that the variant is also zero, but
1410
- // that leads to this being considered a "Reserved NCS" variant,
1411
- // and that is not the case. RFC 4122 defines this special UUID,
1412
- // so it is an RFC 4122 variant.
1413
- 'variant' => Variant::Rfc4122,
1414
- 'version' => null,
1415
- ],
1416
- [
1417
- 'string' => '00010203-0405-0607-0809-0a0b0c0d0e0f',
1418
- 'curly' => '{00010203-0405-0607-0809-0a0b0c0d0e0f}',
1419
- 'hex' => '000102030405060708090a0b0c0d0e0f',
1420
- 'bytes' => 'AAECAwQFBgcICQoLDA0ODw==',
1421
- 'int' => '5233100606242806050955395731361295',
1422
- 'fields' => [
1423
- 'time_low' => '00010203',
1424
- 'time_mid' => '0405',
1425
- 'time_hi_and_version' => '0607',
1426
- 'clock_seq_hi_and_reserved' => '08',
1427
- 'clock_seq_low' => '09',
1428
- 'node' => '0a0b0c0d0e0f',
1429
- ],
1430
- 'urn' => 'urn:uuid:00010203-0405-0607-0809-0a0b0c0d0e0f',
1431
- 'time' => '607040500010203',
1432
- 'clock_seq' => '0809',
1433
- 'variant' => Variant::ReservedNcs,
1434
- 'version' => null,
1435
- ],
1436
- [
1437
- 'string' => '02d9e6d5-9467-382e-8f9b-9300a64ac3cd',
1438
- 'curly' => '{02d9e6d5-9467-382e-8f9b-9300a64ac3cd}',
1439
- 'hex' => '02d9e6d59467382e8f9b9300a64ac3cd',
1440
- 'bytes' => 'Atnm1ZRnOC6Pm5MApkrDzQ==',
1441
- 'int' => '3789866285607910888100818383505376205',
1442
- 'fields' => [
1443
- 'time_low' => '02d9e6d5',
1444
- 'time_mid' => '9467',
1445
- 'time_hi_and_version' => '382e',
1446
- 'clock_seq_hi_and_reserved' => '8f',
1447
- 'clock_seq_low' => '9b',
1448
- 'node' => '9300a64ac3cd',
1449
- ],
1450
- 'urn' => 'urn:uuid:02d9e6d5-9467-382e-8f9b-9300a64ac3cd',
1451
- 'time' => '82e946702d9e6d5',
1452
- 'clock_seq' => '0f9b',
1453
- 'variant' => Variant::Rfc4122,
1454
- 'version' => Version::HashMd5,
1455
- ],
1456
- [
1457
- 'string' => '12345678-1234-5678-1234-567812345678',
1458
- 'curly' => '{12345678-1234-5678-1234-567812345678}',
1459
- 'hex' => '12345678123456781234567812345678',
1460
- 'bytes' => 'EjRWeBI0VngSNFZ4EjRWeA==',
1461
- 'int' => '24197857161011715162171839636988778104',
1462
- 'fields' => [
1463
- 'time_low' => '12345678',
1464
- 'time_mid' => '1234',
1465
- 'time_hi_and_version' => '5678',
1466
- 'clock_seq_hi_and_reserved' => '12',
1467
- 'clock_seq_low' => '34',
1468
- 'node' => '567812345678',
1469
- ],
1470
- 'urn' => 'urn:uuid:12345678-1234-5678-1234-567812345678',
1471
- 'time' => '678123412345678',
1472
- 'clock_seq' => '1234',
1473
- 'variant' => Variant::ReservedNcs,
1474
- 'version' => null,
1475
- ],
1476
- [
1477
- 'string' => '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
1478
- 'curly' => '{6ba7b810-9dad-11d1-80b4-00c04fd430c8}',
1479
- 'hex' => '6ba7b8109dad11d180b400c04fd430c8',
1480
- 'bytes' => 'a6e4EJ2tEdGAtADAT9QwyA==',
1481
- 'int' => '143098242404177361603877621312831893704',
1482
- 'fields' => [
1483
- 'time_low' => '6ba7b810',
1484
- 'time_mid' => '9dad',
1485
- 'time_hi_and_version' => '11d1',
1486
- 'clock_seq_hi_and_reserved' => '80',
1487
- 'clock_seq_low' => 'b4',
1488
- 'node' => '00c04fd430c8',
1489
- ],
1490
- 'urn' => 'urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8',
1491
- 'time' => '1d19dad6ba7b810',
1492
- 'clock_seq' => '00b4',
1493
- 'variant' => Variant::Rfc4122,
1494
- 'version' => Version::Time,
1495
- ],
1496
- [
1497
- 'string' => '6ba7b811-9dad-11d1-80b4-00c04fd430c8',
1498
- 'curly' => '{6ba7b811-9dad-11d1-80b4-00c04fd430c8}',
1499
- 'hex' => '6ba7b8119dad11d180b400c04fd430c8',
1500
- 'bytes' => 'a6e4EZ2tEdGAtADAT9QwyA==',
1501
- 'int' => '143098242483405524118141958906375844040',
1502
- 'fields' => [
1503
- 'time_low' => '6ba7b811',
1504
- 'time_mid' => '9dad',
1505
- 'time_hi_and_version' => '11d1',
1506
- 'clock_seq_hi_and_reserved' => '80',
1507
- 'clock_seq_low' => 'b4',
1508
- 'node' => '00c04fd430c8',
1509
- ],
1510
- 'urn' => 'urn:uuid:6ba7b811-9dad-11d1-80b4-00c04fd430c8',
1511
- 'time' => '1d19dad6ba7b811',
1512
- 'clock_seq' => '00b4',
1513
- 'variant' => Variant::Rfc4122,
1514
- 'version' => Version::Time,
1515
- ],
1516
- [
1517
- 'string' => '6ba7b812-9dad-11d1-80b4-00c04fd430c8',
1518
- 'curly' => '{6ba7b812-9dad-11d1-80b4-00c04fd430c8}',
1519
- 'hex' => '6ba7b8129dad11d180b400c04fd430c8',
1520
- 'bytes' => 'a6e4Ep2tEdGAtADAT9QwyA==',
1521
- 'int' => '143098242562633686632406296499919794376',
1522
- 'fields' => [
1523
- 'time_low' => '6ba7b812',
1524
- 'time_mid' => '9dad',
1525
- 'time_hi_and_version' => '11d1',
1526
- 'clock_seq_hi_and_reserved' => '80',
1527
- 'clock_seq_low' => 'b4',
1528
- 'node' => '00c04fd430c8',
1529
- ],
1530
- 'urn' => 'urn:uuid:6ba7b812-9dad-11d1-80b4-00c04fd430c8',
1531
- 'time' => '1d19dad6ba7b812',
1532
- 'clock_seq' => '00b4',
1533
- 'variant' => Variant::Rfc4122,
1534
- 'version' => Version::Time,
1535
- ],
1536
- [
1537
- 'string' => '6ba7b814-9dad-11d1-80b4-00c04fd430c8',
1538
- 'curly' => '{6ba7b814-9dad-11d1-80b4-00c04fd430c8}',
1539
- 'hex' => '6ba7b8149dad11d180b400c04fd430c8',
1540
- 'bytes' => 'a6e4FJ2tEdGAtADAT9QwyA==',
1541
- 'int' => '143098242721090011660934971687007695048',
1542
- 'fields' => [
1543
- 'time_low' => '6ba7b814',
1544
- 'time_mid' => '9dad',
1545
- 'time_hi_and_version' => '11d1',
1546
- 'clock_seq_hi_and_reserved' => '80',
1547
- 'clock_seq_low' => 'b4',
1548
- 'node' => '00c04fd430c8',
1549
- ],
1550
- 'urn' => 'urn:uuid:6ba7b814-9dad-11d1-80b4-00c04fd430c8',
1551
- 'time' => '1d19dad6ba7b814',
1552
- 'clock_seq' => '00b4',
1553
- 'variant' => Variant::Rfc4122,
1554
- 'version' => Version::Time,
1555
- ],
1556
- [
1557
- 'string' => '7d444840-9dc0-11d1-b245-5ffdce74fad2',
1558
- 'curly' => '{7d444840-9dc0-11d1-b245-5ffdce74fad2}',
1559
- 'hex' => '7d4448409dc011d1b2455ffdce74fad2',
1560
- 'bytes' => 'fURIQJ3AEdGyRV/9znT60g==',
1561
- 'int' => '166508041112410060672666770310773930706',
1562
- 'fields' => [
1563
- 'time_low' => '7d444840',
1564
- 'time_mid' => '9dc0',
1565
- 'time_hi_and_version' => '11d1',
1566
- 'clock_seq_hi_and_reserved' => 'b2',
1567
- 'clock_seq_low' => '45',
1568
- 'node' => '5ffdce74fad2',
1569
- ],
1570
- 'urn' => 'urn:uuid:7d444840-9dc0-11d1-b245-5ffdce74fad2',
1571
- 'time' => '1d19dc07d444840',
1572
- 'clock_seq' => '3245',
1573
- 'variant' => Variant::Rfc4122,
1574
- 'version' => Version::Time,
1575
- ],
1576
- [
1577
- 'string' => 'e902893a-9d22-3c7e-a7b8-d6e313b71d9f',
1578
- 'curly' => '{e902893a-9d22-3c7e-a7b8-d6e313b71d9f}',
1579
- 'hex' => 'e902893a9d223c7ea7b8d6e313b71d9f',
1580
- 'bytes' => '6QKJOp0iPH6nuNbjE7cdnw==',
1581
- 'int' => '309723290945582129846206211755626405279',
1582
- 'fields' => [
1583
- 'time_low' => 'e902893a',
1584
- 'time_mid' => '9d22',
1585
- 'time_hi_and_version' => '3c7e',
1586
- 'clock_seq_hi_and_reserved' => 'a7',
1587
- 'clock_seq_low' => 'b8',
1588
- 'node' => 'd6e313b71d9f',
1589
- ],
1590
- 'urn' => 'urn:uuid:e902893a-9d22-3c7e-a7b8-d6e313b71d9f',
1591
- 'time' => 'c7e9d22e902893a',
1592
- 'clock_seq' => '27b8',
1593
- 'variant' => Variant::Rfc4122,
1594
- 'version' => Version::HashMd5,
1595
- ],
1596
- [
1597
- 'string' => 'eb424026-6f54-4ef8-a4d0-bb658a1fc6cf',
1598
- 'curly' => '{eb424026-6f54-4ef8-a4d0-bb658a1fc6cf}',
1599
- 'hex' => 'eb4240266f544ef8a4d0bb658a1fc6cf',
1600
- 'bytes' => '60JAJm9UTvik0Ltlih/Gzw==',
1601
- 'int' => '312712571721458096795100956955942831823',
1602
- 'fields' => [
1603
- 'time_low' => 'eb424026',
1604
- 'time_mid' => '6f54',
1605
- 'time_hi_and_version' => '4ef8',
1606
- 'clock_seq_hi_and_reserved' => 'a4',
1607
- 'clock_seq_low' => 'd0',
1608
- 'node' => 'bb658a1fc6cf',
1609
- ],
1610
- 'urn' => 'urn:uuid:eb424026-6f54-4ef8-a4d0-bb658a1fc6cf',
1611
- 'time' => 'ef86f54eb424026',
1612
- 'clock_seq' => '24d0',
1613
- 'variant' => Variant::Rfc4122,
1614
- 'version' => Version::Random,
1615
- ],
1616
- [
1617
- 'string' => 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6',
1618
- 'curly' => '{f81d4fae-7dec-11d0-a765-00a0c91e6bf6}',
1619
- 'hex' => 'f81d4fae7dec11d0a76500a0c91e6bf6',
1620
- 'bytes' => '+B1Prn3sEdCnZQCgyR5r9g==',
1621
- 'int' => '329800735698586629295641978511506172918',
1622
- 'fields' => [
1623
- 'time_low' => 'f81d4fae',
1624
- 'time_mid' => '7dec',
1625
- 'time_hi_and_version' => '11d0',
1626
- 'clock_seq_hi_and_reserved' => 'a7',
1627
- 'clock_seq_low' => '65',
1628
- 'node' => '00a0c91e6bf6',
1629
- ],
1630
- 'urn' => 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6',
1631
- 'time' => '1d07decf81d4fae',
1632
- 'clock_seq' => '2765',
1633
- 'variant' => Variant::Rfc4122,
1634
- 'version' => Version::Time,
1635
- ],
1636
- [
1637
- 'string' => 'fffefdfc-fffe-fffe-fffe-fffefdfcfbfa',
1638
- 'curly' => '{fffefdfc-fffe-fffe-fffe-fffefdfcfbfa}',
1639
- 'hex' => 'fffefdfcfffefffefffefffefdfcfbfa',
1640
- 'bytes' => '//79/P/+//7//v/+/fz7+g==',
1641
- 'int' => '340277133821575024845345576078114880506',
1642
- 'fields' => [
1643
- 'time_low' => 'fffefdfc',
1644
- 'time_mid' => 'fffe',
1645
- 'time_hi_and_version' => 'fffe',
1646
- 'clock_seq_hi_and_reserved' => 'ff',
1647
- 'clock_seq_low' => 'fe',
1648
- 'node' => 'fffefdfcfbfa',
1649
- ],
1650
- 'urn' => 'urn:uuid:fffefdfc-fffe-fffe-fffe-fffefdfcfbfa',
1651
- 'time' => 'ffefffefffefdfc',
1652
- 'clock_seq' => '3ffe',
1653
- 'variant' => Variant::ReservedFuture,
1654
- 'version' => null,
1655
- ],
1656
- [
1657
- 'string' => 'ffffffff-ffff-ffff-ffff-ffffffffffff',
1658
- 'curly' => '{ffffffff-ffff-ffff-ffff-ffffffffffff}',
1659
- 'hex' => 'ffffffffffffffffffffffffffffffff',
1660
- 'bytes' => '/////////////////////w==',
1661
- 'int' => '340282366920938463463374607431768211455',
1662
- 'fields' => [
1663
- 'time_low' => 'ffffffff',
1664
- 'time_mid' => 'ffff',
1665
- 'time_hi_and_version' => 'ffff',
1666
- 'clock_seq_hi_and_reserved' => 'ff',
1667
- 'clock_seq_low' => 'ff',
1668
- 'node' => 'ffffffffffff',
1669
- ],
1670
- 'urn' => 'urn:uuid:ffffffff-ffff-ffff-ffff-ffffffffffff',
1671
- 'time' => 'fffffffffffffff',
1672
- // This is a departure from the Python tests. The Python tests
1673
- // are technically "correct" because all bits are set to one,
1674
- // which ends up calculating the variant as 7, or "Reserved
1675
- // Future," but that is not the case, and now that max UUIDs
1676
- // are defined as a special type, within the RFC 4122 variant
1677
- // rules, we also consider it an RFC 4122 variant.
1678
- //
1679
- // Similarly, Python's tests think the clock sequence should be
1680
- // 0x3fff because of the bit shifting performed on this field.
1681
- // However, since all the bits in this UUID are defined as being
1682
- // set to one, we will consider the clock sequence as 0xffff,
1683
- // which all bits set to one.
1684
- 'clock_seq' => 'ffff',
1685
- 'variant' => Variant::Rfc4122,
1686
- 'version' => null,
1687
- ],
1688
- ];
1689
- }
1690
-
1691
- /**
1692
- * @covers \Ramsey\Uuid\Uuid::jsonSerialize
1693
- */
1694
- public function testJsonSerialize(): void
1695
- {
1696
- $uuid = Uuid::uuid1();
1697
-
1698
- $this->assertSame('"' . $uuid->toString() . '"', json_encode($uuid));
1699
- }
1700
-
1701
- public function testSerialize(): void
1702
- {
1703
- $uuid = Uuid::uuid4();
1704
- $serialized = serialize($uuid);
1705
-
1706
- /** @var UuidInterface $unserializedUuid */
1707
- $unserializedUuid = unserialize($serialized);
1708
-
1709
- $this->assertTrue($uuid->equals($unserializedUuid));
1710
- }
1711
-
1712
- public function testUuid3WithEmptyNamespace(): void
1713
- {
1714
- $this->expectException(InvalidArgumentException::class);
1715
- $this->expectExceptionMessage('Invalid UUID string:');
1716
-
1717
- /** @phpstan-ignore-next-line */
1718
- Uuid::uuid3('', '');
1719
- }
1720
-
1721
- public function testUuid3WithEmptyName(): void
1722
- {
1723
- $uuid = Uuid::uuid3(Uuid::NIL, '');
1724
-
1725
- $this->assertSame('4ae71336-e44b-39bf-b9d2-752e234818a5', $uuid->toString());
1726
- }
1727
-
1728
- public function testUuid3WithZeroName(): void
1729
- {
1730
- $uuid = Uuid::uuid3(Uuid::NIL, '0');
1731
-
1732
- $this->assertSame('19826852-5007-3022-a72a-212f66e9fac3', $uuid->toString());
1733
- }
1734
-
1735
- public function testUuid5WithEmptyNamespace(): void
1736
- {
1737
- $this->expectException(InvalidArgumentException::class);
1738
- $this->expectExceptionMessage('Invalid UUID string:');
1739
-
1740
- /** @phpstan-ignore-next-line */
1741
- Uuid::uuid5('', '');
1742
- }
1743
-
1744
- public function testUuid5WithEmptyName(): void
1745
- {
1746
- $uuid = Uuid::uuid5(Uuid::NIL, '');
1747
-
1748
- $this->assertSame('e129f27c-5103-5c5c-844b-cdf0a15e160d', $uuid->toString());
1749
- }
1750
-
1751
- public function testUuid5WithZeroName(): void
1752
- {
1753
- $uuid = Uuid::uuid5(Uuid::NIL, '0');
1754
-
1755
- $this->assertSame('b6c54489-38a0-5f50-a60a-fd8d76219cae', $uuid->toString());
1756
- }
1757
-
1758
- /**
1759
- * @depends testGetVersionForVersion1
1760
- */
1761
- public function testUuidVersionConstantForVersion1(): void
1762
- {
1763
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
1764
- $uuid = Uuid::fromString('ff6f8cb0-c57d-11e1-9b21-0800200c9a66');
1765
- $this->assertSame($uuid->getFields()->getVersion(), Version::Time);
1766
- }
1767
-
1768
- /**
1769
- * @depends testGetVersionForVersion2
1770
- */
1771
- public function testUuidVersionConstantForVersion2(): void
1772
- {
1773
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
1774
- $uuid = Uuid::fromString('6fa459ea-ee8a-2ca4-894e-db77e160355e');
1775
- $this->assertSame($uuid->getFields()->getVersion(), Version::DceSecurity);
1776
- }
1777
-
1778
- /**
1779
- * @depends testGetVersionForVersion3
1780
- */
1781
- public function testUuidVersionConstantForVersion3(): void
1782
- {
1783
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
1784
- $uuid = Uuid::fromString('6fa459ea-ee8a-3ca4-894e-db77e160355e');
1785
- $this->assertSame($uuid->getFields()->getVersion(), Version::HashMd5);
1786
- }
1787
-
1788
- /**
1789
- * @depends testGetVersionForVersion4
1790
- */
1791
- public function testUuidVersionConstantForVersion4(): void
1792
- {
1793
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
1794
- $uuid = Uuid::fromString('6fabf0bc-603a-42f2-925b-d9f779bd0032');
1795
- $this->assertSame($uuid->getFields()->getVersion(), Version::Random);
1796
- }
1797
-
1798
- /**
1799
- * @depends testGetVersionForVersion5
1800
- */
1801
- public function testUuidVersionConstantForVersion5(): void
1802
- {
1803
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
1804
- $uuid = Uuid::fromString('886313e1-3b8a-5372-9b90-0c9aee199e5d');
1805
- $this->assertSame($uuid->getFields()->getVersion(), Version::HashSha1);
1806
- }
1807
-
1808
- public function testUuidVersionConstantForVersion6(): void
1809
- {
1810
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
1811
- $uuid = Uuid::fromString('886313e1-3b8a-6372-9b90-0c9aee199e5d');
1812
- $this->assertSame($uuid->getFields()->getVersion(), Version::ReorderedTime);
1813
- }
1814
-
1815
- public function testUuidVersionConstantForVersion7(): void
1816
- {
1817
- /** @var \Ramsey\Uuid\Rfc4122\UuidInterface $uuid */
1818
- $uuid = Uuid::fromString('886313e1-3b8a-7372-9b90-0c9aee199e5d');
1819
- $this->assertSame($uuid->getFields()->getVersion(), Version::UnixTime);
1820
- }
1821
-
1822
- public function testGetDateTimeThrowsExceptionWhenDateTimeCannotParseDate(): void
1823
- {
1824
- $numberConverter = new GenericNumberConverter(new BrickMathCalculator());
1825
- $timeConverter = Mockery::mock(TimeConverterInterface::class);
1826
-
1827
- $timeConverter
1828
- ->shouldReceive('convertTime')
1829
- ->once()
1830
- ->andReturn(new Time(1234567890, '1234567'));
1831
-
1832
- $builder = new UuidBuilder($numberConverter, $timeConverter);
1833
- $codec = new StringCodec($builder);
1834
-
1835
- $factory = new UuidFactory();
1836
- $factory->setCodec($codec);
1837
-
1838
- $uuid = $factory->fromString('b1484596-25dc-11ea-978f-2e728ce88125');
1839
-
1840
- $this->expectException(DateTimeException::class);
1841
- $this->expectExceptionMessage(
1842
- 'Failed to parse time string (@1234567890.1234567) at position 18 (7): Unexpected character'
1843
- );
1844
-
1845
- /**
1846
- * @phpstan-ignore-next-line
1847
- */
1848
- $uuid->getDateTime();
1849
- }
1850
-
1851
- /**
1852
- * @param mixed[] $args
1853
- *
1854
- * @dataProvider provideStaticMethods
1855
- */
1856
- public function testStaticCreationMethodsReturnSpecificUuidInstances(
1857
- string $staticMethod,
1858
- array $args = []
1859
- ): void {
1860
- $this->assertInstanceOf(LazyUuidFromString::class, Uuid::$staticMethod(...$args));
1861
- }
1862
-
1863
- /**
1864
- * @param mixed[] $args
1865
- *
1866
- * @dataProvider provideStaticMethods
1867
- */
1868
- public function testUuidInstancesBuiltFromStringAreEquivalentToTheirGeneratedCounterparts(
1869
- string $staticMethod,
1870
- array $args = []
1871
- ): void {
1872
- $generated = Uuid::$staticMethod(...$args);
1873
-
1874
- self::assertSame(
1875
- (string) $generated,
1876
- (string) Uuid::fromString($generated->toString())
1877
- );
1878
- }
1879
-
1880
- /**
1881
- * @param mixed[] $args
1882
- *
1883
- * @dataProvider provideStaticMethods
1884
- */
1885
- public function testUuidInstancesBuiltFromBytesAreEquivalentToTheirGeneratedCounterparts(
1886
- string $staticMethod,
1887
- array $args = []
1888
- ): void {
1889
- $generated = Uuid::$staticMethod(...$args);
1890
-
1891
- self::assertSame(
1892
- (string) $generated,
1893
- (string) Uuid::fromBytes($generated->getBytes())
1894
- );
1895
- }
1896
-
1897
- /**
1898
- * @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification
1899
- */
1900
- public function provideStaticMethods(): array
1901
- {
1902
- return [
1903
- ['uuid1'],
1904
- ['uuid2', [Uuid::DCE_DOMAIN_PERSON]],
1905
- ['uuid3', [Uuid::NIL, 'foobar']],
1906
- ['uuid4'],
1907
- ['uuid5', [Uuid::NIL, 'foobar']],
1908
- ];
1909
- }
1910
- }