create-prisma-php-app 1.0.0 → 1.0.2

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 (577) hide show
  1. package/README.md +8 -0
  2. package/dist/index.js +1 -1
  3. package/dist/node_modules/prisma-client-php/index.js +1 -1
  4. package/package.json +11 -4
  5. package/vendor/brick/math/.editorconfig +0 -15
  6. package/vendor/brick/math/.gitattributes +0 -11
  7. package/vendor/brick/math/.github/FUNDING.yml +0 -1
  8. package/vendor/brick/math/.github/workflows/ci.yml +0 -80
  9. package/vendor/brick/math/CHANGELOG.md +0 -445
  10. package/vendor/brick/math/LICENSE +0 -20
  11. package/vendor/brick/math/README.md +0 -247
  12. package/vendor/brick/math/composer.json +0 -34
  13. package/vendor/brick/math/phpunit.php +0 -51
  14. package/vendor/brick/math/phpunit.xml +0 -13
  15. package/vendor/brick/math/psalm.xml +0 -28
  16. package/vendor/brick/math/random-tests.php +0 -162
  17. package/vendor/brick/math/src/BigDecimal.php +0 -786
  18. package/vendor/brick/math/src/BigInteger.php +0 -1079
  19. package/vendor/brick/math/src/BigNumber.php +0 -512
  20. package/vendor/brick/math/src/BigRational.php +0 -445
  21. package/vendor/brick/math/src/Exception/DivisionByZeroException.php +0 -35
  22. package/vendor/brick/math/src/Exception/IntegerOverflowException.php +0 -23
  23. package/vendor/brick/math/src/Exception/MathException.php +0 -12
  24. package/vendor/brick/math/src/Exception/NegativeNumberException.php +0 -12
  25. package/vendor/brick/math/src/Exception/NumberFormatException.php +0 -33
  26. package/vendor/brick/math/src/Exception/RoundingNecessaryException.php +0 -19
  27. package/vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php +0 -75
  28. package/vendor/brick/math/src/Internal/Calculator/GmpCalculator.php +0 -108
  29. package/vendor/brick/math/src/Internal/Calculator/NativeCalculator.php +0 -581
  30. package/vendor/brick/math/src/Internal/Calculator.php +0 -676
  31. package/vendor/brick/math/src/RoundingMode.php +0 -107
  32. package/vendor/brick/math/tests/AbstractTestCase.php +0 -86
  33. package/vendor/brick/math/tests/BigDecimalTest.php +0 -2596
  34. package/vendor/brick/math/tests/BigIntegerTest.php +0 -3782
  35. package/vendor/brick/math/tests/BigNumberTest.php +0 -53
  36. package/vendor/brick/math/tests/BigRationalTest.php +0 -993
  37. package/vendor/brick/math/tests/CalculatorDetectTest.php +0 -25
  38. package/vendor/brick/math/tests/Internal/Calculator/NativeCalculatorTest.php +0 -87
  39. package/vendor/firebase/php-jwt/.gitattributes +0 -9
  40. package/vendor/firebase/php-jwt/.github/release-please.yml +0 -3
  41. package/vendor/firebase/php-jwt/.github/workflows/tests.yml +0 -57
  42. package/vendor/firebase/php-jwt/.php-cs-fixer.dist.php +0 -24
  43. package/vendor/firebase/php-jwt/CHANGELOG.md +0 -170
  44. package/vendor/firebase/php-jwt/LICENSE +0 -30
  45. package/vendor/firebase/php-jwt/README.md +0 -424
  46. package/vendor/firebase/php-jwt/composer.json +0 -42
  47. package/vendor/firebase/php-jwt/phpstan.neon.dist +0 -5
  48. package/vendor/firebase/php-jwt/phpunit.xml.dist +0 -18
  49. package/vendor/firebase/php-jwt/src/BeforeValidException.php +0 -18
  50. package/vendor/firebase/php-jwt/src/CachedKeySet.php +0 -268
  51. package/vendor/firebase/php-jwt/src/ExpiredException.php +0 -18
  52. package/vendor/firebase/php-jwt/src/JWK.php +0 -349
  53. package/vendor/firebase/php-jwt/src/JWT.php +0 -669
  54. package/vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php +0 -20
  55. package/vendor/firebase/php-jwt/src/Key.php +0 -64
  56. package/vendor/firebase/php-jwt/src/SignatureInvalidException.php +0 -7
  57. package/vendor/firebase/php-jwt/tests/CachedKeySetTest.php +0 -598
  58. package/vendor/firebase/php-jwt/tests/JWKTest.php +0 -172
  59. package/vendor/firebase/php-jwt/tests/JWTTest.php +0 -543
  60. package/vendor/firebase/php-jwt/tests/data/ec-jwkset.json +0 -40
  61. package/vendor/firebase/php-jwt/tests/data/ecdsa-private.pem +0 -18
  62. package/vendor/firebase/php-jwt/tests/data/ecdsa-public.pem +0 -9
  63. package/vendor/firebase/php-jwt/tests/data/ecdsa256-private.pem +0 -4
  64. package/vendor/firebase/php-jwt/tests/data/ecdsa384-private.pem +0 -6
  65. package/vendor/firebase/php-jwt/tests/data/ecdsa384-public.pem +0 -5
  66. package/vendor/firebase/php-jwt/tests/data/ed25519-1.pub +0 -1
  67. package/vendor/firebase/php-jwt/tests/data/ed25519-1.sec +0 -1
  68. package/vendor/firebase/php-jwt/tests/data/ed25519-jwkset.json +0 -11
  69. package/vendor/firebase/php-jwt/tests/data/rsa-jwkset.json +0 -18
  70. package/vendor/firebase/php-jwt/tests/data/rsa-with-passphrase.pem +0 -42
  71. package/vendor/firebase/php-jwt/tests/data/rsa1-private.pem +0 -27
  72. package/vendor/firebase/php-jwt/tests/data/rsa1-public.pub +0 -9
  73. package/vendor/firebase/php-jwt/tests/data/rsa2-private.pem +0 -27
  74. package/vendor/firebase/php-jwt/tests/data/secp256k1-private.pem +0 -5
  75. package/vendor/firebase/php-jwt/tests/data/secp256k1-public.pem +0 -4
  76. package/vendor/graham-campbell/result-type/.gitattributes +0 -9
  77. package/vendor/graham-campbell/result-type/.github/CODE_OF_CONDUCT.md +0 -132
  78. package/vendor/graham-campbell/result-type/.github/CONTRIBUTING.md +0 -31
  79. package/vendor/graham-campbell/result-type/.github/FUNDING.yml +0 -2
  80. package/vendor/graham-campbell/result-type/.github/SECURITY.md +0 -14
  81. package/vendor/graham-campbell/result-type/.github/workflows/tests.yml +0 -40
  82. package/vendor/graham-campbell/result-type/CHANGELOG.md +0 -43
  83. package/vendor/graham-campbell/result-type/LICENSE +0 -21
  84. package/vendor/graham-campbell/result-type/README.md +0 -42
  85. package/vendor/graham-campbell/result-type/composer.json +0 -33
  86. package/vendor/graham-campbell/result-type/phpunit.xml.dist +0 -13
  87. package/vendor/graham-campbell/result-type/src/Error.php +0 -121
  88. package/vendor/graham-campbell/result-type/src/Result.php +0 -69
  89. package/vendor/graham-campbell/result-type/src/Success.php +0 -120
  90. package/vendor/graham-campbell/result-type/tests/ResultTest.php +0 -95
  91. package/vendor/hidehalo/nanoid-php/.editorconfig +0 -15
  92. package/vendor/hidehalo/nanoid-php/.gitattributes +0 -8
  93. package/vendor/hidehalo/nanoid-php/.github/workflows/php.yml +0 -49
  94. package/vendor/hidehalo/nanoid-php/.styleci.yml +0 -1
  95. package/vendor/hidehalo/nanoid-php/CHANGELOG.md +0 -36
  96. package/vendor/hidehalo/nanoid-php/CODE_OF_CONDUCT.md +0 -74
  97. package/vendor/hidehalo/nanoid-php/CONTRIBUTING.md +0 -32
  98. package/vendor/hidehalo/nanoid-php/ISSUE_TEMPLATE.md +0 -27
  99. package/vendor/hidehalo/nanoid-php/LICENSE.md +0 -21
  100. package/vendor/hidehalo/nanoid-php/PULL_REQUEST_TEMPLATE.md +0 -43
  101. package/vendor/hidehalo/nanoid-php/README.md +0 -108
  102. package/vendor/hidehalo/nanoid-php/benchmark/benchmark.php +0 -24
  103. package/vendor/hidehalo/nanoid-php/composer.json +0 -62
  104. package/vendor/hidehalo/nanoid-php/examples/basic_usage.php +0 -24
  105. package/vendor/hidehalo/nanoid-php/examples/custom_formated.php +0 -29
  106. package/vendor/hidehalo/nanoid-php/phpunit.xml +0 -31
  107. package/vendor/hidehalo/nanoid-php/src/Client.php +0 -120
  108. package/vendor/hidehalo/nanoid-php/src/Core.php +0 -31
  109. package/vendor/hidehalo/nanoid-php/src/CoreInterface.php +0 -19
  110. package/vendor/hidehalo/nanoid-php/src/Generator.php +0 -13
  111. package/vendor/hidehalo/nanoid-php/src/GeneratorInterface.php +0 -13
  112. package/vendor/hidehalo/nanoid-php/tests/ClientTest.php +0 -76
  113. package/vendor/hidehalo/nanoid-php/tests/CoreTest.php +0 -37
  114. package/vendor/hidehalo/nanoid-php/tests/GeneratorTest.php +0 -34
  115. package/vendor/hidehalo/nanoid-php/tests/Support/DummyGenerator.php +0 -20
  116. package/vendor/paragonie/random_compat/.gitattributes +0 -14
  117. package/vendor/paragonie/random_compat/.scrutinizer.yml +0 -4
  118. package/vendor/paragonie/random_compat/.travis.yml +0 -59
  119. package/vendor/paragonie/random_compat/CHANGELOG.md +0 -3
  120. package/vendor/paragonie/random_compat/LICENSE +0 -22
  121. package/vendor/paragonie/random_compat/RATIONALE.md +0 -36
  122. package/vendor/paragonie/random_compat/README.md +0 -232
  123. package/vendor/paragonie/random_compat/SECURITY.md +0 -108
  124. package/vendor/paragonie/random_compat/build-phar.sh +0 -5
  125. package/vendor/paragonie/random_compat/composer.json +0 -34
  126. package/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey +0 -5
  127. package/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc +0 -11
  128. package/vendor/paragonie/random_compat/lib/random.php +0 -32
  129. package/vendor/paragonie/random_compat/other/build_phar.php +0 -57
  130. package/vendor/paragonie/random_compat/other/ide_stubs/COM.php +0 -20
  131. package/vendor/paragonie/random_compat/other/ide_stubs/README.md +0 -7
  132. package/vendor/paragonie/random_compat/other/ide_stubs/com_exception.php +0 -11
  133. package/vendor/paragonie/random_compat/other/ide_stubs/libsodium.php +0 -90
  134. package/vendor/paragonie/random_compat/phpunit.sh +0 -60
  135. package/vendor/paragonie/random_compat/phpunit.xml.dist +0 -31
  136. package/vendor/paragonie/random_compat/psalm-autoload.php +0 -9
  137. package/vendor/paragonie/random_compat/psalm.xml +0 -19
  138. package/vendor/paragonie/random_compat/tests/full/DieHardTest.php +0 -61
  139. package/vendor/paragonie/random_compat/tests/full/StatTest.php +0 -52
  140. package/vendor/paragonie/random_compat/tests/specific/capicom.php +0 -7
  141. package/vendor/paragonie/random_compat/tests/specific/dev_urandom.php +0 -7
  142. package/vendor/paragonie/random_compat/tests/specific/libsodium.php +0 -7
  143. package/vendor/paragonie/random_compat/tests/specific/libsodium_legacy.php +0 -7
  144. package/vendor/paragonie/random_compat/tests/specific/mcrypt.php +0 -7
  145. package/vendor/paragonie/random_compat/tests/unit/RandomBytesTest.php +0 -80
  146. package/vendor/paragonie/random_compat/tests/unit/RandomIntTest.php +0 -63
  147. package/vendor/paragonie/random_compat/tests/unit/UtilityTest.php +0 -95
  148. package/vendor/paragonie/random_compat/tests/unit_with_basedir/RandomBytesTest.php +0 -100
  149. package/vendor/paragonie/random_compat/tests/unit_with_basedir/RandomIntTest.php +0 -82
  150. package/vendor/paragonie/random_compat/tests/unit_with_basedir/UtilityTest.php +0 -95
  151. package/vendor/phpoption/phpoption/.gitattributes +0 -14
  152. package/vendor/phpoption/phpoption/.github/CODE_OF_CONDUCT.md +0 -132
  153. package/vendor/phpoption/phpoption/.github/CONTRIBUTING.md +0 -30
  154. package/vendor/phpoption/phpoption/.github/FUNDING.yml +0 -2
  155. package/vendor/phpoption/phpoption/.github/SECURITY.md +0 -14
  156. package/vendor/phpoption/phpoption/.github/workflows/static.yml +0 -74
  157. package/vendor/phpoption/phpoption/.github/workflows/tests.yml +0 -40
  158. package/vendor/phpoption/phpoption/LICENSE +0 -201
  159. package/vendor/phpoption/phpoption/Makefile +0 -26
  160. package/vendor/phpoption/phpoption/README.md +0 -194
  161. package/vendor/phpoption/phpoption/composer.json +0 -52
  162. package/vendor/phpoption/phpoption/phpstan-baseline.neon +0 -32
  163. package/vendor/phpoption/phpoption/phpstan.neon.dist +0 -8
  164. package/vendor/phpoption/phpoption/phpunit.xml.dist +0 -13
  165. package/vendor/phpoption/phpoption/psalm.xml +0 -12
  166. package/vendor/phpoption/phpoption/src/PhpOption/LazyOption.php +0 -175
  167. package/vendor/phpoption/phpoption/src/PhpOption/None.php +0 -136
  168. package/vendor/phpoption/phpoption/src/PhpOption/Option.php +0 -434
  169. package/vendor/phpoption/phpoption/src/PhpOption/Some.php +0 -169
  170. package/vendor/phpoption/phpoption/tests/PhpOption/Tests/EnsureTest.php +0 -77
  171. package/vendor/phpoption/phpoption/tests/PhpOption/Tests/LazyOptionTest.php +0 -200
  172. package/vendor/phpoption/phpoption/tests/PhpOption/Tests/NoneTest.php +0 -153
  173. package/vendor/phpoption/phpoption/tests/PhpOption/Tests/OptionTest.php +0 -160
  174. package/vendor/phpoption/phpoption/tests/PhpOption/Tests/SomeTest.php +0 -194
  175. package/vendor/phpoption/phpoption/tests/bootstrap.php +0 -8
  176. package/vendor/phpoption/phpoption/vendor-bin/phpstan/composer.json +0 -8
  177. package/vendor/phpoption/phpoption/vendor-bin/psalm/composer.json +0 -8
  178. package/vendor/ramsey/uuid/.editorconfig +0 -16
  179. package/vendor/ramsey/uuid/.gitattributes +0 -26
  180. package/vendor/ramsey/uuid/.github/CODEOWNERS +0 -1
  181. package/vendor/ramsey/uuid/.github/FUNDING.yml +0 -2
  182. package/vendor/ramsey/uuid/.github/ISSUE_TEMPLATE/Bug_Report.md +0 -35
  183. package/vendor/ramsey/uuid/.github/ISSUE_TEMPLATE/Feature_Request.md +0 -31
  184. package/vendor/ramsey/uuid/.github/ISSUE_TEMPLATE/Question.md +0 -19
  185. package/vendor/ramsey/uuid/.github/ISSUE_TEMPLATE/config.yml +0 -1
  186. package/vendor/ramsey/uuid/.github/dependabot.yml +0 -15
  187. package/vendor/ramsey/uuid/.github/pull_request_template.md +0 -27
  188. package/vendor/ramsey/uuid/.github/workflows/continuous-integration.yml +0 -181
  189. package/vendor/ramsey/uuid/.github/workflows/merge-dependabot-upgrades.yml +0 -24
  190. package/vendor/ramsey/uuid/.readthedocs.yml +0 -11
  191. package/vendor/ramsey/uuid/CHANGELOG.md +0 -1511
  192. package/vendor/ramsey/uuid/CODE_OF_CONDUCT.md +0 -73
  193. package/vendor/ramsey/uuid/CONTRIBUTING.md +0 -171
  194. package/vendor/ramsey/uuid/LICENSE +0 -19
  195. package/vendor/ramsey/uuid/README.md +0 -83
  196. package/vendor/ramsey/uuid/SECURITY.md +0 -170
  197. package/vendor/ramsey/uuid/build/.gitignore +0 -6
  198. package/vendor/ramsey/uuid/build/cache/.gitkeep +0 -0
  199. package/vendor/ramsey/uuid/build/logs/.gitkeep +0 -0
  200. package/vendor/ramsey/uuid/captainhook.json +0 -105
  201. package/vendor/ramsey/uuid/codecov.yml +0 -29
  202. package/vendor/ramsey/uuid/composer.json +0 -106
  203. package/vendor/ramsey/uuid/composer.lock +0 -7208
  204. package/vendor/ramsey/uuid/docs/Makefile +0 -20
  205. package/vendor/ramsey/uuid/docs/README.md +0 -36
  206. package/vendor/ramsey/uuid/docs/_static/.gitkeep +0 -0
  207. package/vendor/ramsey/uuid/docs/conf.py +0 -103
  208. package/vendor/ramsey/uuid/docs/copyright.rst +0 -18
  209. package/vendor/ramsey/uuid/docs/customize/calculators.rst +0 -75
  210. package/vendor/ramsey/uuid/docs/customize/factory.rst +0 -93
  211. package/vendor/ramsey/uuid/docs/customize/ordered-time-codec.rst +0 -86
  212. package/vendor/ramsey/uuid/docs/customize/timestamp-first-comb-codec.rst +0 -72
  213. package/vendor/ramsey/uuid/docs/customize/validators.rst +0 -39
  214. package/vendor/ramsey/uuid/docs/customize.rst +0 -56
  215. package/vendor/ramsey/uuid/docs/database.rst +0 -260
  216. package/vendor/ramsey/uuid/docs/faq.rst +0 -132
  217. package/vendor/ramsey/uuid/docs/index.rst +0 -51
  218. package/vendor/ramsey/uuid/docs/introduction.rst +0 -31
  219. package/vendor/ramsey/uuid/docs/nonstandard/guid.rst +0 -152
  220. package/vendor/ramsey/uuid/docs/nonstandard/other.rst +0 -49
  221. package/vendor/ramsey/uuid/docs/nonstandard/version6.rst +0 -17
  222. package/vendor/ramsey/uuid/docs/nonstandard.rst +0 -40
  223. package/vendor/ramsey/uuid/docs/quickstart.rst +0 -112
  224. package/vendor/ramsey/uuid/docs/reference/calculators.rst +0 -168
  225. package/vendor/ramsey/uuid/docs/reference/exceptions.rst +0 -92
  226. package/vendor/ramsey/uuid/docs/reference/fields-fieldsinterface.rst +0 -16
  227. package/vendor/ramsey/uuid/docs/reference/guid-fields.rst +0 -13
  228. package/vendor/ramsey/uuid/docs/reference/guid-guid.rst +0 -20
  229. package/vendor/ramsey/uuid/docs/reference/helper.rst +0 -62
  230. package/vendor/ramsey/uuid/docs/reference/name-based-namespaces.rst +0 -31
  231. package/vendor/ramsey/uuid/docs/reference/nonstandard-fields.rst +0 -13
  232. package/vendor/ramsey/uuid/docs/reference/nonstandard-uuid.rst +0 -20
  233. package/vendor/ramsey/uuid/docs/reference/nonstandard-uuidv6.rst +0 -34
  234. package/vendor/ramsey/uuid/docs/reference/rfc4122-fieldsinterface.rst +0 -78
  235. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidinterface.rst +0 -20
  236. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv1.rst +0 -21
  237. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv2.rst +0 -47
  238. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv3.rst +0 -13
  239. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv4.rst +0 -13
  240. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv5.rst +0 -13
  241. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv6.rst +0 -31
  242. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv7.rst +0 -20
  243. package/vendor/ramsey/uuid/docs/reference/rfc4122-uuidv8.rst +0 -13
  244. package/vendor/ramsey/uuid/docs/reference/rfc4122-version.rst +0 -87
  245. package/vendor/ramsey/uuid/docs/reference/timebaseduuidinterface.rst +0 -16
  246. package/vendor/ramsey/uuid/docs/reference/types.rst +0 -79
  247. package/vendor/ramsey/uuid/docs/reference/uuid.rst +0 -161
  248. package/vendor/ramsey/uuid/docs/reference/uuidfactoryinterface.rst +0 -102
  249. package/vendor/ramsey/uuid/docs/reference/uuidinterface.rst +0 -60
  250. package/vendor/ramsey/uuid/docs/reference/validators.rst +0 -34
  251. package/vendor/ramsey/uuid/docs/reference/variant.rst +0 -32
  252. package/vendor/ramsey/uuid/docs/reference.rst +0 -37
  253. package/vendor/ramsey/uuid/docs/requirements.txt +0 -3
  254. package/vendor/ramsey/uuid/docs/rfc4122/version1.rst +0 -192
  255. package/vendor/ramsey/uuid/docs/rfc4122/version2.rst +0 -273
  256. package/vendor/ramsey/uuid/docs/rfc4122/version3.rst +0 -68
  257. package/vendor/ramsey/uuid/docs/rfc4122/version4.rst +0 -39
  258. package/vendor/ramsey/uuid/docs/rfc4122/version5.rst +0 -108
  259. package/vendor/ramsey/uuid/docs/rfc4122/version6.rst +0 -213
  260. package/vendor/ramsey/uuid/docs/rfc4122/version7.rst +0 -173
  261. package/vendor/ramsey/uuid/docs/rfc4122/version8.rst +0 -51
  262. package/vendor/ramsey/uuid/docs/rfc4122.rst +0 -67
  263. package/vendor/ramsey/uuid/docs/testing.rst +0 -199
  264. package/vendor/ramsey/uuid/docs/tidelift.rst +0 -74
  265. package/vendor/ramsey/uuid/docs/upgrading/2-to-3.rst +0 -31
  266. package/vendor/ramsey/uuid/docs/upgrading/3-to-4.rst +0 -512
  267. package/vendor/ramsey/uuid/docs/upgrading.rst +0 -11
  268. package/vendor/ramsey/uuid/phpbench.json +0 -10
  269. package/vendor/ramsey/uuid/phpcs.xml.dist +0 -476
  270. package/vendor/ramsey/uuid/phpstan-tests.neon +0 -32
  271. package/vendor/ramsey/uuid/phpstan.neon.dist +0 -25
  272. package/vendor/ramsey/uuid/phpunit.xml.dist +0 -26
  273. package/vendor/ramsey/uuid/psalm-baseline.xml +0 -133
  274. package/vendor/ramsey/uuid/psalm.xml +0 -25
  275. package/vendor/ramsey/uuid/resources/vagrant/README.md +0 -10
  276. package/vendor/ramsey/uuid/resources/vagrant/freebsd/README.md +0 -15
  277. package/vendor/ramsey/uuid/resources/vagrant/freebsd/Vagrantfile +0 -35
  278. package/vendor/ramsey/uuid/resources/vagrant/linux/README.md +0 -15
  279. package/vendor/ramsey/uuid/resources/vagrant/linux/Vagrantfile +0 -27
  280. package/vendor/ramsey/uuid/resources/vagrant/windows/README.md +0 -16
  281. package/vendor/ramsey/uuid/resources/vagrant/windows/Vagrantfile +0 -22
  282. package/vendor/ramsey/uuid/src/BinaryUtils.php +0 -106
  283. package/vendor/ramsey/uuid/src/Builder/FallbackBuilder.php +0 -68
  284. package/vendor/ramsey/uuid/src/Builder/UuidBuilderInterface.php +0 -39
  285. package/vendor/ramsey/uuid/src/Codec/CodecInterface.php +0 -67
  286. package/vendor/ramsey/uuid/src/Codec/GuidStringCodec.php +0 -82
  287. package/vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php +0 -114
  288. package/vendor/ramsey/uuid/src/Codec/StringCodec.php +0 -128
  289. package/vendor/ramsey/uuid/src/Codec/TimestampFirstCombCodec.php +0 -105
  290. package/vendor/ramsey/uuid/src/Codec/TimestampLastCombCodec.php +0 -51
  291. package/vendor/ramsey/uuid/src/Converter/Number/GenericNumberConverter.php +0 -48
  292. package/vendor/ramsey/uuid/src/Converter/NumberConverterInterface.php +0 -53
  293. package/vendor/ramsey/uuid/src/Converter/Time/GenericTimeConverter.php +0 -118
  294. package/vendor/ramsey/uuid/src/Converter/Time/PhpTimeConverter.php +0 -163
  295. package/vendor/ramsey/uuid/src/Converter/Time/UnixTimeConverter.php +0 -90
  296. package/vendor/ramsey/uuid/src/Converter/TimeConverterInterface.php +0 -58
  297. package/vendor/ramsey/uuid/src/Exception/BuilderNotFoundException.php +0 -24
  298. package/vendor/ramsey/uuid/src/Exception/DateTimeException.php +0 -24
  299. package/vendor/ramsey/uuid/src/Exception/DceSecurityException.php +0 -25
  300. package/vendor/ramsey/uuid/src/Exception/InvalidArgumentException.php +0 -24
  301. package/vendor/ramsey/uuid/src/Exception/InvalidBytesException.php +0 -24
  302. package/vendor/ramsey/uuid/src/Exception/InvalidUuidStringException.php +0 -25
  303. package/vendor/ramsey/uuid/src/Exception/NameException.php +0 -25
  304. package/vendor/ramsey/uuid/src/Exception/NodeException.php +0 -24
  305. package/vendor/ramsey/uuid/src/Exception/RandomSourceException.php +0 -27
  306. package/vendor/ramsey/uuid/src/Exception/TimeSourceException.php +0 -24
  307. package/vendor/ramsey/uuid/src/Exception/UnableToBuildUuidException.php +0 -24
  308. package/vendor/ramsey/uuid/src/Exception/UnsupportedOperationException.php +0 -24
  309. package/vendor/ramsey/uuid/src/Exception/UuidExceptionInterface.php +0 -21
  310. package/vendor/ramsey/uuid/src/FeatureSet.php +0 -395
  311. package/vendor/ramsey/uuid/src/Fields/FieldsInterface.php +0 -42
  312. package/vendor/ramsey/uuid/src/Fields/SerializableFieldsTrait.php +0 -70
  313. package/vendor/ramsey/uuid/src/Generator/CombGenerator.php +0 -124
  314. package/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php +0 -139
  315. package/vendor/ramsey/uuid/src/Generator/DceSecurityGeneratorInterface.php +0 -53
  316. package/vendor/ramsey/uuid/src/Generator/DefaultNameGenerator.php +0 -51
  317. package/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php +0 -131
  318. package/vendor/ramsey/uuid/src/Generator/NameGeneratorFactory.php +0 -30
  319. package/vendor/ramsey/uuid/src/Generator/NameGeneratorInterface.php +0 -38
  320. package/vendor/ramsey/uuid/src/Generator/PeclUuidNameGenerator.php +0 -52
  321. package/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php +0 -37
  322. package/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php +0 -39
  323. package/vendor/ramsey/uuid/src/Generator/RandomBytesGenerator.php +0 -45
  324. package/vendor/ramsey/uuid/src/Generator/RandomGeneratorFactory.php +0 -30
  325. package/vendor/ramsey/uuid/src/Generator/RandomGeneratorInterface.php +0 -31
  326. package/vendor/ramsey/uuid/src/Generator/TimeGeneratorFactory.php +0 -45
  327. package/vendor/ramsey/uuid/src/Generator/TimeGeneratorInterface.php +0 -38
  328. package/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php +0 -170
  329. package/vendor/ramsey/uuid/src/Guid/Fields.php +0 -208
  330. package/vendor/ramsey/uuid/src/Guid/Guid.php +0 -61
  331. package/vendor/ramsey/uuid/src/Guid/GuidBuilder.php +0 -79
  332. package/vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php +0 -226
  333. package/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php +0 -145
  334. package/vendor/ramsey/uuid/src/Math/CalculatorInterface.php +0 -106
  335. package/vendor/ramsey/uuid/src/Math/RoundingMode.php +0 -146
  336. package/vendor/ramsey/uuid/src/Nonstandard/Fields.php +0 -154
  337. package/vendor/ramsey/uuid/src/Nonstandard/Uuid.php +0 -37
  338. package/vendor/ramsey/uuid/src/Nonstandard/UuidBuilder.php +0 -78
  339. package/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php +0 -113
  340. package/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php +0 -236
  341. package/vendor/ramsey/uuid/src/Provider/DceSecurityProviderInterface.php +0 -41
  342. package/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php +0 -54
  343. package/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php +0 -69
  344. package/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php +0 -74
  345. package/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php +0 -190
  346. package/vendor/ramsey/uuid/src/Provider/NodeProviderInterface.php +0 -30
  347. package/vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php +0 -57
  348. package/vendor/ramsey/uuid/src/Provider/Time/SystemTimeProvider.php +0 -33
  349. package/vendor/ramsey/uuid/src/Provider/TimeProviderInterface.php +0 -28
  350. package/vendor/ramsey/uuid/src/Rfc4122/Fields.php +0 -214
  351. package/vendor/ramsey/uuid/src/Rfc4122/FieldsInterface.php +0 -129
  352. package/vendor/ramsey/uuid/src/Rfc4122/MaxTrait.php +0 -41
  353. package/vendor/ramsey/uuid/src/Rfc4122/MaxUuid.php +0 -27
  354. package/vendor/ramsey/uuid/src/Rfc4122/NilTrait.php +0 -41
  355. package/vendor/ramsey/uuid/src/Rfc4122/NilUuid.php +0 -27
  356. package/vendor/ramsey/uuid/src/Rfc4122/TimeTrait.php +0 -55
  357. package/vendor/ramsey/uuid/src/Rfc4122/UuidBuilder.php +0 -116
  358. package/vendor/ramsey/uuid/src/Rfc4122/UuidInterface.php +0 -30
  359. package/vendor/ramsey/uuid/src/Rfc4122/UuidV1.php +0 -61
  360. package/vendor/ramsey/uuid/src/Rfc4122/UuidV2.php +0 -119
  361. package/vendor/ramsey/uuid/src/Rfc4122/UuidV3.php +0 -58
  362. package/vendor/ramsey/uuid/src/Rfc4122/UuidV4.php +0 -58
  363. package/vendor/ramsey/uuid/src/Rfc4122/UuidV5.php +0 -58
  364. package/vendor/ramsey/uuid/src/Rfc4122/UuidV6.php +0 -30
  365. package/vendor/ramsey/uuid/src/Rfc4122/UuidV7.php +0 -63
  366. package/vendor/ramsey/uuid/src/Rfc4122/UuidV8.php +0 -65
  367. package/vendor/ramsey/uuid/src/Rfc4122/Validator.php +0 -45
  368. package/vendor/ramsey/uuid/src/Rfc4122/VariantTrait.php +0 -87
  369. package/vendor/ramsey/uuid/src/Rfc4122/Version.php +0 -139
  370. package/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php +0 -57
  371. package/vendor/ramsey/uuid/src/TimeBasedUuidFactoryInterface.php +0 -48
  372. package/vendor/ramsey/uuid/src/TimeBasedUuidInterface.php +0 -30
  373. package/vendor/ramsey/uuid/src/Type/Decimal.php +0 -135
  374. package/vendor/ramsey/uuid/src/Type/Hexadecimal.php +0 -109
  375. package/vendor/ramsey/uuid/src/Type/Integer.php +0 -145
  376. package/vendor/ramsey/uuid/src/Type/NumberInterface.php +0 -28
  377. package/vendor/ramsey/uuid/src/Type/Time.php +0 -108
  378. package/vendor/ramsey/uuid/src/Type/TypeInterface.php +0 -45
  379. package/vendor/ramsey/uuid/src/Uuid.php +0 -645
  380. package/vendor/ramsey/uuid/src/UuidFactory.php +0 -503
  381. package/vendor/ramsey/uuid/src/UuidFactoryInterface.php +0 -184
  382. package/vendor/ramsey/uuid/src/UuidInterface.php +0 -114
  383. package/vendor/ramsey/uuid/src/Validator/GenericValidator.php +0 -45
  384. package/vendor/ramsey/uuid/src/Validator/ValidatorInterface.php +0 -39
  385. package/vendor/ramsey/uuid/src/Variant.php +0 -60
  386. package/vendor/ramsey/uuid/src/functions.php +0 -160
  387. package/vendor/ramsey/uuid/tests/BinaryUtilsTest.php +0 -381
  388. package/vendor/ramsey/uuid/tests/Builder/FallbackBuilderTest.php +0 -198
  389. package/vendor/ramsey/uuid/tests/Codec/GuidStringCodecTest.php +0 -118
  390. package/vendor/ramsey/uuid/tests/Codec/OrderedTimeCodecTest.php +0 -258
  391. package/vendor/ramsey/uuid/tests/Codec/StringCodecTest.php +0 -149
  392. package/vendor/ramsey/uuid/tests/Converter/Number/GenericNumberConverterTest.php +0 -28
  393. package/vendor/ramsey/uuid/tests/Converter/Time/GenericTimeConverterTest.php +0 -147
  394. package/vendor/ramsey/uuid/tests/Converter/Time/PhpTimeConverterTest.php +0 -199
  395. package/vendor/ramsey/uuid/tests/Converter/Time/UnixTimeConverterTest.php +0 -202
  396. package/vendor/ramsey/uuid/tests/Encoder/TimestampFirstCombCodecTest.php +0 -105
  397. package/vendor/ramsey/uuid/tests/Encoder/TimestampLastCombCodecTest.php +0 -106
  398. package/vendor/ramsey/uuid/tests/ExpectedBehaviorTest.php +0 -573
  399. package/vendor/ramsey/uuid/tests/FeatureSetTest.php +0 -88
  400. package/vendor/ramsey/uuid/tests/FunctionsTest.php +0 -151
  401. package/vendor/ramsey/uuid/tests/Generator/CombGeneratorTest.php +0 -134
  402. package/vendor/ramsey/uuid/tests/Generator/DceSecurityGeneratorTest.php +0 -282
  403. package/vendor/ramsey/uuid/tests/Generator/DefaultNameGeneratorTest.php +0 -83
  404. package/vendor/ramsey/uuid/tests/Generator/DefaultTimeGeneratorTest.php +0 -202
  405. package/vendor/ramsey/uuid/tests/Generator/NameGeneratorFactoryTest.php +0 -19
  406. package/vendor/ramsey/uuid/tests/Generator/PeclUuidNameGeneratorTest.php +0 -107
  407. package/vendor/ramsey/uuid/tests/Generator/PeclUuidRandomGeneratorTest.php +0 -30
  408. package/vendor/ramsey/uuid/tests/Generator/PeclUuidTimeGeneratorTest.php +0 -30
  409. package/vendor/ramsey/uuid/tests/Generator/RandomBytesGeneratorTest.php +0 -70
  410. package/vendor/ramsey/uuid/tests/Generator/RandomGeneratorFactoryTest.php +0 -19
  411. package/vendor/ramsey/uuid/tests/Generator/TimeGeneratorFactoryTest.php +0 -33
  412. package/vendor/ramsey/uuid/tests/Generator/UnixTimeGeneratorTest.php +0 -204
  413. package/vendor/ramsey/uuid/tests/Guid/FieldsTest.php +0 -235
  414. package/vendor/ramsey/uuid/tests/Guid/GuidBuilderTest.php +0 -33
  415. package/vendor/ramsey/uuid/tests/Math/BrickMathCalculatorTest.php +0 -116
  416. package/vendor/ramsey/uuid/tests/Nonstandard/FieldsTest.php +0 -84
  417. package/vendor/ramsey/uuid/tests/Nonstandard/UuidBuilderTest.php +0 -33
  418. package/vendor/ramsey/uuid/tests/Nonstandard/UuidV6Test.php +0 -192
  419. package/vendor/ramsey/uuid/tests/Provider/Dce/SystemDceSecurityProviderTest.php +0 -505
  420. package/vendor/ramsey/uuid/tests/Provider/Node/FallbackNodeProviderTest.php +0 -87
  421. package/vendor/ramsey/uuid/tests/Provider/Node/RandomNodeProviderTest.php +0 -124
  422. package/vendor/ramsey/uuid/tests/Provider/Node/StaticNodeProviderTest.php +0 -58
  423. package/vendor/ramsey/uuid/tests/Provider/Node/SystemNodeProviderTest.php +0 -950
  424. package/vendor/ramsey/uuid/tests/Provider/Time/FixedTimeProviderTest.php +0 -41
  425. package/vendor/ramsey/uuid/tests/Provider/Time/SystemTimeProviderTest.php +0 -20
  426. package/vendor/ramsey/uuid/tests/Rfc4122/FieldsTest.php +0 -260
  427. package/vendor/ramsey/uuid/tests/Rfc4122/UuidBuilderTest.php +0 -145
  428. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV1Test.php +0 -123
  429. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV2Test.php +0 -214
  430. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV3Test.php +0 -56
  431. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV4Test.php +0 -56
  432. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV5Test.php +0 -56
  433. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV6Test.php +0 -221
  434. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV7Test.php +0 -131
  435. package/vendor/ramsey/uuid/tests/Rfc4122/UuidV8Test.php +0 -56
  436. package/vendor/ramsey/uuid/tests/Rfc4122/ValidatorTest.php +0 -122
  437. package/vendor/ramsey/uuid/tests/Rfc4122/VariantTraitTest.php +0 -109
  438. package/vendor/ramsey/uuid/tests/TestCase.php +0 -29
  439. package/vendor/ramsey/uuid/tests/Type/DecimalTest.php +0 -305
  440. package/vendor/ramsey/uuid/tests/Type/HexadecimalTest.php +0 -112
  441. package/vendor/ramsey/uuid/tests/Type/IntegerTest.php +0 -235
  442. package/vendor/ramsey/uuid/tests/Type/TimeTest.php +0 -120
  443. package/vendor/ramsey/uuid/tests/UuidFactoryTest.php +0 -233
  444. package/vendor/ramsey/uuid/tests/UuidTest.php +0 -1910
  445. package/vendor/ramsey/uuid/tests/Validator/GenericValidatorTest.php +0 -98
  446. package/vendor/ramsey/uuid/tests/benchmark/GuidConversionBench.php +0 -43
  447. package/vendor/ramsey/uuid/tests/benchmark/NonLazyUuidConversionBench.php +0 -39
  448. package/vendor/ramsey/uuid/tests/benchmark/UuidFieldExtractionBench.php +0 -86
  449. package/vendor/ramsey/uuid/tests/benchmark/UuidGenerationBench.php +0 -113
  450. package/vendor/ramsey/uuid/tests/benchmark/UuidSerializationBench.php +0 -206
  451. package/vendor/ramsey/uuid/tests/benchmark/UuidStringConversionBench.php +0 -257
  452. package/vendor/ramsey/uuid/tests/bootstrap.php +0 -12
  453. package/vendor/ramsey/uuid/tests/static-analysis/UuidIsImmutable.php +0 -96
  454. package/vendor/ramsey/uuid/tests/static-analysis/UuidIsNeverEmpty.php +0 -36
  455. package/vendor/ramsey/uuid/tests/static-analysis/ValidUuidIsNonEmpty.php +0 -44
  456. package/vendor/ramsey/uuid/tests/static-analysis/stubs.php +0 -33
  457. package/vendor/symfony/polyfill-ctype/Ctype.php +0 -232
  458. package/vendor/symfony/polyfill-ctype/LICENSE +0 -19
  459. package/vendor/symfony/polyfill-ctype/README.md +0 -12
  460. package/vendor/symfony/polyfill-ctype/bootstrap.php +0 -50
  461. package/vendor/symfony/polyfill-ctype/bootstrap80.php +0 -46
  462. package/vendor/symfony/polyfill-ctype/composer.json +0 -41
  463. package/vendor/symfony/polyfill-mbstring/LICENSE +0 -19
  464. package/vendor/symfony/polyfill-mbstring/Mbstring.php +0 -947
  465. package/vendor/symfony/polyfill-mbstring/README.md +0 -13
  466. package/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php +0 -119
  467. package/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +0 -1397
  468. package/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +0 -5
  469. package/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +0 -1489
  470. package/vendor/symfony/polyfill-mbstring/bootstrap.php +0 -151
  471. package/vendor/symfony/polyfill-mbstring/bootstrap80.php +0 -147
  472. package/vendor/symfony/polyfill-mbstring/composer.json +0 -41
  473. package/vendor/symfony/polyfill-php80/LICENSE +0 -19
  474. package/vendor/symfony/polyfill-php80/Php80.php +0 -115
  475. package/vendor/symfony/polyfill-php80/PhpToken.php +0 -103
  476. package/vendor/symfony/polyfill-php80/README.md +0 -25
  477. package/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +0 -31
  478. package/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +0 -16
  479. package/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +0 -20
  480. package/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +0 -16
  481. package/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +0 -16
  482. package/vendor/symfony/polyfill-php80/bootstrap.php +0 -42
  483. package/vendor/symfony/polyfill-php80/composer.json +0 -40
  484. package/vendor/vlucas/phpdotenv/.editorconfig +0 -15
  485. package/vendor/vlucas/phpdotenv/.gitattributes +0 -17
  486. package/vendor/vlucas/phpdotenv/.github/CODE_OF_CONDUCT.md +0 -132
  487. package/vendor/vlucas/phpdotenv/.github/CONTRIBUTING.md +0 -30
  488. package/vendor/vlucas/phpdotenv/.github/FUNDING.yml +0 -2
  489. package/vendor/vlucas/phpdotenv/.github/SECURITY.md +0 -14
  490. package/vendor/vlucas/phpdotenv/.github/workflows/static.yml +0 -74
  491. package/vendor/vlucas/phpdotenv/.github/workflows/tests.yml +0 -70
  492. package/vendor/vlucas/phpdotenv/LICENSE +0 -30
  493. package/vendor/vlucas/phpdotenv/Makefile +0 -26
  494. package/vendor/vlucas/phpdotenv/README.md +0 -363
  495. package/vendor/vlucas/phpdotenv/UPGRADING.md +0 -196
  496. package/vendor/vlucas/phpdotenv/composer.json +0 -60
  497. package/vendor/vlucas/phpdotenv/phpstan-baseline.neon +0 -21
  498. package/vendor/vlucas/phpdotenv/phpstan.neon.dist +0 -7
  499. package/vendor/vlucas/phpdotenv/phpunit.xml.dist +0 -13
  500. package/vendor/vlucas/phpdotenv/psalm-baseline.xml +0 -28
  501. package/vendor/vlucas/phpdotenv/psalm.xml +0 -13
  502. package/vendor/vlucas/phpdotenv/src/Dotenv.php +0 -267
  503. package/vendor/vlucas/phpdotenv/src/Exception/ExceptionInterface.php +0 -12
  504. package/vendor/vlucas/phpdotenv/src/Exception/InvalidEncodingException.php +0 -12
  505. package/vendor/vlucas/phpdotenv/src/Exception/InvalidFileException.php +0 -12
  506. package/vendor/vlucas/phpdotenv/src/Exception/InvalidPathException.php +0 -12
  507. package/vendor/vlucas/phpdotenv/src/Exception/ValidationException.php +0 -12
  508. package/vendor/vlucas/phpdotenv/src/Loader/Loader.php +0 -47
  509. package/vendor/vlucas/phpdotenv/src/Loader/LoaderInterface.php +0 -20
  510. package/vendor/vlucas/phpdotenv/src/Loader/Resolver.php +0 -65
  511. package/vendor/vlucas/phpdotenv/src/Parser/Entry.php +0 -59
  512. package/vendor/vlucas/phpdotenv/src/Parser/EntryParser.php +0 -300
  513. package/vendor/vlucas/phpdotenv/src/Parser/Lexer.php +0 -58
  514. package/vendor/vlucas/phpdotenv/src/Parser/Lines.php +0 -127
  515. package/vendor/vlucas/phpdotenv/src/Parser/Parser.php +0 -53
  516. package/vendor/vlucas/phpdotenv/src/Parser/ParserInterface.php +0 -19
  517. package/vendor/vlucas/phpdotenv/src/Parser/Value.php +0 -88
  518. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/AdapterInterface.php +0 -15
  519. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/ApacheAdapter.php +0 -89
  520. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/ArrayAdapter.php +0 -80
  521. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/EnvConstAdapter.php +0 -89
  522. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/GuardedWriter.php +0 -85
  523. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/ImmutableWriter.php +0 -110
  524. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php +0 -48
  525. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiWriter.php +0 -64
  526. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/PutenvAdapter.php +0 -91
  527. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReaderInterface.php +0 -17
  528. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/ReplacingWriter.php +0 -104
  529. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php +0 -89
  530. package/vendor/vlucas/phpdotenv/src/Repository/Adapter/WriterInterface.php +0 -27
  531. package/vendor/vlucas/phpdotenv/src/Repository/AdapterRepository.php +0 -107
  532. package/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php +0 -272
  533. package/vendor/vlucas/phpdotenv/src/Repository/RepositoryInterface.php +0 -51
  534. package/vendor/vlucas/phpdotenv/src/Store/File/Paths.php +0 -44
  535. package/vendor/vlucas/phpdotenv/src/Store/File/Reader.php +0 -81
  536. package/vendor/vlucas/phpdotenv/src/Store/FileStore.php +0 -72
  537. package/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php +0 -141
  538. package/vendor/vlucas/phpdotenv/src/Store/StoreInterface.php +0 -17
  539. package/vendor/vlucas/phpdotenv/src/Store/StringStore.php +0 -37
  540. package/vendor/vlucas/phpdotenv/src/Util/Regex.php +0 -112
  541. package/vendor/vlucas/phpdotenv/src/Util/Str.php +0 -98
  542. package/vendor/vlucas/phpdotenv/src/Validator.php +0 -209
  543. package/vendor/vlucas/phpdotenv/tests/Dotenv/DotenvTest.php +0 -387
  544. package/vendor/vlucas/phpdotenv/tests/Dotenv/Loader/LoaderTest.php +0 -86
  545. package/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/EntryParserTest.php +0 -234
  546. package/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LexerTest.php +0 -40
  547. package/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/LinesTest.php +0 -53
  548. package/vendor/vlucas/phpdotenv/tests/Dotenv/Parser/ParserTest.php +0 -98
  549. package/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ArrayAdapterTest.php +0 -57
  550. package/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/EnvConstAdapterTest.php +0 -75
  551. package/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/PutenvAdapterTest.php +0 -52
  552. package/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/Adapter/ServerConstAdapterTest.php +0 -75
  553. package/vendor/vlucas/phpdotenv/tests/Dotenv/Repository/RepositoryTest.php +0 -305
  554. package/vendor/vlucas/phpdotenv/tests/Dotenv/Store/StoreTest.php +0 -141
  555. package/vendor/vlucas/phpdotenv/tests/Dotenv/ValidatorTest.php +0 -479
  556. package/vendor/vlucas/phpdotenv/tests/fixtures/env/.env +0 -5
  557. package/vendor/vlucas/phpdotenv/tests/fixtures/env/assertions.env +0 -18
  558. package/vendor/vlucas/phpdotenv/tests/fixtures/env/booleans.env +0 -33
  559. package/vendor/vlucas/phpdotenv/tests/fixtures/env/commented.env +0 -15
  560. package/vendor/vlucas/phpdotenv/tests/fixtures/env/empty.env +0 -1
  561. package/vendor/vlucas/phpdotenv/tests/fixtures/env/example.env +0 -1
  562. package/vendor/vlucas/phpdotenv/tests/fixtures/env/exported.env +0 -7
  563. package/vendor/vlucas/phpdotenv/tests/fixtures/env/immutable.env +0 -1
  564. package/vendor/vlucas/phpdotenv/tests/fixtures/env/integers.env +0 -17
  565. package/vendor/vlucas/phpdotenv/tests/fixtures/env/large.env +0 -2
  566. package/vendor/vlucas/phpdotenv/tests/fixtures/env/multibyte.env +0 -3
  567. package/vendor/vlucas/phpdotenv/tests/fixtures/env/multiline.env +0 -14
  568. package/vendor/vlucas/phpdotenv/tests/fixtures/env/multiple.env +0 -4
  569. package/vendor/vlucas/phpdotenv/tests/fixtures/env/mutable.env +0 -1
  570. package/vendor/vlucas/phpdotenv/tests/fixtures/env/nested.env +0 -15
  571. package/vendor/vlucas/phpdotenv/tests/fixtures/env/quoted.env +0 -11
  572. package/vendor/vlucas/phpdotenv/tests/fixtures/env/specialchars.env +0 -8
  573. package/vendor/vlucas/phpdotenv/tests/fixtures/env/unicodevarnames.env +0 -2
  574. package/vendor/vlucas/phpdotenv/tests/fixtures/env/utf8-with-bom-encoding.env +0 -3
  575. package/vendor/vlucas/phpdotenv/tests/fixtures/env/windows.env +0 -1
  576. package/vendor/vlucas/phpdotenv/vendor-bin/phpstan/composer.json +0 -16
  577. package/vendor/vlucas/phpdotenv/vendor-bin/psalm/composer.json +0 -9
@@ -1,2596 +0,0 @@
1
- <?php
2
-
3
- declare(strict_types=1);
4
-
5
- namespace Brick\Math\Tests;
6
-
7
- use Brick\Math\BigDecimal;
8
- use Brick\Math\Exception\DivisionByZeroException;
9
- use Brick\Math\Exception\MathException;
10
- use Brick\Math\Exception\NegativeNumberException;
11
- use Brick\Math\Exception\NumberFormatException;
12
- use Brick\Math\Exception\RoundingNecessaryException;
13
- use Brick\Math\RoundingMode;
14
-
15
- /**
16
- * Unit tests for class BigDecimal.
17
- */
18
- class BigDecimalTest extends AbstractTestCase
19
- {
20
- /**
21
- * @dataProvider providerOf
22
- *
23
- * @param string|number $value The value to convert to a BigDecimal.
24
- * @param string $unscaledValue The expected unscaled value.
25
- * @param int $scale The expected scale.
26
- */
27
- public function testOf($value, string $unscaledValue, int $scale) : void
28
- {
29
- self::assertBigDecimalInternalValues($unscaledValue, $scale, BigDecimal::of($value));
30
- }
31
-
32
- public function providerOf() : array
33
- {
34
- return [
35
- [0, '0', 0],
36
- [1, '1', 0],
37
- [-1, '-1', 0],
38
- [123456789, '123456789', 0],
39
- [-123456789, '-123456789', 0],
40
- [PHP_INT_MAX, (string) PHP_INT_MAX, 0],
41
- [PHP_INT_MIN, (string) PHP_INT_MIN, 0],
42
-
43
- [0.0, '0', 0],
44
- [0.1, '1', 1],
45
- [1.0, '1', 0],
46
- [1.1, '11', 1],
47
-
48
- ['0', '0', 0],
49
- ['+0', '0', 0],
50
- ['-0', '0', 0],
51
- ['00', '0', 0],
52
- ['+00', '0', 0],
53
- ['-00', '0', 0],
54
-
55
- ['1', '1', 0],
56
- ['+1', '1', 0],
57
- ['-1', '-1', 0],
58
- ['01', '1', 0],
59
- ['+01', '1', 0],
60
- ['-01', '-1', 0],
61
-
62
- ['0.0', '0', 1],
63
- ['+0.0', '0', 1],
64
- ['-0.0', '0', 1],
65
- ['00.0', '0', 1],
66
- ['+00.0', '0', 1],
67
- ['-00.0', '0', 1],
68
-
69
- ['.0', '0', 1],
70
- ['.00', '0', 2],
71
- ['.123', '123', 3],
72
- ['+.2', '2', 1],
73
- ['-.33', '-33', 2],
74
- ['1.e2', '100', 0],
75
- ['.1e-1', '1', 2],
76
- ['.1e0', '1', 1],
77
- ['.1e1', '1', 0],
78
- ['.1e2', '10', 0],
79
- ['1.e-2', '1', 2],
80
- ['.1e-2', '1', 3],
81
- ['.12e1', '12', 1],
82
- ['.012e1', '12', 2],
83
- ['-.15e3', '-150', 0],
84
-
85
- ['1.', '1', 0],
86
- ['+12.', '12', 0],
87
- ['-123.', '-123', 0],
88
-
89
- ['1.0', '10', 1],
90
- ['+1.0', '10', 1],
91
- ['-1.0', '-10', 1],
92
- ['01.0', '10', 1],
93
- ['+01.0', '10', 1],
94
- ['-01.0', '-10', 1],
95
-
96
- ['0.1', '1', 1],
97
- ['+0.1', '1', 1],
98
- ['-0.1', '-1', 1],
99
- ['0.10', '10', 2],
100
- ['+0.10', '10', 2],
101
- ['-0.10', '-10', 2],
102
- ['0.010', '10', 3],
103
- ['+0.010', '10', 3],
104
- ['-0.010', '-10', 3],
105
-
106
- ['00.1', '1', 1],
107
- ['+00.1', '1', 1],
108
- ['-00.1', '-1', 1],
109
- ['00.10', '10', 2],
110
- ['+00.10', '10', 2],
111
- ['-00.10', '-10', 2],
112
- ['00.010', '10', 3],
113
- ['+00.010', '10', 3],
114
- ['-00.010', '-10', 3],
115
-
116
- ['01.1', '11', 1],
117
- ['+01.1', '11', 1],
118
- ['-01.1', '-11', 1],
119
- ['01.010', '1010', 3],
120
- ['+01.010', '1010', 3],
121
- ['-01.010', '-1010', 3],
122
-
123
- ['0e-2', '0', 2],
124
- ['0e-1', '0', 1],
125
- ['0e-0', '0', 0],
126
- ['0e0', '0', 0],
127
- ['0e1', '0', 0],
128
- ['0e2', '0', 0],
129
- ['0e+0', '0', 0],
130
- ['0e+1','0', 0],
131
- ['0e+2','0', 0],
132
-
133
- ['0.0e-2', '0', 3],
134
- ['0.0e-1', '0', 2],
135
- ['0.0e-0', '0', 1],
136
- ['0.0e0', '0', 1],
137
- ['0.0e1', '0', 0],
138
- ['0.0e2', '0', 0],
139
- ['0.0e+0', '0', 1],
140
- ['0.0e+1','0', 0],
141
- ['0.0e+2','0', 0],
142
-
143
- ['0.1e-2', '1', 3],
144
- ['0.1e-1', '1', 2],
145
- ['0.1e-0', '1', 1],
146
- ['0.1e0', '1', 1],
147
- ['0.1e1', '1', 0],
148
- ['0.1e2', '10', 0],
149
- ['0.1e+0', '1', 1],
150
- ['0.1e+1','1', 0],
151
- ['0.1e+2','10', 0],
152
- ['1.23e+011', '123000000000', 0],
153
- ['1.23e-011', '123', 13],
154
-
155
- ['0.01e-2', '1', 4],
156
- ['0.01e-1', '1', 3],
157
- ['0.01e-0', '1', 2],
158
- ['0.01e0', '1', 2],
159
- ['0.01e1', '1', 1],
160
- ['0.01e2', '1', 0],
161
- ['0.01e+0', '1', 2],
162
- ['0.01e+1','1', 1],
163
- ['0.01e+2','1', 0],
164
-
165
- ['0.10e-2', '10', 4],
166
- ['0.10e-1', '10', 3],
167
- ['0.10e-0', '10', 2],
168
- ['0.10e0', '10', 2],
169
- ['0.10e1', '10', 1],
170
- ['0.10e2', '10', 0],
171
- ['0.10e+0', '10', 2],
172
- ['0.10e+1','10', 1],
173
- ['0.10e+2','10', 0],
174
-
175
- ['00.10e-2', '10', 4],
176
- ['+00.10e-1', '10', 3],
177
- ['-00.10e-0', '-10', 2],
178
- ['00.10e0', '10', 2],
179
- ['+00.10e1', '10', 1],
180
- ['-00.10e2', '-10', 0],
181
- ['00.10e+0', '10', 2],
182
- ['+00.10e+1','10', 1],
183
- ['-00.10e+2','-10', 0],
184
- ];
185
- }
186
-
187
- /**
188
- * @dataProvider providerOfFloatInDifferentLocales
189
- */
190
- public function testOfFloatInDifferentLocales(string $locale) : void
191
- {
192
- $originalLocale = setlocale(LC_NUMERIC, '0');
193
- $setLocale = setlocale(LC_NUMERIC, $locale);
194
-
195
- if ($setLocale !== $locale) {
196
- setlocale(LC_NUMERIC, $originalLocale);
197
- self::markTestSkipped('Locale ' . $locale . ' is not supported on this system.');
198
- }
199
-
200
- // Test a large enough number (thousands separator) with decimal digits (decimal separator)
201
- self::assertSame('2500.5', (string) BigDecimal::of(5001/2));
202
-
203
- // Ensure that the locale has been reset to its original value by BigNumber::of()
204
- self::assertSame($locale, setlocale(LC_NUMERIC, '0'));
205
-
206
- setlocale(LC_NUMERIC, $originalLocale);
207
- }
208
-
209
- public function providerOfFloatInDifferentLocales() : array
210
- {
211
- return [
212
- ['C'],
213
- ['en_US.UTF-8'],
214
- ['de_DE.UTF-8'],
215
- ['es_ES'],
216
- ['fr_FR'],
217
- ['fr_FR.iso88591'],
218
- ['fr_FR.iso885915@euro'],
219
- ['fr_FR@euro'],
220
- ['fr_FR.utf8'],
221
- ['ps_AF'],
222
- ];
223
- }
224
-
225
- /**
226
- * @dataProvider providerOfInvalidValueThrowsException
227
- */
228
- public function testOfInvalidValueThrowsException($value) : void
229
- {
230
- $this->expectException(NumberFormatException::class);
231
- BigDecimal::of($value);
232
- }
233
-
234
- public function providerOfInvalidValueThrowsException() : array
235
- {
236
- return [
237
- [''],
238
- ['a'],
239
- [' 1'],
240
- ['1 '],
241
- ['..1'],
242
- ['1..'],
243
- ['.1.'],
244
- ['+'],
245
- ['-'],
246
- ['.'],
247
- ['1e'],
248
- ['.e'],
249
- ['.e1'],
250
- ['1e+'],
251
- ['1e-'],
252
- ['+e1'],
253
- ['-e2'],
254
- ['.e3'],
255
- ['+a'],
256
- ['-a'],
257
- ['1e1000000000000000000000000000000'],
258
- ['1e-1000000000000000000000000000000'],
259
- [INF],
260
- [-INF],
261
- [NAN],
262
- ];
263
- }
264
-
265
- public function testOfBigDecimalReturnsThis() : void
266
- {
267
- $decimal = BigDecimal::of(123);
268
-
269
- self::assertSame($decimal, BigDecimal::of($decimal));
270
- }
271
-
272
- /**
273
- * @dataProvider providerOfUnscaledValue
274
- *
275
- * @param string|int $unscaledValue The unscaled value of the BigDecimal to create.
276
- * @param int $scale The scale of the BigDecimal to create.
277
- * @param string $expectedUnscaledValue The expected result unscaled value.
278
- */
279
- public function testOfUnscaledValue($unscaledValue, int $scale, string $expectedUnscaledValue) : void
280
- {
281
- $number = BigDecimal::ofUnscaledValue($unscaledValue, $scale);
282
- self::assertBigDecimalInternalValues($expectedUnscaledValue, $scale, $number);
283
- }
284
-
285
- public function providerOfUnscaledValue() : array
286
- {
287
- return [
288
- [123456789, 0, '123456789'],
289
- [123456789, 1, '123456789'],
290
- [-123456789, 0, '-123456789'],
291
- [-123456789, 1, '-123456789'],
292
-
293
- ['123456789012345678901234567890', 0, '123456789012345678901234567890'],
294
- ['123456789012345678901234567890', 1, '123456789012345678901234567890'],
295
- ['+123456789012345678901234567890', 0, '123456789012345678901234567890'],
296
- ['+123456789012345678901234567890', 1, '123456789012345678901234567890'],
297
- ['-123456789012345678901234567890', 0, '-123456789012345678901234567890'],
298
- ['-123456789012345678901234567890', 1, '-123456789012345678901234567890'],
299
-
300
- ['0123456789012345678901234567890', 0, '123456789012345678901234567890'],
301
- ['0123456789012345678901234567890', 1, '123456789012345678901234567890'],
302
- ['+0123456789012345678901234567890', 0, '123456789012345678901234567890'],
303
- ['+0123456789012345678901234567890', 1, '123456789012345678901234567890'],
304
- ['-0123456789012345678901234567890', 0, '-123456789012345678901234567890'],
305
- ['-0123456789012345678901234567890', 1, '-123456789012345678901234567890'],
306
- ];
307
- }
308
-
309
- public function testOfUnscaledValueWithDefaultScale() : void
310
- {
311
- $number = BigDecimal::ofUnscaledValue('123456789');
312
- self::assertBigDecimalInternalValues('123456789', 0, $number);
313
- }
314
-
315
- public function testOfUnscaledValueWithNegativeScaleThrowsException() : void
316
- {
317
- $this->expectException(\InvalidArgumentException::class);
318
- BigDecimal::ofUnscaledValue('0', -1);
319
- }
320
-
321
- public function testZero() : void
322
- {
323
- self::assertBigDecimalInternalValues('0', 0, BigDecimal::zero());
324
- self::assertSame(BigDecimal::zero(), BigDecimal::zero());
325
- }
326
-
327
- public function testOne() : void
328
- {
329
- self::assertBigDecimalInternalValues('1', 0, BigDecimal::one());
330
- self::assertSame(BigDecimal::one(), BigDecimal::one());
331
- }
332
-
333
- public function testTen() : void
334
- {
335
- self::assertBigDecimalInternalValues('10', 0, BigDecimal::ten());
336
- self::assertSame(BigDecimal::ten(), BigDecimal::ten());
337
- }
338
-
339
- /**
340
- * @dataProvider providerMin
341
- *
342
- * @param array $values The values to compare.
343
- * @param string $min The expected minimum value.
344
- */
345
- public function testMin(array $values, string $min) : void
346
- {
347
- self::assertBigDecimalEquals($min, BigDecimal::min(... $values));
348
- }
349
-
350
- public function providerMin() : array
351
- {
352
- return [
353
- [[0, 1, -1], '-1'],
354
- [[0, 1, -1, -1.2], '-1.2'],
355
- [['1e30', '123456789123456789123456789', 2e25], '20000000000000000000000000'],
356
- [['1e30', '123456789123456789123456789', 2e26], '123456789123456789123456789'],
357
- [[0, '10', '5989', '-3/3'], '-1'],
358
- [['-0.0000000000000000000000000000001', '0'], '-0.0000000000000000000000000000001'],
359
- [['0.00000000000000000000000000000001', '0'], '0'],
360
- [['-1', '1', '2', '3', '-2973/30'], '-99.1'],
361
- [['999999999999999999999999999.99999999999', '1000000000000000000000000000'], '999999999999999999999999999.99999999999'],
362
- [['-999999999999999999999999999.99999999999', '-1000000000000000000000000000'], '-1000000000000000000000000000'],
363
- [['9.9e50', '1e50'], '100000000000000000000000000000000000000000000000000'],
364
- [['9.9e50', '1e51'], '990000000000000000000000000000000000000000000000000'],
365
- ];
366
- }
367
-
368
- public function testMinOfZeroValuesThrowsException() : void
369
- {
370
- $this->expectException(\InvalidArgumentException::class);
371
- BigDecimal::min();
372
- }
373
-
374
- public function testMinOfNonDecimalValuesThrowsException() : void
375
- {
376
- $this->expectException(RoundingNecessaryException::class);
377
- BigDecimal::min(1, '1/3');
378
- }
379
-
380
- /**
381
- * @dataProvider providerMax
382
- *
383
- * @param array $values The values to compare.
384
- * @param string $max The expected maximum value.
385
- */
386
- public function testMax(array $values, string $max) : void
387
- {
388
- self::assertBigDecimalEquals($max, BigDecimal::max(... $values));
389
- }
390
-
391
- public function providerMax() : array
392
- {
393
- return [
394
- [[0, 0.9, -1.00], '0.9'],
395
- [[0, 0.01, -1, -1.2], '0.01'],
396
- [[0, 0.01, -1, -1.2, '2e-1'], '0.2'],
397
- [['1e-30', '123456789123456789123456789', 2e25], '123456789123456789123456789'],
398
- [['1e-30', '123456789123456789123456789', 2e26], '200000000000000000000000000'],
399
- [[0, '10', '5989', '-1'], '5989'],
400
- [[0, '10', '5989', '5989.000000000000000000000000000000001', '-1'], '5989.000000000000000000000000000000001'],
401
- [[0, '10', '5989', '5989.000000000000000000000000000000001', '-1', '5990'], '5990'],
402
- [['-0.0000000000000000000000000000001', 0], '0'],
403
- [['0.00000000000000000000000000000001', '0'], '0.00000000000000000000000000000001'],
404
- [['-1', '1', '2', '3', '-99.1'], '3'],
405
- [['-1', '1', '2', '3', '-99.1', '31/10'], '3.1'],
406
- [['999999999999999999999999999.99999999999', '1000000000000000000000000000'], '1000000000000000000000000000'],
407
- [['-999999999999999999999999999.99999999999', '-1000000000000000000000000000'], '-999999999999999999999999999.99999999999'],
408
- [['9.9e50', '1e50'], '990000000000000000000000000000000000000000000000000'],
409
- [['9.9e50', '1e51'], '1000000000000000000000000000000000000000000000000000'],
410
- ];
411
- }
412
-
413
- public function testMaxOfZeroValuesThrowsException() : void
414
- {
415
- $this->expectException(\InvalidArgumentException::class);
416
- BigDecimal::max();
417
- }
418
-
419
- public function testMaxOfNonDecimalValuesThrowsException() : void
420
- {
421
- $this->expectException(RoundingNecessaryException::class);
422
- BigDecimal::min(1, '3/7');
423
- }
424
-
425
- /**
426
- * @dataProvider providerSum
427
- *
428
- * @param array $values The values to add.
429
- * @param string $sum The expected sum.
430
- */
431
- public function testSum(array $values, string $sum) : void
432
- {
433
- self::assertBigDecimalEquals($sum, BigDecimal::sum(... $values));
434
- }
435
-
436
- public function providerSum() : array
437
- {
438
- return [
439
- [[0, 0.9, -1.00], '-0.1'],
440
- [[0, 0.01, -1, -1.2], '-2.19'],
441
- [[0, 0.01, -1, -1.2, '2e-1'], '-1.99'],
442
- [['1e-30', '123456789123456789123456789', 2e25], '143456789123456789123456789.000000000000000000000000000001'],
443
- [['1e-30', '123456789123456789123456789', 2e26], '323456789123456789123456789.000000000000000000000000000001'],
444
- [[0, '10', '5989', '-1'], '5998'],
445
- [[0, '10', '5989', '5989.000000000000000000000000000000001', '-1'], '11987.000000000000000000000000000000001'],
446
- [[0, '10', '5989', '5989.000000000000000000000000000000001', '-1', '5990'], '17977.000000000000000000000000000000001'],
447
- [['-0.0000000000000000000000000000001', 0], '-0.0000000000000000000000000000001'],
448
- [['0.00000000000000000000000000000001', '0'], '0.00000000000000000000000000000001'],
449
- [['-1', '1', '2', '3', '-99.1'], '-94.1'],
450
- [['-1', '1', '2', '3', '-99.1', '31/10'], '-91.0'],
451
- [['999999999999999999999999999.99999999999', '1000000000000000000000000000'], '1999999999999999999999999999.99999999999'],
452
- [['-999999999999999999999999999.99999999999', 47, '-1000000000000000000000000000'], '-1999999999999999999999999952.99999999999'],
453
- [['9.9e50', '1e50', '-3/2'], '1089999999999999999999999999999999999999999999999998.5'],
454
- [['9.9e50', '-1e-51'], '989999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999'],
455
- ];
456
- }
457
-
458
- public function testSumOfZeroValuesThrowsException() : void
459
- {
460
- $this->expectException(\InvalidArgumentException::class);
461
- BigDecimal::sum();
462
- }
463
-
464
- public function testSumOfNonDecimalValuesThrowsException() : void
465
- {
466
- $this->expectException(RoundingNecessaryException::class);
467
- BigDecimal::min(1, '3/7');
468
- }
469
-
470
- /**
471
- * @dataProvider providerPlus
472
- *
473
- * @param string $a The base number.
474
- * @param string $b The number to add.
475
- * @param string $unscaledValue The expected unscaled value.
476
- * @param int $scale The expected scale.
477
- */
478
- public function testPlus(string $a, string $b, string $unscaledValue, int $scale) : void
479
- {
480
- self::assertBigDecimalInternalValues($unscaledValue, $scale, BigDecimal::of($a)->plus($b));
481
- }
482
-
483
- public function providerPlus() : array
484
- {
485
- return [
486
- ['123', '999', '1122', 0],
487
- ['123', '999.0', '11220', 1],
488
- ['123', '999.00', '112200', 2],
489
- ['123.0', '999', '11220', 1],
490
- ['123.0', '999.0', '11220', 1],
491
- ['123.0', '999.00', '112200', 2],
492
- ['123.00', '999', '112200', 2],
493
- ['123.00', '999.0', '112200', 2],
494
- ['123.00', '999.00', '112200', 2],
495
-
496
- ['0', '999', '999', 0],
497
- ['0', '999.0', '9990', 1],
498
- ['0', '999.00', '99900', 2],
499
- ['0.0', '999', '9990', 1],
500
- ['0.0', '999.0', '9990', 1],
501
- ['0.0', '999.00', '99900', 2],
502
- ['0.00', '999', '99900', 2],
503
- ['0.00', '999.0', '99900', 2],
504
- ['0.00', '999.00', '99900', 2],
505
-
506
- ['123', '-999', '-876', 0],
507
- ['123', '-999.0', '-8760', 1],
508
- ['123', '-999.00', '-87600', 2],
509
- ['123.0', '-999', '-8760', 1],
510
- ['123.0', '-999.0', '-8760', 1],
511
- ['123.0', '-999.00', '-87600', 2],
512
- ['123.00', '-999', '-87600', 2],
513
- ['123.00', '-999.0', '-87600', 2],
514
- ['123.00', '-999.00', '-87600', 2],
515
-
516
- ['-123', '999', '876', 0],
517
- ['-123', '999.0', '8760', 1],
518
- ['-123', '999.00', '87600', 2],
519
- ['-123.0', '999', '8760', 1],
520
- ['-123.0', '999.0', '8760', 1],
521
- ['-123.0', '999.00', '87600', 2],
522
- ['-123.00', '999', '87600', 2],
523
- ['-123.00', '999.0', '87600', 2],
524
- ['-123.00', '999.00', '87600', 2],
525
-
526
- ['-123', '-999', '-1122', 0],
527
- ['-123', '-999.0', '-11220', 1],
528
- ['-123', '-999.00', '-112200', 2],
529
- ['-123.0', '-999', '-11220', 1],
530
- ['-123.0', '-999.0', '-11220', 1],
531
- ['-123.0', '-999.00', '-112200', 2],
532
- ['-123.00', '-999', '-112200', 2],
533
- ['-123.00', '-999.0', '-112200', 2],
534
- ['-123.00', '-999.00', '-112200', 2],
535
-
536
- ['23487837847837428335.322387091', '309049304233535454687656.2392', '309072792071383292115991561587091', 9],
537
- ['-234878378478328335.322387091', '309049304233535154687656.232', '309049069355156676359320909612909', 9],
538
- ['234878378478328335.3227091', '-3090495154687656.231343344452', '231787883323640679091365755548', 12],
539
- ['-23487837847833435.3231', '-3090495154687656.231343344452', '-26578333002521091554443344452', 12],
540
-
541
- ['1234568798347983.2334899238921', '0', '12345687983479832334899238921', 13],
542
- ['-0.00223287647368738736428467863784', '0.000', '-223287647368738736428467863784', 32],
543
- ];
544
- }
545
-
546
- /**
547
- * @dataProvider providerMinus
548
- *
549
- * @param string $a The base number.
550
- * @param string $b The number to subtract.
551
- * @param string $unscaledValue The expected unscaled value.
552
- * @param int $scale The expected scale.
553
- */
554
- public function testMinus(string $a, string $b, string $unscaledValue, int $scale) : void
555
- {
556
- self::assertBigDecimalInternalValues($unscaledValue, $scale, BigDecimal::of($a)->minus($b));
557
- }
558
-
559
- public function providerMinus() : array
560
- {
561
- return [
562
- ['123', '999', '-876', 0],
563
- ['123', '999.0', '-8760', 1],
564
- ['123', '999.00', '-87600', 2],
565
- ['123.0', '999', '-8760', 1],
566
- ['123.0', '999.0', '-8760', 1],
567
- ['123.0', '999.00', '-87600', 2],
568
- ['123.00', '999', '-87600', 2],
569
- ['123.00', '999.0', '-87600', 2],
570
- ['123.00', '999.00', '-87600', 2],
571
- ['0', '999', '-999', 0],
572
- ['0', '999.0', '-9990', 1],
573
-
574
- ['123', '-999', '1122', 0],
575
- ['123', '-999.0', '11220', 1],
576
- ['123', '-999.00', '112200', 2],
577
- ['123.0', '-999', '11220', 1],
578
- ['123.0', '-999.0', '11220', 1],
579
- ['123.0', '-999.00', '112200', 2],
580
- ['123.00', '-999', '112200', 2],
581
- ['123.00', '-999.0', '112200', 2],
582
- ['123.00', '-999.00', '112200', 2],
583
-
584
- ['-123', '999', '-1122', 0],
585
- ['-123', '999.0', '-11220', 1],
586
- ['-123', '999.00', '-112200', 2],
587
- ['-123.0', '999', '-11220', 1],
588
- ['-123.0', '999.0', '-11220', 1],
589
- ['-123.0', '999.00', '-112200', 2],
590
- ['-123.00', '999', '-112200', 2],
591
- ['-123.00', '999.0', '-112200', 2],
592
- ['-123.00', '999.00', '-112200', 2],
593
-
594
- ['-123', '-999', '876', 0],
595
- ['-123', '-999.0', '8760', 1],
596
- ['-123', '-999.00', '87600', 2],
597
- ['-123.0', '-999', '8760', 1],
598
- ['-123.0', '-999.0', '8760', 1],
599
- ['-123.0', '-999.00', '87600', 2],
600
- ['-123.00', '-999', '87600', 2],
601
- ['-123.00', '-999.0', '87600', 2],
602
- ['-123.00', '-999.00', '87600', 2],
603
-
604
- ['234878378477428335.3223334343487091', '309049304233536.2392', '2345693291731947990831334343487091', 16],
605
- ['-2348783784774335.32233343434891', '309049304233536.233392', '-265783308900787155572543434891', 14],
606
- ['2348783784774335.323232342791', '-309049304233536.556172', '2657833089007871879404342791', 12],
607
- ['-2348783784774335.3232342791', '-309049304233536.556172', '-20397344805407987670622791', 10],
608
-
609
- ['1234568798347983.2334899238921', '0', '12345687983479832334899238921', 13],
610
- ['0', '1234568798347983.2334899238921', '-12345687983479832334899238921', 13],
611
- ['-0.00223287647368738736428467863784', '0.000', '-223287647368738736428467863784', 32],
612
- ];
613
- }
614
-
615
- /**
616
- * @dataProvider providerMultipliedBy
617
- *
618
- * @param string $a The base number.
619
- * @param string $b The number to multiply.
620
- * @param string $unscaledValue The expected unscaled value.
621
- * @param int $scale The expected scale.
622
- */
623
- public function testMultipliedBy(string $a, string $b, string $unscaledValue, int $scale) : void
624
- {
625
- self::assertBigDecimalInternalValues($unscaledValue, $scale, BigDecimal::of($a)->multipliedBy($b));
626
- }
627
-
628
- public function providerMultipliedBy() : array
629
- {
630
- return [
631
- ['123', '999', '122877', 0],
632
- ['123', '999.0', '1228770', 1],
633
- ['123', '999.00', '12287700', 2],
634
- ['123.0', '999', '1228770', 1],
635
- ['123.0', '999.0', '12287700', 2],
636
- ['123.0', '999.00', '122877000', 3],
637
- ['123.00', '999', '12287700', 2],
638
- ['123.00', '999.0', '122877000', 3],
639
- ['123.00', '999.00', '1228770000', 4],
640
-
641
- ['123.0', '0.1', '1230', 2],
642
- ['123.0', '0.01', '1230', 3],
643
- ['123.1', '0.01', '1231', 3],
644
- ['123.1', '0.001', '1231', 4],
645
-
646
- ['123', '-999', '-122877', 0],
647
- ['123', '-999.0', '-1228770', 1],
648
- ['123', '-999.00', '-12287700', 2],
649
- ['123.0', '-999', '-1228770', 1],
650
- ['123.0', '-999.0', '-12287700', 2],
651
- ['123.0', '-999.00', '-122877000', 3],
652
- ['123.00', '-999', '-12287700', 2],
653
- ['123.00', '-999.0', '-122877000', 3],
654
- ['123.00', '-999.00', '-1228770000', 4],
655
-
656
- ['-123', '999', '-122877', 0],
657
- ['-123', '999.0', '-1228770', 1],
658
- ['-123', '999.00', '-12287700', 2],
659
- ['-123.0', '999', '-1228770', 1],
660
- ['-123.0', '999.0', '-12287700', 2],
661
- ['-123.0', '999.00', '-122877000', 3],
662
- ['-123.00', '999', '-12287700', 2],
663
- ['-123.00', '999.0', '-122877000', 3],
664
- ['-123.00', '999.00', '-1228770000', 4],
665
-
666
- ['-123', '-999', '122877', 0],
667
- ['-123', '-999.0', '1228770', 1],
668
- ['-123', '-999.00', '12287700', 2],
669
- ['-123.0', '-999', '1228770', 1],
670
- ['-123.0', '-999.0', '12287700', 2],
671
- ['-123.0', '-999.00', '122877000', 3],
672
- ['-123.00', '-999', '12287700', 2],
673
- ['-123.00', '-999.0', '122877000', 3],
674
- ['-123.00', '-999.00', '1228770000', 4],
675
-
676
- ['1', '999', '999', 0],
677
- ['1', '999.0', '9990', 1],
678
- ['1', '999.00', '99900', 2],
679
- ['1.0', '999', '9990', 1],
680
- ['1.0', '999.0', '99900', 2],
681
- ['1.0', '999.00', '999000', 3],
682
- ['1.00', '999', '99900', 2],
683
- ['1.00', '999.0', '999000', 3],
684
- ['1.00', '999.00', '9990000', 4],
685
-
686
- ['123', '1', '123', 0],
687
- ['123', '1.0', '1230', 1],
688
- ['123', '1.00', '12300', 2],
689
- ['123.0', '1', '1230', 1],
690
- ['123.0', '1.0', '12300', 2],
691
- ['123.0', '1.00', '123000', 3],
692
- ['123.00', '1', '12300', 2],
693
- ['123.00', '1.0', '123000', 3],
694
- ['123.00', '1.00', '1230000', 4],
695
-
696
- ['0', '999', '0', 0],
697
- ['0', '999.0', '0', 1],
698
- ['0', '999.00', '0', 2],
699
- ['0.0', '999', '0', 1],
700
- ['0.0', '999.0', '0', 2],
701
- ['0.0', '999.00', '0', 3],
702
- ['0.00', '999', '0', 2],
703
- ['0.00', '999.0', '0', 3],
704
- ['0.00', '999.00', '0', 4],
705
-
706
- ['123', '0', '0', 0],
707
- ['123', '0.0', '0', 1],
708
- ['123', '0.00', '0', 2],
709
- ['123.0', '0', '0', 1],
710
- ['123.0', '0.0', '0', 2],
711
- ['123.0', '0.00', '0', 3],
712
- ['123.00', '0', '0', 2],
713
- ['123.00', '0.0', '0', 3],
714
- ['123.00', '0.00', '0', 4],
715
-
716
- ['589252.156111130', '999.2563989942545241223454', '5888139876152080735720775399923986443020', 31],
717
- ['-589252.15611130', '999.256398994254524122354', '-58881398761537794715991163083004200020', 29],
718
- ['589252.1561113', '-99.256398994254524122354', '-584870471152079471599116308300420002', 28],
719
- ['-58952.156111', '-9.256398994254524122357', '545684678534996098129205129273627', 27],
720
-
721
- ['0.1235437849158495728979344999999999999', '1', '1235437849158495728979344999999999999', 37],
722
- ['-1.324985980890283098409328999999999999', '1', '-1324985980890283098409328999999999999', 36],
723
- ];
724
- }
725
-
726
- /**
727
- * @dataProvider providerDividedBy
728
- *
729
- * @param string $a The base number.
730
- * @param string $b The number to divide.
731
- * @param int|null $scale The desired scale of the result.
732
- * @param int $roundingMode The rounding mode.
733
- * @param string $unscaledValue The expected unscaled value of the result.
734
- * @param int $expectedScale The expected scale of the result.
735
- */
736
- public function testDividedBy(string $a, string $b, ?int $scale, int $roundingMode, string $unscaledValue, int $expectedScale) : void
737
- {
738
- $decimal = BigDecimal::of($a)->dividedBy($b, $scale, $roundingMode);
739
- self::assertBigDecimalInternalValues($unscaledValue, $expectedScale, $decimal);
740
- }
741
-
742
- public function providerDividedBy() : array
743
- {
744
- return [
745
- [ '7', '0.2', 0, RoundingMode::UNNECESSARY, '35', 0],
746
- [ '7', '-0.2', 0, RoundingMode::UNNECESSARY, '-35', 0],
747
- ['-7', '0.2', 0, RoundingMode::UNNECESSARY, '-35', 0],
748
- ['-7', '-0.2', 0, RoundingMode::UNNECESSARY, '35', 0],
749
-
750
- ['1234567890123456789', '0.01', 0, RoundingMode::UNNECESSARY, '123456789012345678900', 0],
751
- ['1234567890123456789', '0.010', 0, RoundingMode::UNNECESSARY, '123456789012345678900', 0],
752
-
753
- ['1324794783847839472983.343898', '1', 6, RoundingMode::UNNECESSARY, '1324794783847839472983343898', 6],
754
- ['-32479478384783947298.3343898', '1', 7, RoundingMode::UNNECESSARY, '-324794783847839472983343898', 7],
755
-
756
- ['1.5', '2', 2, RoundingMode::UNNECESSARY, '75', 2],
757
- ['1.5', '3', null, RoundingMode::UNNECESSARY, '5', 1],
758
- ['0.123456789', '0.00244140625', 10, RoundingMode::UNNECESSARY, '505679007744', 10],
759
- ['1.234', '123.456', 50, RoundingMode::DOWN, '999546397096941420425090720580611715914981855883', 50],
760
- ['1', '3', 10, RoundingMode::UP, '3333333334', 10],
761
- ['0.124', '0.2', 3, RoundingMode::UNNECESSARY, '620', 3],
762
- ['0.124', '2', 3, RoundingMode::UNNECESSARY, '62', 3],
763
- ];
764
- }
765
-
766
- /**
767
- * @dataProvider providerDividedByByZeroThrowsException
768
- *
769
- * @param string|number $zero
770
- */
771
- public function testDividedByByZeroThrowsException($zero) : void
772
- {
773
- $this->expectException(DivisionByZeroException::class);
774
- BigDecimal::of(1)->dividedBy($zero, 0);
775
- }
776
-
777
- public function providerDividedByByZeroThrowsException() : array
778
- {
779
- return [
780
- [0],
781
- [0.0],
782
- ['0'],
783
- ['0.0'],
784
- ['0.00']
785
- ];
786
- }
787
-
788
- /**
789
- * @dataProvider providerExactlyDividedBy
790
- *
791
- * @param string|number $number The number to divide.
792
- * @param string|number $divisor The divisor.
793
- * @param string $expected The expected result, or a class name if an exception is expected.
794
- */
795
- public function testExactlyDividedBy($number, $divisor, string $expected) : void
796
- {
797
- $number = BigDecimal::of($number);
798
-
799
- if (self::isException($expected)) {
800
- $this->expectException($expected);
801
- }
802
-
803
- $actual = $number->exactlyDividedBy($divisor);
804
-
805
- if (! self::isException($expected)) {
806
- self::assertBigDecimalEquals($expected, $actual);
807
- }
808
- }
809
-
810
- public function providerExactlyDividedBy() : array
811
- {
812
- return [
813
- [1, 1, '1'],
814
- ['1.0', '1.00', '1'],
815
- [1, 2, '0.5'],
816
- [1, 3, RoundingNecessaryException::class],
817
- [1, 4, '0.25'],
818
- [1, 5, '0.2'],
819
- [1, 6, RoundingNecessaryException::class],
820
- [1, 7, RoundingNecessaryException::class],
821
- [1, 8, '0.125'],
822
- [1, 9, RoundingNecessaryException::class],
823
- [1, 10, '0.1'],
824
- ['1.0', 2, '0.5'],
825
- ['1.00', 2, '0.5'],
826
- ['1.0000', 8, '0.125'],
827
- [1, '4.000', '0.25'],
828
- ['1', '0.125', '8'],
829
- ['1.0', '0.125', '8'],
830
- ['1234.5678', '2', '617.2839'],
831
- ['1234.5678', '4', '308.64195'],
832
- ['1234.5678', '8', '154.320975'],
833
- ['1234.5678', '6.4', '192.90121875'],
834
- ['7', '3125', '0.00224'],
835
- ['4849709849456546549849846510128399', '18014398509481984', '269212976880902984.935786476657271160117801400701864622533321380615234375'],
836
- ['4849709849456546549849846510128399', '-18014398509481984', '-269212976880902984.935786476657271160117801400701864622533321380615234375'],
837
- ['-4849709849456546549849846510128399', '18014398509481984', '-269212976880902984.935786476657271160117801400701864622533321380615234375'],
838
- ['-4849709849456546549849846510128399', '-18014398509481984', '269212976880902984.935786476657271160117801400701864622533321380615234375'],
839
- ['123', '0', DivisionByZeroException::class],
840
- [-789, '0.0', DivisionByZeroException::class],
841
- ];
842
- }
843
-
844
- public function testExactlyDividedByZero() : void
845
- {
846
- $this->expectException(DivisionByZeroException::class);
847
- BigDecimal::of(1)->exactlyDividedBy(0);
848
- }
849
-
850
- /**
851
- * @dataProvider providerDividedByWithRoundingNecessaryThrowsException
852
- *
853
- * @param string $a The base number.
854
- * @param string $b The number to divide by.
855
- * @param int $scale The desired scale.
856
- */
857
- public function testDividedByWithRoundingNecessaryThrowsException(string $a, string $b, int $scale) : void
858
- {
859
- $this->expectException(RoundingNecessaryException::class);
860
- BigDecimal::of($a)->dividedBy($b, $scale);
861
- }
862
-
863
- public function providerDividedByWithRoundingNecessaryThrowsException() : array
864
- {
865
- return [
866
- ['1.234', '123.456', 3],
867
- ['7', '2', 0],
868
- ['7', '3', 100],
869
- ];
870
- }
871
-
872
- public function testDividedByWithNegativeScaleThrowsException() : void
873
- {
874
- $this->expectException(\InvalidArgumentException::class);
875
- BigDecimal::of(1)->dividedBy(2, -1);
876
- }
877
-
878
- public function testDividedByWithInvalidRoundingModeThrowsException() : void
879
- {
880
- $this->expectException(\InvalidArgumentException::class);
881
- BigDecimal::of(1)->dividedBy(2, 0, -1);
882
- }
883
-
884
- /**
885
- * @dataProvider providerRoundingMode
886
- *
887
- * @param int $roundingMode The rounding mode.
888
- * @param string $number The number to round.
889
- * @param string|null $two The expected rounding to a scale of two, or null if an exception is expected.
890
- * @param string|null $one The expected rounding to a scale of one, or null if an exception is expected.
891
- * @param string|null $zero The expected rounding to a scale of zero, or null if an exception is expected.
892
- */
893
- public function testRoundingMode(int $roundingMode, string $number, ?string $two, ?string $one, ?string $zero) : void
894
- {
895
- $number = BigDecimal::of($number);
896
-
897
- $this->doTestRoundingMode($roundingMode, $number, '1', $two, $one, $zero);
898
- $this->doTestRoundingMode($roundingMode, $number->negated(), '-1', $two, $one, $zero);
899
- }
900
-
901
- /**
902
- * @param int $roundingMode The rounding mode.
903
- * @param BigDecimal $number The number to round.
904
- * @param string $divisor The divisor.
905
- * @param string|null $two The expected rounding to a scale of two, or null if an exception is expected.
906
- * @param string|null $one The expected rounding to a scale of one, or null if an exception is expected.
907
- * @param string|null $zero The expected rounding to a scale of zero, or null if an exception is expected.
908
- */
909
- private function doTestRoundingMode(int $roundingMode, BigDecimal $number, string $divisor, ?string $two, ?string $one, ?string $zero) : void
910
- {
911
- foreach ([$zero, $one, $two] as $scale => $expected) {
912
- if ($expected === null) {
913
- $this->expectException(RoundingNecessaryException::class);
914
- }
915
-
916
- $actual = $number->dividedBy($divisor, $scale, $roundingMode);
917
-
918
- if ($expected !== null) {
919
- self::assertBigDecimalInternalValues($expected, $scale, $actual);
920
- }
921
- }
922
- }
923
-
924
- public function providerRoundingMode() : array
925
- {
926
- return [
927
- [RoundingMode::UP, '3.501', '351', '36', '4'],
928
- [RoundingMode::UP, '3.500', '350', '35', '4'],
929
- [RoundingMode::UP, '3.499', '350', '35', '4'],
930
- [RoundingMode::UP, '3.001', '301', '31', '4'],
931
- [RoundingMode::UP, '3.000', '300', '30', '3'],
932
- [RoundingMode::UP, '2.999', '300', '30', '3'],
933
- [RoundingMode::UP, '2.501', '251', '26', '3'],
934
- [RoundingMode::UP, '2.500', '250', '25', '3'],
935
- [RoundingMode::UP, '2.499', '250', '25', '3'],
936
- [RoundingMode::UP, '2.001', '201', '21', '3'],
937
- [RoundingMode::UP, '2.000', '200', '20', '2'],
938
- [RoundingMode::UP, '1.999', '200', '20', '2'],
939
- [RoundingMode::UP, '1.501', '151', '16', '2'],
940
- [RoundingMode::UP, '1.500', '150', '15', '2'],
941
- [RoundingMode::UP, '1.499', '150', '15', '2'],
942
- [RoundingMode::UP, '1.001', '101', '11', '2'],
943
- [RoundingMode::UP, '1.000', '100', '10', '1'],
944
- [RoundingMode::UP, '0.999', '100', '10', '1'],
945
- [RoundingMode::UP, '0.501', '51', '6', '1'],
946
- [RoundingMode::UP, '0.500', '50', '5', '1'],
947
- [RoundingMode::UP, '0.499', '50', '5', '1'],
948
- [RoundingMode::UP, '0.001', '1', '1', '1'],
949
- [RoundingMode::UP, '0.000', '0', '0', '0'],
950
- [RoundingMode::UP, '-0.001', '-1', '-1', '-1'],
951
- [RoundingMode::UP, '-0.499', '-50', '-5', '-1'],
952
- [RoundingMode::UP, '-0.500', '-50', '-5', '-1'],
953
- [RoundingMode::UP, '-0.501', '-51', '-6', '-1'],
954
- [RoundingMode::UP, '-0.999', '-100', '-10', '-1'],
955
- [RoundingMode::UP, '-1.000', '-100', '-10', '-1'],
956
- [RoundingMode::UP, '-1.001', '-101', '-11', '-2'],
957
- [RoundingMode::UP, '-1.499', '-150', '-15', '-2'],
958
- [RoundingMode::UP, '-1.500', '-150', '-15', '-2'],
959
- [RoundingMode::UP, '-1.501', '-151', '-16', '-2'],
960
- [RoundingMode::UP, '-1.999', '-200', '-20', '-2'],
961
- [RoundingMode::UP, '-2.000', '-200', '-20', '-2'],
962
- [RoundingMode::UP, '-2.001', '-201', '-21', '-3'],
963
- [RoundingMode::UP, '-2.499', '-250', '-25', '-3'],
964
- [RoundingMode::UP, '-2.500', '-250', '-25', '-3'],
965
- [RoundingMode::UP, '-2.501', '-251', '-26', '-3'],
966
- [RoundingMode::UP, '-2.999', '-300', '-30', '-3'],
967
- [RoundingMode::UP, '-3.000', '-300', '-30', '-3'],
968
- [RoundingMode::UP, '-3.001', '-301', '-31', '-4'],
969
- [RoundingMode::UP, '-3.499', '-350', '-35', '-4'],
970
- [RoundingMode::UP, '-3.500', '-350', '-35', '-4'],
971
- [RoundingMode::UP, '-3.501', '-351', '-36', '-4'],
972
-
973
- [RoundingMode::DOWN, '3.501', '350', '35', '3'],
974
- [RoundingMode::DOWN, '3.500', '350', '35', '3'],
975
- [RoundingMode::DOWN, '3.499', '349', '34', '3'],
976
- [RoundingMode::DOWN, '3.001', '300', '30', '3'],
977
- [RoundingMode::DOWN, '3.000', '300', '30', '3'],
978
- [RoundingMode::DOWN, '2.999', '299', '29', '2'],
979
- [RoundingMode::DOWN, '2.501', '250', '25', '2'],
980
- [RoundingMode::DOWN, '2.500', '250', '25', '2'],
981
- [RoundingMode::DOWN, '2.499', '249', '24', '2'],
982
- [RoundingMode::DOWN, '2.001', '200', '20', '2'],
983
- [RoundingMode::DOWN, '2.000', '200', '20', '2'],
984
- [RoundingMode::DOWN, '1.999', '199', '19', '1'],
985
- [RoundingMode::DOWN, '1.501', '150', '15', '1'],
986
- [RoundingMode::DOWN, '1.500', '150', '15', '1'],
987
- [RoundingMode::DOWN, '1.499', '149', '14', '1'],
988
- [RoundingMode::DOWN, '1.001', '100', '10', '1'],
989
- [RoundingMode::DOWN, '1.000', '100', '10', '1'],
990
- [RoundingMode::DOWN, '0.999', '99', '9', '0'],
991
- [RoundingMode::DOWN, '0.501', '50', '5', '0'],
992
- [RoundingMode::DOWN, '0.500', '50', '5', '0'],
993
- [RoundingMode::DOWN, '0.499', '49', '4', '0'],
994
- [RoundingMode::DOWN, '0.001', '0', '0', '0'],
995
- [RoundingMode::DOWN, '0.000', '0', '0', '0'],
996
- [RoundingMode::DOWN, '-0.001', '0', '0', '0'],
997
- [RoundingMode::DOWN, '-0.499', '-49', '-4', '0'],
998
- [RoundingMode::DOWN, '-0.500', '-50', '-5', '0'],
999
- [RoundingMode::DOWN, '-0.501', '-50', '-5', '0'],
1000
- [RoundingMode::DOWN, '-0.999', '-99', '-9', '0'],
1001
- [RoundingMode::DOWN, '-1.000', '-100', '-10', '-1'],
1002
- [RoundingMode::DOWN, '-1.001', '-100', '-10', '-1'],
1003
- [RoundingMode::DOWN, '-1.499', '-149', '-14', '-1'],
1004
- [RoundingMode::DOWN, '-1.500', '-150', '-15', '-1'],
1005
- [RoundingMode::DOWN, '-1.501', '-150', '-15', '-1'],
1006
- [RoundingMode::DOWN, '-1.999', '-199', '-19', '-1'],
1007
- [RoundingMode::DOWN, '-2.000', '-200', '-20', '-2'],
1008
- [RoundingMode::DOWN, '-2.001', '-200', '-20', '-2'],
1009
- [RoundingMode::DOWN, '-2.499', '-249', '-24', '-2'],
1010
- [RoundingMode::DOWN, '-2.500', '-250', '-25', '-2'],
1011
- [RoundingMode::DOWN, '-2.501', '-250', '-25', '-2'],
1012
- [RoundingMode::DOWN, '-2.999', '-299', '-29', '-2'],
1013
- [RoundingMode::DOWN, '-3.000', '-300', '-30', '-3'],
1014
- [RoundingMode::DOWN, '-3.001', '-300', '-30', '-3'],
1015
- [RoundingMode::DOWN, '-3.499', '-349', '-34', '-3'],
1016
- [RoundingMode::DOWN, '-3.500', '-350', '-35', '-3'],
1017
- [RoundingMode::DOWN, '-3.501', '-350', '-35', '-3'],
1018
-
1019
- [RoundingMode::CEILING, '3.501', '351', '36', '4'],
1020
- [RoundingMode::CEILING, '3.500', '350', '35', '4'],
1021
- [RoundingMode::CEILING, '3.499', '350', '35', '4'],
1022
- [RoundingMode::CEILING, '3.001', '301', '31', '4'],
1023
- [RoundingMode::CEILING, '3.000', '300', '30', '3'],
1024
- [RoundingMode::CEILING, '2.999', '300', '30', '3'],
1025
- [RoundingMode::CEILING, '2.501', '251', '26', '3'],
1026
- [RoundingMode::CEILING, '2.500', '250', '25', '3'],
1027
- [RoundingMode::CEILING, '2.499', '250', '25', '3'],
1028
- [RoundingMode::CEILING, '2.001', '201', '21', '3'],
1029
- [RoundingMode::CEILING, '2.000', '200', '20', '2'],
1030
- [RoundingMode::CEILING, '1.999', '200', '20', '2'],
1031
- [RoundingMode::CEILING, '1.501', '151', '16', '2'],
1032
- [RoundingMode::CEILING, '1.500', '150', '15', '2'],
1033
- [RoundingMode::CEILING, '1.499', '150', '15', '2'],
1034
- [RoundingMode::CEILING, '1.001', '101', '11', '2'],
1035
- [RoundingMode::CEILING, '1.000', '100', '10', '1'],
1036
- [RoundingMode::CEILING, '0.999', '100', '10', '1'],
1037
- [RoundingMode::CEILING, '0.501', '51', '6', '1'],
1038
- [RoundingMode::CEILING, '0.500', '50', '5', '1'],
1039
- [RoundingMode::CEILING, '0.499', '50', '5', '1'],
1040
- [RoundingMode::CEILING, '0.001', '1', '1', '1'],
1041
- [RoundingMode::CEILING, '0.000', '0', '0', '0'],
1042
- [RoundingMode::CEILING, '-0.001', '0', '0', '0'],
1043
- [RoundingMode::CEILING, '-0.499', '-49' , '-4', '0'],
1044
- [RoundingMode::CEILING, '-0.500', '-50' , '-5', '0'],
1045
- [RoundingMode::CEILING, '-0.501', '-50', '-5', '0'],
1046
- [RoundingMode::CEILING, '-0.999', '-99', '-9', '0'],
1047
- [RoundingMode::CEILING, '-1.000', '-100', '-10', '-1'],
1048
- [RoundingMode::CEILING, '-1.001', '-100', '-10', '-1'],
1049
- [RoundingMode::CEILING, '-1.499', '-149', '-14', '-1'],
1050
- [RoundingMode::CEILING, '-1.500', '-150', '-15', '-1'],
1051
- [RoundingMode::CEILING, '-1.501', '-150', '-15', '-1'],
1052
- [RoundingMode::CEILING, '-1.999', '-199', '-19', '-1'],
1053
- [RoundingMode::CEILING, '-2.000', '-200', '-20', '-2'],
1054
- [RoundingMode::CEILING, '-2.001', '-200', '-20', '-2'],
1055
- [RoundingMode::CEILING, '-2.499', '-249', '-24', '-2'],
1056
- [RoundingMode::CEILING, '-2.500', '-250', '-25', '-2'],
1057
- [RoundingMode::CEILING, '-2.501', '-250', '-25', '-2'],
1058
- [RoundingMode::CEILING, '-2.999', '-299', '-29', '-2'],
1059
- [RoundingMode::CEILING, '-3.000', '-300', '-30', '-3'],
1060
- [RoundingMode::CEILING, '-3.001', '-300', '-30', '-3'],
1061
- [RoundingMode::CEILING, '-3.499', '-349', '-34', '-3'],
1062
- [RoundingMode::CEILING, '-3.500', '-350', '-35', '-3'],
1063
- [RoundingMode::CEILING, '-3.501', '-350', '-35', '-3'],
1064
-
1065
- [RoundingMode::FLOOR, '3.501', '350', '35', '3'],
1066
- [RoundingMode::FLOOR, '3.500', '350', '35', '3'],
1067
- [RoundingMode::FLOOR, '3.499', '349', '34', '3'],
1068
- [RoundingMode::FLOOR, '3.001', '300', '30', '3'],
1069
- [RoundingMode::FLOOR, '3.000', '300', '30', '3'],
1070
- [RoundingMode::FLOOR, '2.999', '299', '29', '2'],
1071
- [RoundingMode::FLOOR, '2.501', '250', '25', '2'],
1072
- [RoundingMode::FLOOR, '2.500', '250', '25', '2'],
1073
- [RoundingMode::FLOOR, '2.499', '249', '24', '2'],
1074
- [RoundingMode::FLOOR, '2.001', '200', '20', '2'],
1075
- [RoundingMode::FLOOR, '2.000', '200', '20', '2'],
1076
- [RoundingMode::FLOOR, '1.999', '199', '19', '1'],
1077
- [RoundingMode::FLOOR, '1.501', '150', '15', '1'],
1078
- [RoundingMode::FLOOR, '1.500', '150', '15', '1'],
1079
- [RoundingMode::FLOOR, '1.499', '149', '14', '1'],
1080
- [RoundingMode::FLOOR, '1.001', '100', '10', '1'],
1081
- [RoundingMode::FLOOR, '1.000', '100', '10', '1'],
1082
- [RoundingMode::FLOOR, '0.999', '99', '9', '0'],
1083
- [RoundingMode::FLOOR, '0.501', '50', '5', '0'],
1084
- [RoundingMode::FLOOR, '0.500', '50', '5', '0'],
1085
- [RoundingMode::FLOOR, '0.499', '49', '4', '0'],
1086
- [RoundingMode::FLOOR, '0.001', '0', '0', '0'],
1087
- [RoundingMode::FLOOR, '0.000', '0', '0', '0'],
1088
- [RoundingMode::FLOOR, '-0.001', '-1', '-1', '-1'],
1089
- [RoundingMode::FLOOR, '-0.499', '-50', '-5', '-1'],
1090
- [RoundingMode::FLOOR, '-0.500', '-50', '-5', '-1'],
1091
- [RoundingMode::FLOOR, '-0.501', '-51', '-6', '-1'],
1092
- [RoundingMode::FLOOR, '-0.999', '-100', '-10', '-1'],
1093
- [RoundingMode::FLOOR, '-1.000', '-100', '-10', '-1'],
1094
- [RoundingMode::FLOOR, '-1.001', '-101', '-11', '-2'],
1095
- [RoundingMode::FLOOR, '-1.499', '-150', '-15', '-2'],
1096
- [RoundingMode::FLOOR, '-1.500', '-150', '-15', '-2'],
1097
- [RoundingMode::FLOOR, '-1.501', '-151', '-16', '-2'],
1098
- [RoundingMode::FLOOR, '-1.999', '-200', '-20', '-2'],
1099
- [RoundingMode::FLOOR, '-2.000', '-200', '-20', '-2'],
1100
- [RoundingMode::FLOOR, '-2.001', '-201', '-21', '-3'],
1101
- [RoundingMode::FLOOR, '-2.499', '-250', '-25', '-3'],
1102
- [RoundingMode::FLOOR, '-2.500', '-250', '-25', '-3'],
1103
- [RoundingMode::FLOOR, '-2.501', '-251', '-26', '-3'],
1104
- [RoundingMode::FLOOR, '-2.999', '-300', '-30', '-3'],
1105
- [RoundingMode::FLOOR, '-3.000', '-300', '-30', '-3'],
1106
- [RoundingMode::FLOOR, '-3.001', '-301', '-31', '-4'],
1107
- [RoundingMode::FLOOR, '-3.499', '-350', '-35', '-4'],
1108
- [RoundingMode::FLOOR, '-3.500', '-350', '-35', '-4'],
1109
- [RoundingMode::FLOOR, '-3.501', '-351', '-36', '-4'],
1110
-
1111
- [RoundingMode::HALF_UP, '3.501', '350', '35', '4'],
1112
- [RoundingMode::HALF_UP, '3.500', '350', '35', '4'],
1113
- [RoundingMode::HALF_UP, '3.499', '350', '35', '3'],
1114
- [RoundingMode::HALF_UP, '3.001', '300', '30', '3'],
1115
- [RoundingMode::HALF_UP, '3.000', '300', '30', '3'],
1116
- [RoundingMode::HALF_UP, '2.999', '300', '30', '3'],
1117
- [RoundingMode::HALF_UP, '2.501', '250', '25', '3'],
1118
- [RoundingMode::HALF_UP, '2.500', '250', '25', '3'],
1119
- [RoundingMode::HALF_UP, '2.499', '250', '25', '2'],
1120
- [RoundingMode::HALF_UP, '2.001', '200', '20', '2'],
1121
- [RoundingMode::HALF_UP, '2.000', '200', '20', '2'],
1122
- [RoundingMode::HALF_UP, '1.999', '200', '20', '2'],
1123
- [RoundingMode::HALF_UP, '1.501', '150', '15', '2'],
1124
- [RoundingMode::HALF_UP, '1.500', '150', '15', '2'],
1125
- [RoundingMode::HALF_UP, '1.499', '150', '15', '1'],
1126
- [RoundingMode::HALF_UP, '1.001', '100', '10', '1'],
1127
- [RoundingMode::HALF_UP, '1.000', '100', '10', '1'],
1128
- [RoundingMode::HALF_UP, '0.999', '100', '10', '1'],
1129
- [RoundingMode::HALF_UP, '0.501', '50', '5', '1'],
1130
- [RoundingMode::HALF_UP, '0.500', '50', '5', '1'],
1131
- [RoundingMode::HALF_UP, '0.499', '50', '5', '0'],
1132
- [RoundingMode::HALF_UP, '0.001', '0', '0', '0'],
1133
- [RoundingMode::HALF_UP, '0.000', '0', '0', '0'],
1134
- [RoundingMode::HALF_UP, '-0.001', '0', '0', '0'],
1135
- [RoundingMode::HALF_UP, '-0.499', '-50', '-5', '0'],
1136
- [RoundingMode::HALF_UP, '-0.500', '-50', '-5', '-1'],
1137
- [RoundingMode::HALF_UP, '-0.501', '-50', '-5', '-1'],
1138
- [RoundingMode::HALF_UP, '-0.999', '-100', '-10', '-1'],
1139
- [RoundingMode::HALF_UP, '-1.000', '-100', '-10', '-1'],
1140
- [RoundingMode::HALF_UP, '-1.001', '-100', '-10', '-1'],
1141
- [RoundingMode::HALF_UP, '-1.499', '-150', '-15', '-1'],
1142
- [RoundingMode::HALF_UP, '-1.500', '-150', '-15', '-2'],
1143
- [RoundingMode::HALF_UP, '-1.501', '-150', '-15', '-2'],
1144
- [RoundingMode::HALF_UP, '-1.999', '-200', '-20', '-2'],
1145
- [RoundingMode::HALF_UP, '-2.000', '-200', '-20', '-2'],
1146
- [RoundingMode::HALF_UP, '-2.001', '-200', '-20', '-2'],
1147
- [RoundingMode::HALF_UP, '-2.499', '-250', '-25', '-2'],
1148
- [RoundingMode::HALF_UP, '-2.500', '-250', '-25', '-3'],
1149
- [RoundingMode::HALF_UP, '-2.501', '-250', '-25', '-3'],
1150
- [RoundingMode::HALF_UP, '-2.999', '-300', '-30', '-3'],
1151
- [RoundingMode::HALF_UP, '-3.000', '-300', '-30', '-3'],
1152
- [RoundingMode::HALF_UP, '-3.001', '-300', '-30', '-3'],
1153
- [RoundingMode::HALF_UP, '-3.499', '-350', '-35', '-3'],
1154
- [RoundingMode::HALF_UP, '-3.500', '-350', '-35', '-4'],
1155
- [RoundingMode::HALF_UP, '-3.501', '-350', '-35', '-4'],
1156
-
1157
- [RoundingMode::HALF_DOWN, '3.501', '350', '35', '4'],
1158
- [RoundingMode::HALF_DOWN, '3.500', '350', '35', '3'],
1159
- [RoundingMode::HALF_DOWN, '3.499', '350', '35', '3'],
1160
- [RoundingMode::HALF_DOWN, '3.001', '300', '30', '3'],
1161
- [RoundingMode::HALF_DOWN, '3.000', '300', '30', '3'],
1162
- [RoundingMode::HALF_DOWN, '2.999', '300', '30', '3'],
1163
- [RoundingMode::HALF_DOWN, '2.501', '250', '25', '3'],
1164
- [RoundingMode::HALF_DOWN, '2.500', '250', '25', '2'],
1165
- [RoundingMode::HALF_DOWN, '2.499', '250', '25', '2'],
1166
- [RoundingMode::HALF_DOWN, '2.001', '200', '20', '2'],
1167
- [RoundingMode::HALF_DOWN, '2.000', '200', '20', '2'],
1168
- [RoundingMode::HALF_DOWN, '1.999', '200', '20', '2'],
1169
- [RoundingMode::HALF_DOWN, '1.501', '150', '15', '2'],
1170
- [RoundingMode::HALF_DOWN, '1.500', '150', '15', '1'],
1171
- [RoundingMode::HALF_DOWN, '1.499', '150', '15', '1'],
1172
- [RoundingMode::HALF_DOWN, '1.001', '100', '10', '1'],
1173
- [RoundingMode::HALF_DOWN, '1.000', '100', '10', '1'],
1174
- [RoundingMode::HALF_DOWN, '0.999', '100', '10', '1'],
1175
- [RoundingMode::HALF_DOWN, '0.501', '50', '5', '1'],
1176
- [RoundingMode::HALF_DOWN, '0.500', '50', '5', '0'],
1177
- [RoundingMode::HALF_DOWN, '0.499', '50', '5', '0'],
1178
- [RoundingMode::HALF_DOWN, '0.001', '0', '0', '0'],
1179
- [RoundingMode::HALF_DOWN, '0.000', '0', '0', '0'],
1180
- [RoundingMode::HALF_DOWN, '-0.001', '0', '0', '0'],
1181
- [RoundingMode::HALF_DOWN, '-0.499', '-50', '-5', '0'],
1182
- [RoundingMode::HALF_DOWN, '-0.500', '-50', '-5', '0'],
1183
- [RoundingMode::HALF_DOWN, '-0.501', '-50', '-5', '-1'],
1184
- [RoundingMode::HALF_DOWN, '-0.999', '-100', '-10', '-1'],
1185
- [RoundingMode::HALF_DOWN, '-1.000', '-100', '-10', '-1'],
1186
- [RoundingMode::HALF_DOWN, '-1.001', '-100', '-10', '-1'],
1187
- [RoundingMode::HALF_DOWN, '-1.499', '-150', '-15', '-1'],
1188
- [RoundingMode::HALF_DOWN, '-1.500', '-150', '-15', '-1'],
1189
- [RoundingMode::HALF_DOWN, '-1.501', '-150', '-15', '-2'],
1190
- [RoundingMode::HALF_DOWN, '-1.999', '-200', '-20', '-2'],
1191
- [RoundingMode::HALF_DOWN, '-2.000', '-200', '-20', '-2'],
1192
- [RoundingMode::HALF_DOWN, '-2.001', '-200', '-20', '-2'],
1193
- [RoundingMode::HALF_DOWN, '-2.499', '-250', '-25', '-2'],
1194
- [RoundingMode::HALF_DOWN, '-2.500', '-250', '-25', '-2'],
1195
- [RoundingMode::HALF_DOWN, '-2.501', '-250', '-25', '-3'],
1196
- [RoundingMode::HALF_DOWN, '-2.999', '-300', '-30', '-3'],
1197
- [RoundingMode::HALF_DOWN, '-3.000', '-300', '-30', '-3'],
1198
- [RoundingMode::HALF_DOWN, '-3.001', '-300', '-30', '-3'],
1199
- [RoundingMode::HALF_DOWN, '-3.499', '-350', '-35', '-3'],
1200
- [RoundingMode::HALF_DOWN, '-3.500', '-350', '-35', '-3'],
1201
- [RoundingMode::HALF_DOWN, '-3.501', '-350', '-35', '-4'],
1202
-
1203
- [RoundingMode::HALF_CEILING, '3.501', '350', '35', '4'],
1204
- [RoundingMode::HALF_CEILING, '3.500', '350', '35', '4'],
1205
- [RoundingMode::HALF_CEILING, '3.499', '350', '35', '3'],
1206
- [RoundingMode::HALF_CEILING, '3.001', '300', '30', '3'],
1207
- [RoundingMode::HALF_CEILING, '3.000', '300', '30', '3'],
1208
- [RoundingMode::HALF_CEILING, '2.999', '300', '30', '3'],
1209
- [RoundingMode::HALF_CEILING, '2.501', '250', '25', '3'],
1210
- [RoundingMode::HALF_CEILING, '2.500', '250', '25', '3'],
1211
- [RoundingMode::HALF_CEILING, '2.499', '250', '25', '2'],
1212
- [RoundingMode::HALF_CEILING, '2.001', '200', '20', '2'],
1213
- [RoundingMode::HALF_CEILING, '2.000', '200', '20', '2'],
1214
- [RoundingMode::HALF_CEILING, '1.999', '200', '20', '2'],
1215
- [RoundingMode::HALF_CEILING, '1.501', '150', '15', '2'],
1216
- [RoundingMode::HALF_CEILING, '1.500', '150', '15', '2'],
1217
- [RoundingMode::HALF_CEILING, '1.499', '150', '15', '1'],
1218
- [RoundingMode::HALF_CEILING, '1.001', '100', '10', '1'],
1219
- [RoundingMode::HALF_CEILING, '1.000', '100', '10', '1'],
1220
- [RoundingMode::HALF_CEILING, '0.999', '100', '10', '1'],
1221
- [RoundingMode::HALF_CEILING, '0.501', '50', '5', '1'],
1222
- [RoundingMode::HALF_CEILING, '0.500', '50', '5', '1'],
1223
- [RoundingMode::HALF_CEILING, '0.499', '50', '5', '0'],
1224
- [RoundingMode::HALF_CEILING, '0.001', '0', '0', '0'],
1225
- [RoundingMode::HALF_CEILING, '0.000', '0', '0', '0'],
1226
- [RoundingMode::HALF_CEILING, '-0.001', '0', '0', '0'],
1227
- [RoundingMode::HALF_CEILING, '-0.499', '-50', '-5', '0'],
1228
- [RoundingMode::HALF_CEILING, '-0.500', '-50', '-5', '0'],
1229
- [RoundingMode::HALF_CEILING, '-0.501', '-50', '-5', '-1'],
1230
- [RoundingMode::HALF_CEILING, '-0.999', '-100', '-10', '-1'],
1231
- [RoundingMode::HALF_CEILING, '-1.000', '-100', '-10', '-1'],
1232
- [RoundingMode::HALF_CEILING, '-1.001', '-100', '-10', '-1'],
1233
- [RoundingMode::HALF_CEILING, '-1.499', '-150', '-15', '-1'],
1234
- [RoundingMode::HALF_CEILING, '-1.500', '-150', '-15', '-1'],
1235
- [RoundingMode::HALF_CEILING, '-1.501', '-150', '-15', '-2'],
1236
- [RoundingMode::HALF_CEILING, '-1.999', '-200', '-20', '-2'],
1237
- [RoundingMode::HALF_CEILING, '-2.000', '-200', '-20', '-2'],
1238
- [RoundingMode::HALF_CEILING, '-2.001', '-200', '-20', '-2'],
1239
- [RoundingMode::HALF_CEILING, '-2.499', '-250', '-25', '-2'],
1240
- [RoundingMode::HALF_CEILING, '-2.500', '-250', '-25', '-2'],
1241
- [RoundingMode::HALF_CEILING, '-2.501', '-250', '-25', '-3'],
1242
- [RoundingMode::HALF_CEILING, '-2.999', '-300', '-30', '-3'],
1243
- [RoundingMode::HALF_CEILING, '-3.000', '-300', '-30', '-3'],
1244
- [RoundingMode::HALF_CEILING, '-3.001', '-300', '-30', '-3'],
1245
- [RoundingMode::HALF_CEILING, '-3.499', '-350', '-35', '-3'],
1246
- [RoundingMode::HALF_CEILING, '-3.500', '-350', '-35', '-3'],
1247
- [RoundingMode::HALF_CEILING, '-3.501', '-350', '-35', '-4'],
1248
-
1249
- [RoundingMode::HALF_FLOOR, '3.501', '350', '35', '4'],
1250
- [RoundingMode::HALF_FLOOR, '3.500', '350', '35', '3'],
1251
- [RoundingMode::HALF_FLOOR, '3.499', '350', '35', '3'],
1252
- [RoundingMode::HALF_FLOOR, '3.001', '300', '30', '3'],
1253
- [RoundingMode::HALF_FLOOR, '3.000', '300', '30', '3'],
1254
- [RoundingMode::HALF_FLOOR, '2.999', '300', '30', '3'],
1255
- [RoundingMode::HALF_FLOOR, '2.501', '250', '25', '3'],
1256
- [RoundingMode::HALF_FLOOR, '2.500', '250', '25', '2'],
1257
- [RoundingMode::HALF_FLOOR, '2.499', '250', '25', '2'],
1258
- [RoundingMode::HALF_FLOOR, '2.001', '200', '20', '2'],
1259
- [RoundingMode::HALF_FLOOR, '2.000', '200', '20', '2'],
1260
- [RoundingMode::HALF_FLOOR, '1.999', '200', '20', '2'],
1261
- [RoundingMode::HALF_FLOOR, '1.501', '150', '15', '2'],
1262
- [RoundingMode::HALF_FLOOR, '1.500', '150', '15', '1'],
1263
- [RoundingMode::HALF_FLOOR, '1.499', '150', '15', '1'],
1264
- [RoundingMode::HALF_FLOOR, '1.001', '100', '10', '1'],
1265
- [RoundingMode::HALF_FLOOR, '1.000', '100', '10', '1'],
1266
- [RoundingMode::HALF_FLOOR, '0.999', '100', '10', '1'],
1267
- [RoundingMode::HALF_FLOOR, '0.501', '50', '5', '1'],
1268
- [RoundingMode::HALF_FLOOR, '0.500', '50', '5', '0'],
1269
- [RoundingMode::HALF_FLOOR, '0.499', '50', '5', '0'],
1270
- [RoundingMode::HALF_FLOOR, '0.001', '0', '0', '0'],
1271
- [RoundingMode::HALF_FLOOR, '0.000', '0', '0', '0'],
1272
- [RoundingMode::HALF_FLOOR, '-0.001', '0', '0', '0'],
1273
- [RoundingMode::HALF_FLOOR, '-0.499', '-50', '-5', '0'],
1274
- [RoundingMode::HALF_FLOOR, '-0.500', '-50', '-5', '-1'],
1275
- [RoundingMode::HALF_FLOOR, '-0.501', '-50', '-5', '-1'],
1276
- [RoundingMode::HALF_FLOOR, '-0.999', '-100', '-10', '-1'],
1277
- [RoundingMode::HALF_FLOOR, '-1.000', '-100', '-10', '-1'],
1278
- [RoundingMode::HALF_FLOOR, '-1.001', '-100', '-10', '-1'],
1279
- [RoundingMode::HALF_FLOOR, '-1.499', '-150', '-15', '-1'],
1280
- [RoundingMode::HALF_FLOOR, '-1.500', '-150', '-15', '-2'],
1281
- [RoundingMode::HALF_FLOOR, '-1.501', '-150', '-15', '-2'],
1282
- [RoundingMode::HALF_FLOOR, '-1.999', '-200', '-20', '-2'],
1283
- [RoundingMode::HALF_FLOOR, '-2.000', '-200', '-20', '-2'],
1284
- [RoundingMode::HALF_FLOOR, '-2.001', '-200', '-20', '-2'],
1285
- [RoundingMode::HALF_FLOOR, '-2.499', '-250', '-25', '-2'],
1286
- [RoundingMode::HALF_FLOOR, '-2.500', '-250', '-25', '-3'],
1287
- [RoundingMode::HALF_FLOOR, '-2.501', '-250', '-25', '-3'],
1288
- [RoundingMode::HALF_FLOOR, '-2.999', '-300', '-30', '-3'],
1289
- [RoundingMode::HALF_FLOOR, '-3.000', '-300', '-30', '-3'],
1290
- [RoundingMode::HALF_FLOOR, '-3.001', '-300', '-30', '-3'],
1291
- [RoundingMode::HALF_FLOOR, '-3.499', '-350', '-35', '-3'],
1292
- [RoundingMode::HALF_FLOOR, '-3.500', '-350', '-35', '-4'],
1293
- [RoundingMode::HALF_FLOOR, '-3.501', '-350', '-35', '-4'],
1294
-
1295
- [RoundingMode::HALF_EVEN, '3.501', '350', '35', '4'],
1296
- [RoundingMode::HALF_EVEN, '3.500', '350', '35', '4'],
1297
- [RoundingMode::HALF_EVEN, '3.499', '350', '35', '3'],
1298
- [RoundingMode::HALF_EVEN, '3.001', '300', '30', '3'],
1299
- [RoundingMode::HALF_EVEN, '3.000', '300', '30', '3'],
1300
- [RoundingMode::HALF_EVEN, '2.999', '300', '30', '3'],
1301
- [RoundingMode::HALF_EVEN, '2.501', '250', '25', '3'],
1302
- [RoundingMode::HALF_EVEN, '2.500', '250', '25', '2'],
1303
- [RoundingMode::HALF_EVEN, '2.499', '250', '25', '2'],
1304
- [RoundingMode::HALF_EVEN, '2.001', '200', '20', '2'],
1305
- [RoundingMode::HALF_EVEN, '2.000', '200', '20', '2'],
1306
- [RoundingMode::HALF_EVEN, '1.999', '200', '20', '2'],
1307
- [RoundingMode::HALF_EVEN, '1.501', '150', '15', '2'],
1308
- [RoundingMode::HALF_EVEN, '1.500', '150', '15', '2'],
1309
- [RoundingMode::HALF_EVEN, '1.499', '150', '15', '1'],
1310
- [RoundingMode::HALF_EVEN, '1.001', '100', '10', '1'],
1311
- [RoundingMode::HALF_EVEN, '1.000', '100', '10', '1'],
1312
- [RoundingMode::HALF_EVEN, '0.999', '100', '10', '1'],
1313
- [RoundingMode::HALF_EVEN, '0.501', '50', '5', '1'],
1314
- [RoundingMode::HALF_EVEN, '0.500', '50', '5', '0'],
1315
- [RoundingMode::HALF_EVEN, '0.499', '50', '5', '0'],
1316
- [RoundingMode::HALF_EVEN, '0.001', '0', '0', '0'],
1317
- [RoundingMode::HALF_EVEN, '0.000', '0', '0', '0'],
1318
- [RoundingMode::HALF_EVEN, '-0.001', '0', '0', '0'],
1319
- [RoundingMode::HALF_EVEN, '-0.499', '-50', '-5', '0'],
1320
- [RoundingMode::HALF_EVEN, '-0.500', '-50', '-5', '0'],
1321
- [RoundingMode::HALF_EVEN, '-0.501', '-50', '-5', '-1'],
1322
- [RoundingMode::HALF_EVEN, '-0.999', '-100', '-10', '-1'],
1323
- [RoundingMode::HALF_EVEN, '-1.000', '-100', '-10', '-1'],
1324
- [RoundingMode::HALF_EVEN, '-1.001', '-100', '-10', '-1'],
1325
- [RoundingMode::HALF_EVEN, '-1.499', '-150', '-15', '-1'],
1326
- [RoundingMode::HALF_EVEN, '-1.500', '-150', '-15', '-2'],
1327
- [RoundingMode::HALF_EVEN, '-1.501', '-150', '-15', '-2'],
1328
- [RoundingMode::HALF_EVEN, '-1.999', '-200', '-20', '-2'],
1329
- [RoundingMode::HALF_EVEN, '-2.000', '-200', '-20', '-2'],
1330
- [RoundingMode::HALF_EVEN, '-2.001', '-200', '-20', '-2'],
1331
- [RoundingMode::HALF_EVEN, '-2.499', '-250', '-25', '-2'],
1332
- [RoundingMode::HALF_EVEN, '-2.500', '-250', '-25', '-2'],
1333
- [RoundingMode::HALF_EVEN, '-2.501', '-250', '-25', '-3'],
1334
- [RoundingMode::HALF_EVEN, '-2.999', '-300', '-30', '-3'],
1335
- [RoundingMode::HALF_EVEN, '-3.000', '-300', '-30', '-3'],
1336
- [RoundingMode::HALF_EVEN, '-3.001', '-300', '-30', '-3'],
1337
- [RoundingMode::HALF_EVEN, '-3.499', '-350', '-35', '-3'],
1338
- [RoundingMode::HALF_EVEN, '-3.500', '-350', '-35', '-4'],
1339
- [RoundingMode::HALF_EVEN, '-3.501', '-350', '-35', '-4'],
1340
-
1341
- [RoundingMode::UNNECESSARY, '3.501', null, null, null],
1342
- [RoundingMode::UNNECESSARY, '3.500', '350', '35', null],
1343
- [RoundingMode::UNNECESSARY, '3.499', null, null, null],
1344
- [RoundingMode::UNNECESSARY, '3.001', null, null, null],
1345
- [RoundingMode::UNNECESSARY, '3.000', '300', '30', '3'],
1346
- [RoundingMode::UNNECESSARY, '2.999', null, null, null],
1347
- [RoundingMode::UNNECESSARY, '2.501', null, null, null],
1348
- [RoundingMode::UNNECESSARY, '2.500', '250', '25', null],
1349
- [RoundingMode::UNNECESSARY, '2.499', null, null, null],
1350
- [RoundingMode::UNNECESSARY, '2.001', null, null, null],
1351
- [RoundingMode::UNNECESSARY, '2.000', '200', '20', '2'],
1352
- [RoundingMode::UNNECESSARY, '1.999', null, null, null],
1353
- [RoundingMode::UNNECESSARY, '1.501', null, null, null],
1354
- [RoundingMode::UNNECESSARY, '1.500', '150', '15', null],
1355
- [RoundingMode::UNNECESSARY, '1.499', null, null, null],
1356
- [RoundingMode::UNNECESSARY, '1.001', null, null, null],
1357
- [RoundingMode::UNNECESSARY, '1.000', '100', '10', '1'],
1358
- [RoundingMode::UNNECESSARY, '0.999', null, null, null],
1359
- [RoundingMode::UNNECESSARY, '0.501', null, null, null],
1360
- [RoundingMode::UNNECESSARY, '0.500', '50', '5', null],
1361
- [RoundingMode::UNNECESSARY, '0.499', null, null, null],
1362
- [RoundingMode::UNNECESSARY, '0.001', null, null, null],
1363
- [RoundingMode::UNNECESSARY, '0.000', '0', '0', '0'],
1364
- [RoundingMode::UNNECESSARY, '-0.001', null, null, null],
1365
- [RoundingMode::UNNECESSARY, '-0.499', null, null, null],
1366
- [RoundingMode::UNNECESSARY, '-0.500', '-50', '-5', null],
1367
- [RoundingMode::UNNECESSARY, '-0.501', null, null, null],
1368
- [RoundingMode::UNNECESSARY, '-0.999', null, null, null],
1369
- [RoundingMode::UNNECESSARY, '-1.000', '-100', '-10', '-1'],
1370
- [RoundingMode::UNNECESSARY, '-1.001', null, null, null],
1371
- [RoundingMode::UNNECESSARY, '-1.499', null, null, null],
1372
- [RoundingMode::UNNECESSARY, '-1.500', '-150', '-15', null],
1373
- [RoundingMode::UNNECESSARY, '-1.501', null, null, null],
1374
- [RoundingMode::UNNECESSARY, '-1.999', null, null, null],
1375
- [RoundingMode::UNNECESSARY, '-2.000', '-200', '-20', '-2'],
1376
- [RoundingMode::UNNECESSARY, '-2.001', null, null, null],
1377
- [RoundingMode::UNNECESSARY, '-2.499', null, null, null],
1378
- [RoundingMode::UNNECESSARY, '-2.500', '-250', '-25', null],
1379
- [RoundingMode::UNNECESSARY, '-2.501', null, null, null],
1380
- [RoundingMode::UNNECESSARY, '-2.999', null, null, null],
1381
- [RoundingMode::UNNECESSARY, '-3.000', '-300', '-30', '-3'],
1382
- [RoundingMode::UNNECESSARY, '-3.001', null, null, null],
1383
- [RoundingMode::UNNECESSARY, '-3.499', null, null, null],
1384
- [RoundingMode::UNNECESSARY, '-3.500', '-350', '-35', null],
1385
- [RoundingMode::UNNECESSARY, '-3.501', null, null, null],
1386
- ];
1387
- }
1388
-
1389
- /**
1390
- * @dataProvider providerQuotientAndRemainder
1391
- *
1392
- * @param string $dividend The dividend.
1393
- * @param string $divisor The divisor.
1394
- * @param string $quotient The expected quotient.
1395
- * @param string $remainder The expected remainder.
1396
- */
1397
- public function testQuotientAndRemainder(string $dividend, string $divisor, string $quotient, string $remainder) : void
1398
- {
1399
- $dividend = BigDecimal::of($dividend);
1400
-
1401
- self::assertBigDecimalEquals($quotient, $dividend->quotient($divisor));
1402
- self::assertBigDecimalEquals($remainder, $dividend->remainder($divisor));
1403
-
1404
- [$q, $r] = $dividend->quotientAndRemainder($divisor);
1405
-
1406
- self::assertBigDecimalEquals($quotient, $q);
1407
- self::assertBigDecimalEquals($remainder, $r);
1408
- }
1409
-
1410
- public function providerQuotientAndRemainder() : array
1411
- {
1412
- return [
1413
- ['1', '123', '0', '1'],
1414
- ['1', '-123', '0', '1'],
1415
- ['-1', '123', '0', '-1'],
1416
- ['-1', '-123', '0', '-1'],
1417
-
1418
- ['1999999999999999999999999', '2000000000000000000000000', '0', '1999999999999999999999999'],
1419
- ['1999999999999999999999999', '-2000000000000000000000000', '0', '1999999999999999999999999'],
1420
- ['-1999999999999999999999999', '2000000000000000000000000', '0', '-1999999999999999999999999'],
1421
- ['-1999999999999999999999999', '-2000000000000000000000000', '0', '-1999999999999999999999999'],
1422
-
1423
- ['123', '1', '123', '0'],
1424
- ['123', '-1', '-123', '0'],
1425
- ['-123', '1', '-123', '0'],
1426
- ['-123', '-1', '123', '0'],
1427
-
1428
- ['123', '2', '61', '1'],
1429
- ['123', '-2', '-61', '1'],
1430
- ['-123', '2', '-61', '-1'],
1431
- ['-123', '-2', '61', '-1'],
1432
-
1433
- ['123', '123', '1', '0'],
1434
- ['123', '-123', '-1', '0'],
1435
- ['-123', '123', '-1', '0'],
1436
- ['-123', '-123', '1', '0'],
1437
-
1438
- ['123', '124', '0', '123'],
1439
- ['123', '-124', '0', '123'],
1440
- ['-123', '124', '0', '-123'],
1441
- ['-123', '-124', '0', '-123'],
1442
-
1443
- ['124', '123', '1', '1'],
1444
- ['124', '-123', '-1', '1'],
1445
- ['-124', '123', '-1', '-1'],
1446
- ['-124', '-123', '1', '-1'],
1447
-
1448
- ['1000000000000000000000000000000', '3', '333333333333333333333333333333', '1'],
1449
- ['1000000000000000000000000000000', '9', '111111111111111111111111111111', '1'],
1450
- ['1000000000000000000000000000000', '11', '90909090909090909090909090909', '1'],
1451
- ['1000000000000000000000000000000', '13', '76923076923076923076923076923', '1'],
1452
- ['1000000000000000000000000000000', '21', '47619047619047619047619047619', '1'],
1453
-
1454
- ['123456789123456789123456789', '987654321987654321', '124999998', '850308642973765431'],
1455
- ['123456789123456789123456789', '-87654321987654321', '-1408450676', '65623397056685793'],
1456
- ['-123456789123456789123456789', '7654321987654321', '-16129030020', '-1834176331740369'],
1457
- ['-123456789123456789123456789', '-654321987654321', '188678955396', '-205094497790673'],
1458
-
1459
- ['10.11', '3.3', '3', '0.21'],
1460
- ['1', '-0.0013', '-769', '0.0003'],
1461
- ['-1.000000000000000000001', '0.0000009298439898981609', '-1075449', '-0.0000002109080127582569'],
1462
- ['-1278438782896060000132323.32333', '-53.4836775545640521556878910541', '23903344746475158719036', '-30.0786684482104867175202241524'],
1463
- ['23999593472872987498347103908209387429846376', '-0.005', '-4799918694574597499669420781641877485969275200', '0.000'],
1464
-
1465
- ['1000000000000000000000000000000.0', '3', '333333333333333333333333333333', '1.0'],
1466
- ['1000000000000000000000000000000.0', '9', '111111111111111111111111111111', '1.0'],
1467
- ['1000000000000000000000000000000.0', '11', '90909090909090909090909090909', '1.0'],
1468
- ['1000000000000000000000000000000.0', '13', '76923076923076923076923076923', '1.0'],
1469
- ['0.9999999999999999999999999999999', '0.21', '4', '0.1599999999999999999999999999999'],
1470
-
1471
- ['1000000000000000000000000000000.0', '3.9', '256410256410256410256410256410', '1.0'],
1472
- ['-1000000000000000000000000000000.0', '9.8', '-102040816326530612244897959183', '-6.6'],
1473
- ['1000000000000000000000000000000.0', '-11.7', '-85470085470085470085470085470', '1.0'],
1474
- ['-1000000000000000000000000000000.0', '-13.7', '72992700729927007299270072992', '-9.6'],
1475
- ['0.99999999999999999999999999999999', '0.215', '4', '0.13999999999999999999999999999999'],
1476
- ];
1477
- }
1478
-
1479
- public function testQuotientOfZeroThrowsException() : void
1480
- {
1481
- $this->expectException(DivisionByZeroException::class);
1482
- BigDecimal::of(1.2)->quotient(0);
1483
- }
1484
-
1485
- public function testRemainderOfZeroThrowsException() : void
1486
- {
1487
- $this->expectException(DivisionByZeroException::class);
1488
- BigDecimal::of(1.2)->remainder(0);
1489
- }
1490
-
1491
- public function testQuotientAndRemainderOfZeroThrowsException() : void
1492
- {
1493
- $this->expectException(DivisionByZeroException::class);
1494
- BigDecimal::of(1.2)->quotientAndRemainder(0);
1495
- }
1496
-
1497
- /**
1498
- * @dataProvider providerSqrt
1499
- */
1500
- public function testSqrt(string $number, int $scale, string $sqrt) : void
1501
- {
1502
- $number = BigDecimal::of($number);
1503
-
1504
- self::assertBigDecimalEquals($sqrt, $number->sqrt($scale));
1505
- }
1506
-
1507
- public function providerSqrt() : array
1508
- {
1509
- return [
1510
- ['0', 0, '0'],
1511
- ['0', 1, '0.0'],
1512
- ['0', 2, '0.00'],
1513
- ['0.9', 0, '0'],
1514
- ['0.9', 1, '0.9'],
1515
- ['0.9', 2, '0.94'],
1516
- ['0.9', 20, '0.94868329805051379959'],
1517
-
1518
- ['1', 0, '1'],
1519
- ['1', 1, '1.0'],
1520
- ['1', 2, '1.00'],
1521
- ['1.01', 0, '1'],
1522
- ['1.01', 1, '1.0'],
1523
- ['1.01', 2, '1.00'],
1524
- ['1.01', 50, '1.00498756211208902702192649127595761869450234700263'],
1525
-
1526
- ['2', 0, '1'],
1527
- ['2', 1, '1.4'],
1528
- ['2', 2, '1.41'],
1529
- ['2', 3, '1.414'],
1530
- ['2.0', 10, '1.4142135623'],
1531
- ['2.00', 100, '1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727'],
1532
- ['2.01', 100, '1.4177446878757825202955618542708577926112284524295925478183838620667251915680282359142910339946198902'],
1533
-
1534
- ['3', 0, '1'],
1535
- ['3', 1, '1.7'],
1536
- ['3', 2, '1.73'],
1537
- ['3.0', 3, '1.732'],
1538
- ['3.00', 100, '1.7320508075688772935274463415058723669428052538103806280558069794519330169088000370811461867572485756'],
1539
- ['3.01', 100, '1.7349351572897472412324994276999816954904345949805056180301062018688462654791174593725963060697252989'],
1540
-
1541
- ['4', 0, '2'],
1542
- ['4.0', 1, '2.0'],
1543
- ['4.00', 2, '2.00'],
1544
- ['4.000', 50, '2.00000000000000000000000000000000000000000000000000'],
1545
- ['4.001', 50, '2.00024998437695281987761450010498155779765165614814'],
1546
-
1547
- ['8', 0, '2'],
1548
- ['8', 1, '2.8'],
1549
- ['8', 2, '2.82'],
1550
- ['8', 3, '2.828'],
1551
- ['8', 100, '2.8284271247461900976033774484193961571393437507538961463533594759814649569242140777007750686552831454'],
1552
-
1553
- ['9', 0, '3'],
1554
- ['9', 1, '3.0'],
1555
- ['9', 2, '3.00'],
1556
- ['9.0', 3, '3.000'],
1557
- ['9.00', 50, '3.00000000000000000000000000000000000000000000000000'],
1558
- ['9.000000000001', 100, '3.0000000000001666666666666620370370370372942386831275541552354823973654295585021450670206100119695201'],
1559
-
1560
- ['15', 0, '3'],
1561
- ['15', 1, '3.8'],
1562
- ['15', 2, '3.87'],
1563
- ['15', 3, '3.872'],
1564
- ['15', 100, '3.8729833462074168851792653997823996108329217052915908265875737661134830919369790335192873768586735179'],
1565
-
1566
- ['16', 0, '4'],
1567
- ['16', 1, '4.0'],
1568
- ['16.0', 2, '4.00'],
1569
- ['16.0', 50, '4.00000000000000000000000000000000000000000000000000'],
1570
- ['16.9', 100, '4.1109609582188931315985616077625340938354216811227818749147563086303727702310096877475225408930903837'],
1571
-
1572
- ['24.000000', 0, '4'],
1573
- ['24.000000', 1, '4.8'],
1574
- ['24.000000', 100, '4.8989794855663561963945681494117827839318949613133402568653851345019207549146300530797188662092804696'],
1575
-
1576
- ['25.0', 0, '5'],
1577
- ['25.0', 1, '5.0'],
1578
- ['25.0', 2, '5.00'],
1579
- ['25.0', 50, '5.00000000000000000000000000000000000000000000000000'],
1580
-
1581
- ['35.0', 0, '5'],
1582
- ['35.0', 1, '5.9'],
1583
- ['35.0', 2, '5.91'],
1584
- ['35.0', 3, '5.916'],
1585
- ['35.0', 4, '5.9160'],
1586
- ['35.0', 5, '5.91607'],
1587
- ['35.0', 100, '5.9160797830996160425673282915616170484155012307943403228797196691428224591056530367657525271831091780'],
1588
- ['35.000000000000001', 100, '5.9160797830996161270827537644132741956957234470198942745396537100863774127246283998019188486148209315'],
1589
- ['35.999999999999999999999999', 100, '5.9999999999999999999999999166666666666666666666666660879629629629629629629629549254115226337448559670'],
1590
-
1591
- ['36.00', 0, '6'],
1592
- ['36.00', 1, '6.0'],
1593
- ['36.00', 2, '6.00'],
1594
- ['36.00', 3, '6.000'],
1595
- ['36.00', 50, '6.00000000000000000000000000000000000000000000000000'],
1596
-
1597
- ['48.00', 0, '6'],
1598
- ['48.00', 2, '6.92'],
1599
- ['48.00', 10, '6.9282032302'],
1600
- ['48.00', 100, '6.9282032302755091741097853660234894677712210152415225122232279178077320676352001483245847470289943027'],
1601
- ['48.99', 100, '6.9992856778388464346356995151906110076016504604210370025102717611026824990288822856842902895079113686'],
1602
-
1603
- ['49.000', 0, '7'],
1604
- ['49.000', 1, '7.0'],
1605
- ['49.000', 2, '7.00'],
1606
- ['49.000', 50, '7.00000000000000000000000000000000000000000000000000'],
1607
-
1608
- ['63.000', 0, '7'],
1609
- ['63.000', 1, '7.9'],
1610
- ['63.000', 50, '7.93725393319377177150484726091778127713077754924735'],
1611
- ['63.000', 100, '7.9372539331937717715048472609177812771307775492473505411050033776032064696908508832811786594236308318'],
1612
- ['63.999', 100, '7.9999374997558574676327405322784897796491608172719005229581557200716046333750586163480165729931946120'],
1613
-
1614
- ['64.000', 0, '8'],
1615
- ['64.000', 1, '8.0'],
1616
- ['64.000', 2, '8.00'],
1617
- ['64.000', 3, '8.000'],
1618
- ['64.000', 5, '8.00000'],
1619
- ['64.000', 10, '8.0000000000'],
1620
- ['64.001', 100, '8.0000624997558612823300065647321162325407871131077227756517693705917932138407362275702583154308502098'],
1621
-
1622
- ['80.0000', 0, '8'],
1623
- ['80.0000', 1, '8.9'],
1624
- ['80.0000', 2, '8.94'],
1625
- ['80.0000', 3, '8.944'],
1626
- ['80.0000', 100, '8.9442719099991587856366946749251049417624734384461028970835889816420837025512195976576576335151290998'],
1627
- ['80.9999', 100, '8.9999944444427297657453970731875168384468609868424736666730189165386046474591090720552569708711327582'],
1628
-
1629
- ['81.0000', 0, '9'],
1630
- ['81.0000', 1, '9.0'],
1631
- ['81.0000', 2, '9.00'],
1632
- ['81.0000', 3, '9.000'],
1633
- ['81.0000', 100, '9.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'],
1634
- ['81.0001', 100, '9.0000055555538408789733941603538253684017661110877201067416238610513773808272313229667905649560045446'],
1635
-
1636
- ['99.0000', 0, '9'],
1637
- ['99.0000', 1, '9.9'],
1638
- ['99.0000', 2, '9.94'],
1639
- ['99.0000', 3, '9.949'],
1640
- ['99.0000', 100, '9.9498743710661995473447982100120600517812656367680607911760464383494539278271315401265301973848719527'],
1641
- ['99.9999', 100, '9.9999949999987499993749996093747265622949217138670565794807433154677543830170797681772155388691566433'],
1642
-
1643
- ['100.00000', 0, '10'],
1644
- ['100.00000', 1, '10.0'],
1645
- ['100.00000', 2, '10.00'],
1646
- ['100.00000', 3, '10.000'],
1647
- ['100.00000', 100, '10.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'],
1648
- ['100.00001', 100, '10.0000004999999875000006249999609375027343747949218911132799407960075378325233467481612458396019939178'],
1649
-
1650
- ['536137214136734800142146901786039940282473271927911507640625', 100, '732213912826528310663262741625.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'],
1651
- ['536137214136734800142146901787504368108126328549238033123875', 100, '732213912826528310663262741625.9999999999999999999999999999993171394434860226777473099041602996062918768042176806905944729779944325'],
1652
- ['536137214136734800142146901787504368108126328549238033123876', 100, '732213912826528310663262741626.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'],
1653
- ['5651495859544574019979802175954184725583245698990648064256.0000000001', 100, '75176431543034642899535752016.0000000000000000000000000000000000000006651020668808623891656648072197795077909627885735661691784990'],
1654
- ['5651495859544574019979802176104537588669314984789719568288.9999999999', 100, '75176431543034642899535752016.9999999999999999999999999999999999999993348979331191376108343351927890677073964211143577833889761307'],
1655
- ['5651495859544574019979802176104537588669314984789719568289.00000000001', 100, '75176431543034642899535752017.0000000000000000000000000000000000000000665102066880862389165664807210932292603578885642216611023869'],
1656
-
1657
- ['17', 60, '4.123105625617660549821409855974077025147199225373620434398633'],
1658
- ['17', 61, '4.1231056256176605498214098559740770251471992253736204343986335'],
1659
- ['17', 62, '4.12310562561766054982140985597407702514719922537362043439863357'],
1660
- ['17', 63, '4.123105625617660549821409855974077025147199225373620434398633573'],
1661
- ['17', 64, '4.1231056256176605498214098559740770251471992253736204343986335730'],
1662
- ['17', 65, '4.12310562561766054982140985597407702514719922537362043439863357309'],
1663
- ['17', 66, '4.123105625617660549821409855974077025147199225373620434398633573094'],
1664
- ['17', 67, '4.1231056256176605498214098559740770251471992253736204343986335730949'],
1665
- ['17', 68, '4.12310562561766054982140985597407702514719922537362043439863357309495'],
1666
- ['17', 69, '4.123105625617660549821409855974077025147199225373620434398633573094954'],
1667
- ['17', 70, '4.1231056256176605498214098559740770251471992253736204343986335730949543'],
1668
-
1669
- ['0.0019', 0, '0'],
1670
- ['0.0019', 1, '0.0'],
1671
- ['0.0019', 2, '0.04'],
1672
- ['0.0019', 3, '0.043'],
1673
- ['0.0019', 10, '0.0435889894'],
1674
- ['0.0019', 70, '0.0435889894354067355223698198385961565913700392523244493689034413815955'],
1675
-
1676
- ['0.00000000015727468406479', 0, '0'],
1677
- ['0.00000000015727468406479', 1, '0.0'],
1678
- ['0.00000000015727468406479', 2, '0.00'],
1679
- ['0.00000000015727468406479', 3, '0.000'],
1680
- ['0.00000000015727468406479', 4, '0.0000'],
1681
- ['0.00000000015727468406479', 5, '0.00001'],
1682
- ['0.00000000015727468406479', 6, '0.000012'],
1683
- ['0.00000000015727468406479', 7, '0.0000125'],
1684
- ['0.00000000015727468406479', 8, '0.00001254'],
1685
- ['0.00000000015727468406479', 9, '0.000012540'],
1686
- ['0.00000000015727468406479', 10, '0.0000125409'],
1687
- ['0.00000000015727468406479', 100, '0.0000125409203834802332262270521125445995500262491027973910117525063503841909945796984522050136239469'],
1688
-
1689
- ['0.04', 0, '0'],
1690
- ['0.04', 1, '0.2'],
1691
- ['0.04', 2, '0.20'],
1692
- ['0.04', 10, '0.2000000000'],
1693
-
1694
- ['0.0004', 4, '0.0200'],
1695
- ['0.00000000000000000000000000000004', 8, '0.00000000'],
1696
- ['0.00000000000000000000000000000004', 16, '0.0000000000000002'],
1697
- ['0.00000000000000000000000000000004', 32, '0.00000000000000020000000000000000'],
1698
- ['0.000000000000000000000000000000004', 32, '0.00000000000000006324555320336758'],
1699
-
1700
- ['111111111111111111111.11111111111111', 90, '10540925533.894597773329645148109061726360556128277733889543457102096672435043305908711407747018689086']
1701
- ];
1702
- }
1703
-
1704
- public function testSqrtOfNegativeNumber() : void
1705
- {
1706
- $number = BigDecimal::of(-1);
1707
- $this->expectException(NegativeNumberException::class);
1708
- $number->sqrt(0);
1709
- }
1710
-
1711
- public function testSqrtWithNegativeScale() : void
1712
- {
1713
- $number = BigDecimal::of(1);
1714
- $this->expectException(\InvalidArgumentException::class);
1715
- $number->sqrt(-1);
1716
- }
1717
-
1718
- /**
1719
- * @dataProvider providerPower
1720
- *
1721
- * @param string $number The base number.
1722
- * @param int $exponent The exponent to apply.
1723
- * @param string $unscaledValue The expected unscaled value of the result.
1724
- * @param int $scale The expected scale of the result.
1725
- */
1726
- public function testPower(string $number, int $exponent, string $unscaledValue, int $scale) : void
1727
- {
1728
- self::assertBigDecimalInternalValues($unscaledValue, $scale, BigDecimal::of($number)->power($exponent));
1729
- }
1730
-
1731
- public function providerPower() : array
1732
- {
1733
- return [
1734
- ['-3', 0, '1', 0],
1735
- ['-2', 0, '1', 0],
1736
- ['-1', 0, '1', 0],
1737
- ['0', 0, '1', 0],
1738
- ['1', 0, '1', 0],
1739
- ['2', 0, '1', 0],
1740
- ['3', 0, '1', 0],
1741
-
1742
- ['-3', 1, '-3', 0],
1743
- ['-2', 1, '-2', 0],
1744
- ['-1', 1, '-1', 0],
1745
- ['0', 1, '0', 0],
1746
- ['1', 1, '1', 0],
1747
- ['2', 1, '2', 0],
1748
- ['3', 1, '3', 0],
1749
-
1750
- ['-3', 2, '9', 0],
1751
- ['-2', 2, '4', 0],
1752
- ['-1', 2, '1', 0],
1753
- ['0', 2, '0', 0],
1754
- ['1', 2, '1', 0],
1755
- ['2', 2, '4', 0],
1756
- ['3', 2, '9', 0],
1757
-
1758
- ['-3', 3, '-27', 0],
1759
- ['-2', 3, '-8', 0],
1760
- ['-1', 3, '-1', 0],
1761
- ['0', 3, '0', 0],
1762
- ['1', 3, '1', 0],
1763
- ['2', 3, '8', 0],
1764
- ['3', 3, '27', 0],
1765
-
1766
- ['0', 1000000, '0', 0],
1767
- ['1', 1000000, '1', 0],
1768
-
1769
- ['-2', 255, '-57896044618658097711785492504343953926634992332820282019728792003956564819968', 0],
1770
- [ '2', 256, '115792089237316195423570985008687907853269984665640564039457584007913129639936', 0],
1771
-
1772
- ['-1.23', 0, '1', 0],
1773
- ['-1.23', 0, '1', 0],
1774
- ['-1.23', 33, '-926549609804623448265268294182900512918058893428212027689876489708283', 66],
1775
- [ '1.23', 34, '113965602005968684136628000184496763088921243891670079405854808234118809', 68],
1776
-
1777
- ['-123456789', 8, '53965948844821664748141453212125737955899777414752273389058576481', 0],
1778
- ['9876543210', 7, '9167159269868350921847491739460569765344716959834325922131706410000000', 0]
1779
- ];
1780
- }
1781
-
1782
- /**
1783
- * @dataProvider providerPowerWithInvalidExponentThrowsException
1784
- */
1785
- public function testPowerWithInvalidExponentThrowsException(int $power) : void
1786
- {
1787
- $this->expectException(\InvalidArgumentException::class);
1788
- BigDecimal::of(1)->power($power);
1789
- }
1790
-
1791
- public function providerPowerWithInvalidExponentThrowsException() : array
1792
- {
1793
- return [
1794
- [-1],
1795
- [1000001]
1796
- ];
1797
- }
1798
-
1799
- /**
1800
- * @dataProvider toScaleProvider
1801
- *
1802
- * @param string $number The number to scale.
1803
- * @param int $toScale The scale to apply.
1804
- * @param int $roundingMode The rounding mode to apply.
1805
- * @param string $unscaledValue The expected unscaled value of the result.
1806
- * @param int $scale The expected scale of the result.
1807
- */
1808
- public function testToScale(string $number, int $toScale, int $roundingMode, string $unscaledValue, int $scale) : void
1809
- {
1810
- $decimal = BigDecimal::of($number)->toScale($toScale, $roundingMode);
1811
- self::assertBigDecimalInternalValues($unscaledValue, $scale, $decimal);
1812
- }
1813
-
1814
- public function toScaleProvider() : array
1815
- {
1816
- return [
1817
- ['123.45', 0, RoundingMode::DOWN, '123', 0],
1818
- ['123.45', 1, RoundingMode::UP, '1235', 1],
1819
- ['123.45', 2, RoundingMode::UNNECESSARY, '12345', 2],
1820
- ['123.45', 5, RoundingMode::UNNECESSARY, '12345000', 5]
1821
- ];
1822
- }
1823
-
1824
- /**
1825
- * @dataProvider providerWithPointMovedLeft
1826
- *
1827
- * @param string $number The decimal number as a string.
1828
- * @param int $places The number of decimal places to move left.
1829
- * @param string $expected The expected result.
1830
- */
1831
- public function testWithPointMovedLeft(string $number, int $places, string $expected) : void
1832
- {
1833
- self::assertBigDecimalEquals($expected, BigDecimal::of($number)->withPointMovedLeft($places));
1834
- }
1835
-
1836
- public function providerWithPointMovedLeft() : array
1837
- {
1838
- return [
1839
- ['0', -2, '0'],
1840
- ['0', -1, '0'],
1841
- ['0', 0, '0'],
1842
- ['0', 1, '0.0'],
1843
- ['0', 2, '0.00'],
1844
-
1845
- ['0.0', -2, '0'],
1846
- ['0.0', -1, '0'],
1847
- ['0.0', 0, '0.0'],
1848
- ['0.0', 1, '0.00'],
1849
- ['0.0', 2, '0.000'],
1850
-
1851
- ['1', -2, '100'],
1852
- ['1', -1, '10'],
1853
- ['1', 0, '1'],
1854
- ['1', 1, '0.1'],
1855
- ['1', 2, '0.01'],
1856
-
1857
- ['12', -2, '1200'],
1858
- ['12', -1, '120'],
1859
- ['12', 0, '12'],
1860
- ['12', 1, '1.2'],
1861
- ['12', 2, '0.12'],
1862
-
1863
- ['1.1', -2, '110'],
1864
- ['1.1', -1, '11'],
1865
- ['1.1', 0, '1.1'],
1866
- ['1.1', 1, '0.11'],
1867
- ['1.1', 2, '0.011'],
1868
-
1869
- ['0.1', -2, '10'],
1870
- ['0.1', -1, '1'],
1871
- ['0.1', 0, '0.1'],
1872
- ['0.1', 1, '0.01'],
1873
- ['0.1', 2, '0.001'],
1874
-
1875
- ['0.01', -2, '1'],
1876
- ['0.01', -1, '0.1'],
1877
- ['0.01', 0, '0.01'],
1878
- ['0.01', 1, '0.001'],
1879
- ['0.01', 2, '0.0001'],
1880
-
1881
- ['-9', -2, '-900'],
1882
- ['-9', -1, '-90'],
1883
- ['-9', 0, '-9'],
1884
- ['-9', 1, '-0.9'],
1885
- ['-9', 2, '-0.09'],
1886
-
1887
- ['-0.9', -2, '-90'],
1888
- ['-0.9', -1, '-9'],
1889
- ['-0.9', 0, '-0.9'],
1890
- ['-0.9', 1, '-0.09'],
1891
- ['-0.9', 2, '-0.009'],
1892
-
1893
- ['-0.09', -2, '-9'],
1894
- ['-0.09', -1, '-0.9'],
1895
- ['-0.09', 0, '-0.09'],
1896
- ['-0.09', 1, '-0.009'],
1897
- ['-0.09', 2, '-0.0009'],
1898
-
1899
- ['-12.3', -2, '-1230'],
1900
- ['-12.3', -1, '-123'],
1901
- ['-12.3', 0, '-12.3'],
1902
- ['-12.3', 1, '-1.23'],
1903
- ['-12.3', 2, '-0.123'],
1904
- ];
1905
- }
1906
-
1907
- /**
1908
- * @dataProvider providerWithPointMovedRight
1909
- *
1910
- * @param string $number The decimal number as a string.
1911
- * @param int $places The number of decimal places to move right.
1912
- * @param string $expected The expected result.
1913
- */
1914
- public function testWithPointMovedRight(string $number, int $places, string $expected) : void
1915
- {
1916
- self::assertBigDecimalEquals($expected, BigDecimal::of($number)->withPointMovedRight($places));
1917
- }
1918
-
1919
- public function providerWithPointMovedRight() : array
1920
- {
1921
- return [
1922
- ['0', -2, '0.00'],
1923
- ['0', -1, '0.0'],
1924
- ['0', 0, '0'],
1925
- ['0', 1, '0'],
1926
- ['0', 2, '0'],
1927
-
1928
- ['0.0', -2, '0.000'],
1929
- ['0.0', -1, '0.00'],
1930
- ['0.0', 0, '0.0'],
1931
- ['0.0', 1, '0'],
1932
- ['0.0', 2, '0'],
1933
-
1934
- ['9', -2, '0.09'],
1935
- ['9', -1, '0.9'],
1936
- ['9', 0, '9'],
1937
- ['9', 1, '90'],
1938
- ['9', 2, '900'],
1939
-
1940
- ['89', -2, '0.89'],
1941
- ['89', -1, '8.9'],
1942
- ['89', 0, '89'],
1943
- ['89', 1, '890'],
1944
- ['89', 2, '8900'],
1945
-
1946
- ['8.9', -2, '0.089'],
1947
- ['8.9', -1, '0.89'],
1948
- ['8.9', 0, '8.9'],
1949
- ['8.9', 1, '89'],
1950
- ['8.9', 2, '890'],
1951
-
1952
- ['0.9', -2, '0.009'],
1953
- ['0.9', -1, '0.09'],
1954
- ['0.9', 0, '0.9'],
1955
- ['0.9', 1, '9'],
1956
- ['0.9', 2, '90'],
1957
-
1958
- ['0.09', -2, '0.0009'],
1959
- ['0.09', -1, '0.009'],
1960
- ['0.09', 0, '0.09'],
1961
- ['0.09', 1, '0.9'],
1962
- ['0.09', 2, '9'],
1963
-
1964
- ['-1', -2, '-0.01'],
1965
- ['-1', -1, '-0.1'],
1966
- ['-1', 0, '-1'],
1967
- ['-1', 1, '-10'],
1968
- ['-1', 2, '-100'],
1969
-
1970
- ['-0.1', -2, '-0.001'],
1971
- ['-0.1', -1, '-0.01'],
1972
- ['-0.1', 0, '-0.1'],
1973
- ['-0.1', 1, '-1'],
1974
- ['-0.1', 2, '-10'],
1975
-
1976
- ['-0.01', -2, '-0.0001'],
1977
- ['-0.01', -1, '-0.001'],
1978
- ['-0.01', 0, '-0.01'],
1979
- ['-0.01', 1, '-0.1'],
1980
- ['-0.01', 2, '-1'],
1981
-
1982
- ['-12.3', -2, '-0.123'],
1983
- ['-12.3', -1, '-1.23'],
1984
- ['-12.3', 0, '-12.3'],
1985
- ['-12.3', 1, '-123'],
1986
- ['-12.3', 2, '-1230'],
1987
- ];
1988
- }
1989
-
1990
- /**
1991
- * @dataProvider providerStripTrailingZeros
1992
- *
1993
- * @param string $number The number to trim.
1994
- * @param string $expected The expected result.
1995
- */
1996
- public function testStripTrailingZeros(string $number, string $expected) : void
1997
- {
1998
- self::assertBigDecimalEquals($expected, BigDecimal::of($number)->stripTrailingZeros());
1999
- }
2000
-
2001
- public function providerStripTrailingZeros() : array
2002
- {
2003
- return [
2004
- ['0', '0'],
2005
- ['0.0', '0'],
2006
- ['0.00', '0'],
2007
- ['0.000', '0'],
2008
- ['0.1', '0.1'],
2009
- ['0.01', '0.01'],
2010
- ['0.001', '0.001'],
2011
- ['0.100', '0.1'],
2012
- ['0.0100', '0.01'],
2013
- ['0.00100', '0.001'],
2014
- ['1', '1'],
2015
- ['1.0', '1'],
2016
- ['1.00', '1'],
2017
- ['1.10', '1.1'],
2018
- ['1.123000', '1.123'],
2019
- ['10', '10'],
2020
- ['10.0', '10'],
2021
- ['10.00', '10'],
2022
- ['10.10', '10.1'],
2023
- ['10.01', '10.01'],
2024
- ['10.010', '10.01'],
2025
- ['100', '100'],
2026
- ['100.0', '100'],
2027
- ['100.00', '100'],
2028
- ['100.01', '100.01'],
2029
- ['100.10', '100.1'],
2030
- ['100.010', '100.01'],
2031
- ['100.100', '100.1'],
2032
- ];
2033
- }
2034
-
2035
- /**
2036
- * @dataProvider providerAbs
2037
- *
2038
- * @param string $number The number as a string.
2039
- * @param string $unscaledValue The expected unscaled value of the absolute result.
2040
- * @param int $scale The expected scale of the absolute result.
2041
- */
2042
- public function testAbs(string $number, string $unscaledValue, int $scale) : void
2043
- {
2044
- self::assertBigDecimalInternalValues($unscaledValue, $scale, BigDecimal::of($number)->abs());
2045
- }
2046
-
2047
- public function providerAbs() : array
2048
- {
2049
- return [
2050
- ['123', '123', 0],
2051
- ['-123', '123', 0],
2052
- ['123.456', '123456', 3],
2053
- ['-123.456', '123456', 3]
2054
- ];
2055
- }
2056
-
2057
- /**
2058
- * @dataProvider providerNegated
2059
- *
2060
- * @param string $number The number to negate as a string.
2061
- * @param string $unscaledValue The expected unscaled value of the result.
2062
- * @param int $scale The expected scale of the result.
2063
- */
2064
- public function testNegated(string $number, string $unscaledValue, int $scale) : void
2065
- {
2066
- self::assertBigDecimalInternalValues($unscaledValue, $scale, BigDecimal::of($number)->negated());
2067
- }
2068
-
2069
- public function providerNegated() : array
2070
- {
2071
- return [
2072
- ['123', '-123', 0],
2073
- ['-123', '123', 0],
2074
- ['123.456', '-123456', 3],
2075
- ['-123.456', '123456', 3]
2076
- ];
2077
- }
2078
-
2079
- /**
2080
- * @dataProvider providerCompareTo
2081
- *
2082
- * @param string $a The base number as a string.
2083
- * @param string|int|float $b The number to compare to.
2084
- * @param int $c The comparison result.
2085
- */
2086
- public function testCompareTo(string $a, $b, int $c) : void
2087
- {
2088
- self::assertSame($c, BigDecimal::of($a)->compareTo($b));
2089
- }
2090
-
2091
- /**
2092
- * @dataProvider providerCompareTo
2093
- *
2094
- * @param string $a The base number as a string.
2095
- * @param string|int|float $b The number to compare to.
2096
- * @param int $c The comparison result.
2097
- */
2098
- public function testIsEqualTo(string $a, $b, int $c) : void
2099
- {
2100
- self::assertSame($c === 0, BigDecimal::of($a)->isEqualTo($b));
2101
- }
2102
-
2103
- /**
2104
- * @dataProvider providerCompareTo
2105
- *
2106
- * @param string $a The base number as a string.
2107
- * @param string|int|float $b The number to compare to.
2108
- * @param int $c The comparison result.
2109
- */
2110
- public function testIsLessThan(string $a, $b, int $c) : void
2111
- {
2112
- self::assertSame($c < 0, BigDecimal::of($a)->isLessThan($b));
2113
- }
2114
-
2115
- /**
2116
- * @dataProvider providerCompareTo
2117
- *
2118
- * @param string $a The base number as a string.
2119
- * @param string|int|float $b The number to compare to.
2120
- * @param int $c The comparison result.
2121
- */
2122
- public function testIsLessThanOrEqualTo(string $a, $b, int $c) : void
2123
- {
2124
- self::assertSame($c <= 0, BigDecimal::of($a)->isLessThanOrEqualTo($b));
2125
- }
2126
-
2127
- /**
2128
- * @dataProvider providerCompareTo
2129
- *
2130
- * @param string $a The base number as a string.
2131
- * @param string|int|float $b The number to compare to.
2132
- * @param int $c The comparison result.
2133
- */
2134
- public function testIsGreaterThan(string $a, $b, int $c) : void
2135
- {
2136
- self::assertSame($c > 0, BigDecimal::of($a)->isGreaterThan($b));
2137
- }
2138
-
2139
- /**
2140
- * @dataProvider providerCompareTo
2141
- *
2142
- * @param string $a The base number as a string.
2143
- * @param string|int|float $b The number to compare to.
2144
- * @param int $c The comparison result.
2145
- */
2146
- public function testIsGreaterThanOrEqualTo(string $a, $b, int $c) : void
2147
- {
2148
- self::assertSame($c >= 0, BigDecimal::of($a)->isGreaterThanOrEqualTo($b));
2149
- }
2150
-
2151
- public function providerCompareTo() : array
2152
- {
2153
- return [
2154
- ['123', '123', 0],
2155
- ['123', '456', -1],
2156
- ['456', '123', 1],
2157
- ['456', '456', 0],
2158
-
2159
- ['-123', '-123', 0],
2160
- ['-123', '456', -1],
2161
- [ '456', '-123', 1],
2162
- [ '456', '456', 0],
2163
-
2164
- [ '123', '123', 0],
2165
- [ '123', '-456', 1],
2166
- ['-456', '123', -1],
2167
- ['-456', '456', -1],
2168
-
2169
- ['-123', '-123', 0],
2170
- ['-123', '-456', 1],
2171
- ['-456', '-123', -1],
2172
- ['-456', '-456', 0],
2173
-
2174
- ['123.000000000000000000000000000000000000000000000', '123', 0],
2175
- ['123.000000000000000000000000000000000000000000001', '123', 1],
2176
- ['122.999999999999999999999999999999999999999999999', '123', -1],
2177
-
2178
- ['123.0', '123.000000000000000000000000000000000000000000000', 0],
2179
- ['123.0', '123.000000000000000000000000000000000000000000001', -1],
2180
- ['123.0', '122.999999999999999999999999999999999999999999999', 1],
2181
-
2182
- ['-0.000000000000000000000000000000000000000000000000001', '0', -1],
2183
- [ '0.000000000000000000000000000000000000000000000000001', '0', 1],
2184
- [ '0.000000000000000000000000000000000000000000000000000', '0', 0],
2185
-
2186
- ['0', '-0.000000000000000000000000000000000000000000000000001', 1],
2187
- ['0', '0.000000000000000000000000000000000000000000000000001', -1],
2188
- ['0', '0.000000000000000000000000000000000000000000000000000', 0],
2189
-
2190
- ['123.9999999999999999999999999999999999999', 124, -1],
2191
- ['124.0000000000000000000000000000000000000', '124', 0],
2192
- ['124.0000000000000000000000000000000000001', 124.0, 1],
2193
-
2194
- ['123.9999999999999999999999999999999999999', '1508517100733469660019804/12165460489786045645321', -1],
2195
- ['124.0000000000000000000000000000000000000', '1508517100733469660019804/12165460489786045645321', 0],
2196
- ['124.0000000000000000000000000000000000001', '1508517100733469660019804/12165460489786045645321', 1],
2197
- ];
2198
- }
2199
-
2200
- /**
2201
- * @dataProvider providerSign
2202
- *
2203
- * @param number|string $number The number to test.
2204
- * @param int $sign The sign of the number.
2205
- */
2206
- public function testGetSign($number, int $sign) : void
2207
- {
2208
- self::assertSame($sign, BigDecimal::of($number)->getSign());
2209
- }
2210
-
2211
- /**
2212
- * @dataProvider providerSign
2213
- *
2214
- * @param number|string $number The number to test.
2215
- * @param int $sign The sign of the number.
2216
- */
2217
- public function testIsZero($number, int $sign) : void
2218
- {
2219
- self::assertSame($sign === 0, BigDecimal::of($number)->isZero());
2220
- }
2221
-
2222
- /**
2223
- * @dataProvider providerSign
2224
- *
2225
- * @param number|string $number The number to test.
2226
- * @param int $sign The sign of the number.
2227
- */
2228
- public function testIsNegative($number, int $sign) : void
2229
- {
2230
- self::assertSame($sign < 0, BigDecimal::of($number)->isNegative());
2231
- }
2232
-
2233
- /**
2234
- * @dataProvider providerSign
2235
- *
2236
- * @param number|string $number The number to test.
2237
- * @param int $sign The sign of the number.
2238
- */
2239
- public function testIsNegativeOrZero($number, int $sign) : void
2240
- {
2241
- self::assertSame($sign <= 0, BigDecimal::of($number)->isNegativeOrZero());
2242
- }
2243
-
2244
- /**
2245
- * @dataProvider providerSign
2246
- *
2247
- * @param number|string $number The number to test.
2248
- * @param int $sign The sign of the number.
2249
- */
2250
- public function testIsPositive($number, int $sign) : void
2251
- {
2252
- self::assertSame($sign > 0, BigDecimal::of($number)->isPositive());
2253
- }
2254
-
2255
- /**
2256
- * @dataProvider providerSign
2257
- *
2258
- * @param number|string $number The number to test.
2259
- * @param int $sign The sign of the number.
2260
- */
2261
- public function testIsPositiveOrZero($number, int $sign) : void
2262
- {
2263
- self::assertSame($sign >= 0, BigDecimal::of($number)->isPositiveOrZero());
2264
- }
2265
-
2266
- public function providerSign() : array
2267
- {
2268
- return [
2269
- [ 0, 0],
2270
- [-0, 0],
2271
- [ 1, 1],
2272
- [-1, -1],
2273
-
2274
- [PHP_INT_MAX, 1],
2275
- [PHP_INT_MIN, -1],
2276
-
2277
- [ 1.0, 1],
2278
- [-1.0, -1],
2279
- [ 0.1, 1],
2280
- [-0.1, -1],
2281
- [ 0.0, 0],
2282
- [-0.0, 0],
2283
-
2284
- [ '1.00', 1],
2285
- ['-1.00', -1],
2286
- [ '0.10', 1],
2287
- ['-0.10', -1],
2288
- [ '0.01', 1],
2289
- ['-0.01', -1],
2290
- [ '0.00', 0],
2291
- ['-0.00', 0],
2292
-
2293
- [ '0.000000000000000000000000000000000000000000000000000000000000000000000000000001', 1],
2294
- [ '0.000000000000000000000000000000000000000000000000000000000000000000000000000000', 0],
2295
- ['-0.000000000000000000000000000000000000000000000000000000000000000000000000000001', -1]
2296
- ];
2297
- }
2298
-
2299
- /**
2300
- * @dataProvider providerGetIntegralPart
2301
- *
2302
- * @param string $number The number to test.
2303
- * @param string $expected The expected integral value.
2304
- */
2305
- public function testGetIntegralPart(string $number, string $expected) : void
2306
- {
2307
- self::assertSame($expected, BigDecimal::of($number)->getIntegralPart());
2308
- }
2309
-
2310
- public function providerGetIntegralPart() : array
2311
- {
2312
- return [
2313
- ['1.23', '1'],
2314
- ['-1.23', '-1'],
2315
- ['0.123', '0'],
2316
- ['0.001', '0'],
2317
- ['123.0', '123'],
2318
- ['12', '12'],
2319
- ['1234.5678', '1234']
2320
- ];
2321
- }
2322
-
2323
- /**
2324
- * @dataProvider providerGetFractionalPart
2325
- *
2326
- * @param string $number The number to test.
2327
- * @param string $expected The expected fractional value.
2328
- */
2329
- public function testGetFractionalPart(string $number, string $expected) : void
2330
- {
2331
- self::assertSame($expected, BigDecimal::of($number)->getFractionalPart());
2332
- }
2333
-
2334
- public function providerGetFractionalPart() : array
2335
- {
2336
- return [
2337
- ['1.23', '23'],
2338
- ['-1.23', '23'],
2339
- ['1', ''],
2340
- ['-1', ''],
2341
- ['0', ''],
2342
- ['0.001', '001']
2343
- ];
2344
- }
2345
-
2346
- /**
2347
- * @dataProvider providerHasNonZeroFractionalPart
2348
- *
2349
- * @param string $number The number to test.
2350
- * @param bool $hasNonZeroFractionalPart The expected return value.
2351
- */
2352
- public function testHasNonZeroFractionalPart(string $number, bool $hasNonZeroFractionalPart) : void
2353
- {
2354
- self::assertSame($hasNonZeroFractionalPart, BigDecimal::of($number)->hasNonZeroFractionalPart());
2355
- }
2356
-
2357
- public function providerHasNonZeroFractionalPart() : array
2358
- {
2359
- return [
2360
- ['1', false],
2361
- ['1.0', false],
2362
- ['1.01', true],
2363
- ['-123456789', false],
2364
- ['-123456789.0000000000000000000000000000000000000000000000000000000', false],
2365
- ['-123456789.00000000000000000000000000000000000000000000000000000001', true]
2366
- ];
2367
- }
2368
-
2369
- /**
2370
- * @dataProvider providerToBigInteger
2371
- *
2372
- * @param string $decimal The number to convert.
2373
- * @param string $expected The expected value.
2374
- */
2375
- public function testToBigInteger(string $decimal, string $expected) : void
2376
- {
2377
- self::assertBigIntegerEquals($expected, BigDecimal::of($decimal)->toBigInteger());
2378
- }
2379
-
2380
- public function providerToBigInteger() : array
2381
- {
2382
- return [
2383
- ['0', '0'],
2384
- ['1', '1'],
2385
- ['0.0', '0'],
2386
- ['1.0', '1'],
2387
- ['-45646540654984984654165151654557478978940.0000000000000', '-45646540654984984654165151654557478978940'],
2388
- ];
2389
- }
2390
-
2391
- /**
2392
- * @dataProvider providerToBigIntegerThrowsExceptionWhenRoundingNecessary
2393
- *
2394
- * @param string $decimal A decimal number with a non-zero fractional part.
2395
- */
2396
- public function testToBigIntegerThrowsExceptionWhenRoundingNecessary(string $decimal) : void
2397
- {
2398
- $this->expectException(RoundingNecessaryException::class);
2399
- BigDecimal::of($decimal)->toBigInteger();
2400
- }
2401
-
2402
- public function providerToBigIntegerThrowsExceptionWhenRoundingNecessary() : array
2403
- {
2404
- return [
2405
- ['0.1'],
2406
- ['-0.1'],
2407
- ['0.01'],
2408
- ['-0.01'],
2409
- [ '1.002'],
2410
- [ '0.001'],
2411
- ['-1.002'],
2412
- ['-0.001'],
2413
- ['-45646540654984984654165151654557478978940.0000000000001'],
2414
- ];
2415
- }
2416
-
2417
- /**
2418
- * @dataProvider providerToBigRational
2419
- *
2420
- * @param string $decimal The decimal number to test.
2421
- * @param string $rational The expected rational number.
2422
- */
2423
- public function testToBigRational(string $decimal, string $rational) : void
2424
- {
2425
- self::assertBigRationalEquals($rational, BigDecimal::of($decimal)->toBigRational());
2426
- }
2427
-
2428
- public function providerToBigRational() : array
2429
- {
2430
- return [
2431
- ['0', '0'],
2432
- ['1', '1'],
2433
- ['-1', '-1'],
2434
-
2435
- ['0.0', '0/10'],
2436
- ['1.0', '10/10'],
2437
- ['-1.0', '-10/10'],
2438
-
2439
- ['0.00', '0/100'],
2440
- ['1.00', '100/100'],
2441
- ['-1.00', '-100/100'],
2442
-
2443
- ['0.9', '9/10'],
2444
- ['0.90', '90/100'],
2445
- ['0.900', '900/1000'],
2446
-
2447
- ['0.10', '10/100'],
2448
- ['0.11', '11/100'],
2449
- ['0.99', '99/100'],
2450
- ['0.990', '990/1000'],
2451
- ['0.9900', '9900/10000'],
2452
-
2453
- ['1.01', '101/100'],
2454
- ['-1.001', '-1001/1000'],
2455
- ['-1.010', '-1010/1000'],
2456
-
2457
- ['77867087546465423456465427464560454054654.4211684848', '778670875464654234564654274645604540546544211684848/10000000000']
2458
- ];
2459
- }
2460
-
2461
- /**
2462
- * @dataProvider providerToInt
2463
- *
2464
- * @param int $number The decimal number to test.
2465
- */
2466
- public function testToInt(int $number) : void
2467
- {
2468
- self::assertSame($number, BigDecimal::of($number)->toInt());
2469
- self::assertSame($number, BigDecimal::of($number . '.0')->toInt());
2470
- }
2471
-
2472
- public function providerToInt() : array
2473
- {
2474
- return [
2475
- [PHP_INT_MIN],
2476
- [-123456789],
2477
- [-1],
2478
- [0],
2479
- [1],
2480
- [123456789],
2481
- [PHP_INT_MAX]
2482
- ];
2483
- }
2484
-
2485
- /**
2486
- * @dataProvider providerToIntThrowsException
2487
- *
2488
- * @param string $number A valid decimal number that cannot safely be converted to a native integer.
2489
- */
2490
- public function testToIntThrowsException(string $number) : void
2491
- {
2492
- $this->expectException(MathException::class);
2493
- BigDecimal::of($number)->toInt();
2494
- }
2495
-
2496
- public function providerToIntThrowsException() : array
2497
- {
2498
- return [
2499
- ['-999999999999999999999999999999'],
2500
- ['9999999999999999999999999999999'],
2501
- ['1.2'],
2502
- ['-1.2'],
2503
- ];
2504
- }
2505
-
2506
- /**
2507
- * @dataProvider providerToFloat
2508
- *
2509
- * @param string $value The big decimal value.
2510
- * @param float $float The expected float value.
2511
- */
2512
- public function testToFloat(string $value, float $float) : void
2513
- {
2514
- self::assertSame($float, BigDecimal::of($value)->toFloat());
2515
- }
2516
-
2517
- public function providerToFloat() : array
2518
- {
2519
- return [
2520
- ['0', 0.0],
2521
- ['1.6', 1.6],
2522
- ['-1.6', -1.6],
2523
- ['9.999999999999999999999999999999999999999999999999999999999999', 9.999999999999999999999999999999],
2524
- ['-9.999999999999999999999999999999999999999999999999999999999999', -9.999999999999999999999999999999],
2525
- ['9.9e3000', INF],
2526
- ['-9.9e3000', -INF],
2527
- ];
2528
- }
2529
-
2530
- /**
2531
- * @dataProvider providerToString
2532
- *
2533
- * @param string $unscaledValue The unscaled value.
2534
- * @param int $scale The scale.
2535
- * @param string $expected The expected string representation.
2536
- */
2537
- public function testToString(string $unscaledValue, int $scale, string $expected) : void
2538
- {
2539
- self::assertSame($expected, (string) BigDecimal::ofUnscaledValue($unscaledValue, $scale));
2540
- }
2541
-
2542
- public function providerToString() : array
2543
- {
2544
- return [
2545
- ['0', 0, '0'],
2546
- ['0', 1, '0.0'],
2547
- ['1', 1, '0.1'],
2548
- ['0', 2, '0.00'],
2549
- ['1', 2, '0.01'],
2550
- ['10', 2, '0.10'],
2551
- ['11', 2, '0.11'],
2552
- ['11', 3, '0.011'],
2553
- ['1', 0, '1'],
2554
- ['10', 1, '1.0'],
2555
- ['11', 1, '1.1'],
2556
- ['100', 2, '1.00'],
2557
- ['101', 2, '1.01'],
2558
- ['110', 2, '1.10'],
2559
- ['111', 2, '1.11'],
2560
- ['111', 3, '0.111'],
2561
- ['111', 4, '0.0111'],
2562
-
2563
- ['-1', 1, '-0.1'],
2564
- ['-1', 2, '-0.01'],
2565
- ['-10', 2, '-0.10'],
2566
- ['-11', 2, '-0.11'],
2567
- ['-12', 3, '-0.012'],
2568
- ['-12', 4, '-0.0012'],
2569
- ['-1', 0, '-1'],
2570
- ['-10', 1, '-1.0'],
2571
- ['-12', 1, '-1.2'],
2572
- ['-100', 2, '-1.00'],
2573
- ['-101', 2, '-1.01'],
2574
- ['-120', 2, '-1.20'],
2575
- ['-123', 2, '-1.23'],
2576
- ['-123', 3, '-0.123'],
2577
- ['-123', 4, '-0.0123'],
2578
- ];
2579
- }
2580
-
2581
- public function testSerialize() : void
2582
- {
2583
- $value = '-1234567890987654321012345678909876543210123456789';
2584
- $scale = 37;
2585
-
2586
- $number = BigDecimal::ofUnscaledValue($value, $scale);
2587
-
2588
- self::assertBigDecimalInternalValues($value, $scale, \unserialize(\serialize($number)));
2589
- }
2590
-
2591
- public function testDirectCallToUnserialize() : void
2592
- {
2593
- $this->expectException(\LogicException::class);
2594
- BigDecimal::zero()->unserialize('123:0');
2595
- }
2596
- }