AddressExtension.php
1 year ago
BarcodeExtension.php
1 year ago
BloodExtension.php
1 year ago
ColorExtension.php
1 year ago
CompanyExtension.php
1 year ago
CountryExtension.php
1 year ago
DateTimeExtension.php
1 year ago
Extension.php
1 year ago
ExtensionNotFound.php
1 year ago
FileExtension.php
1 year ago
GeneratorAwareExtension.php
1 year ago
GeneratorAwareExtensionTrait.php
1 year ago
Helper.php
1 year ago
NumberExtension.php
1 year ago
PersonExtension.php
1 year ago
PhoneNumberExtension.php
1 year ago
UuidExtension.php
1 year ago
VersionExtension.php
1 year ago
NumberExtension.php
60 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @license MIT |
| 4 | * |
| 5 | * Modified by impress-org on 07-August-2024 using Strauss. |
| 6 | * @see https://github.com/BrianHenryIE/strauss |
| 7 | */ |
| 8 | |
| 9 | namespace Give\Vendors\Faker\Extension; |
| 10 | |
| 11 | /** |
| 12 | * @experimental This interface is experimental and does not fall under our BC promise |
| 13 | */ |
| 14 | interface NumberExtension extends Extension |
| 15 | { |
| 16 | /** |
| 17 | * Returns a random number between $int1 and $int2 (any order) |
| 18 | * |
| 19 | * @param int $min default to 0 |
| 20 | * @param int $max defaults to 32 bit max integer, ie 2147483647 |
| 21 | * |
| 22 | * @example 79907610 |
| 23 | */ |
| 24 | public function numberBetween(int $min, int $max): int; |
| 25 | |
| 26 | /** |
| 27 | * Returns a random number between 0 and 9 |
| 28 | */ |
| 29 | public function randomDigit(): int; |
| 30 | |
| 31 | /** |
| 32 | * Generates a random digit, which cannot be $except |
| 33 | */ |
| 34 | public function randomDigitNot(int $except): int; |
| 35 | |
| 36 | /** |
| 37 | * Returns a random number between 1 and 9 |
| 38 | */ |
| 39 | public function randomDigitNotZero(): int; |
| 40 | |
| 41 | /** |
| 42 | * Return a random float number |
| 43 | * |
| 44 | * @example 48.8932 |
| 45 | */ |
| 46 | public function randomFloat(?int $nbMaxDecimals, float $min, ?float $max): float; |
| 47 | |
| 48 | /** |
| 49 | * Returns a random integer with 0 to $nbDigits digits. |
| 50 | * |
| 51 | * The maximum value returned is mt_getrandmax() |
| 52 | * |
| 53 | * @param int|null $nbDigits Defaults to a random number between 1 and 9 |
| 54 | * @param bool $strict Whether the returned number should have exactly $nbDigits |
| 55 | * |
| 56 | * @example 79907610 |
| 57 | */ |
| 58 | public function randomNumber(?int $nbDigits, bool $strict): int; |
| 59 | } |
| 60 |