Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Faker\Extension;
4
 
5
/**
6
 * @experimental This interface is experimental and does not fall under our BC promise
7
 */
8
interface NumberExtension extends Extension
9
{
10
    /**
11
     * Returns a random number between $int1 and $int2 (any order)
12
     *
13
     * @param int $min default to 0
14
     * @param int $max defaults to 32 bit max integer, ie 2147483647
15
     *
16
     * @example 79907610
17
     */
18
    public function numberBetween(int $min, int $max): int;
19
 
20
    /**
21
     * Returns a random number between 0 and 9
22
     */
23
    public function randomDigit(): int;
24
 
25
    /**
26
     * Generates a random digit, which cannot be $except
27
     */
28
    public function randomDigitNot(int $except): int;
29
 
30
    /**
31
     * Returns a random number between 1 and 9
32
     */
33
    public function randomDigitNotZero(): int;
34
 
35
    /**
36
     * Return a random float number
37
     *
38
     * @example 48.8932
39
     */
40
    public function randomFloat(?int $nbMaxDecimals, float $min, ?float $max): float;
41
 
42
    /**
43
     * Returns a random integer with 0 to $nbDigits digits.
44
     *
45
     * The maximum value returned is mt_getrandmax()
46
     *
47
     * @param int|null $nbDigits Defaults to a random number between 1 and 9
48
     * @param bool     $strict   Whether the returned number should have exactly $nbDigits
49
     *
50
     * @example 79907610
51
     */
52
    public function randomNumber(?int $nbDigits, bool $strict): int;
53
}