PluginProbe
WindPress – Tailwind CSS integration for WordPress / 3.2.90
WindPress – Tailwind CSS integration for WordPress v3.2.90
3.2.90 3.2.89 3.2.88 3.2.87 3.2.86 3.2.85 3.2.84 3.2.83 3.2.82 3.2.81 trunk 3.0.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.2 3.0.3 3.0.4 3.0.5 All 144 releases
← All changes | vendor/hidehalo/nanoid-php/src/Client.php +8 -8 3.0.103.2.90 View file →
@@ -30,11 +30,11 @@
30 30 * Constructor of Client
31 31 *
32 32 * @codeCoverageIgnore
33 33 * @param integer $size
34 - * @param GeneratorInterface $generator
34 + * @param GeneratorInterface|null $generator
35 35 */
36 - public function __construct($size = 21, GeneratorInterface $generator = null)
36 + public function __construct($size = 21, ?GeneratorInterface $generator = null)
37 37 {
38 38 $this->size = $size > 0 ? $size : 21;
39 39 $this->generator = $generator ?: new Generator();
40 40 $this->core = new Core();
@@ -61,14 +61,14 @@
61 61 * The original API of nanoid. Use it be careful, Please make sure
62 62 * you have been implements your custom GeneratorInterface as correctly.
63 63 * Otherwise use the build-in default random bytes generator
64 64 *
65 - * @param GeneratorInterface $generator
65 + * @param GeneratorInterface|null $generator
66 66 * @param integer $size
67 67 * @param string $alphabet default CoreInterface::SAFE_SYMBOLS
68 68 * @return string
69 69 */
70 - public function formattedId($alphabet, $size = 0, GeneratorInterface $generator = null)
70 + public function formattedId($alphabet, $size = 0, ?GeneratorInterface $generator = null)
71 71 {
72 72 $alphabet = $alphabet ?: CoreInterface::SAFE_SYMBOLS;
73 73 $size = $size > 0 ? $size : $this->size;
74 74 $generator = $generator ?: $this->generator;
@@ -78,14 +78,14 @@
78 78 * Backwards-compatible method name.
79 79 *
80 80 * @param string $alphabet
81 81 * @param integer $size
82 - * @param GeneratorInterface $generator
82 + * @param GeneratorInterface|null $generator
83 83 *
84 84 * @return string
85 85 * @since 1.0.0
86 86 */
87 - public function formatedId($alphabet, $size = 0, GeneratorInterface $generator = null)
87 + public function formatedId($alphabet, $size = 0, ?GeneratorInterface $generator = null)
88 88 {
89 89 $size = $size > 0 ? $size : $this->size;
90 90 return $this->formattedId($alphabet, $size, $generator);
91 91 }
@@ -101,10 +101,10 @@
101 101 private function normalRandom($size)
102 102 {
103 103 $id = '';
104 104 while (1 <= $size--) {
105 - $rand = \mt_rand() / (\mt_getrandmax() + 1);
106 - $id .= $this->alphabet[\intval($rand * 64)];
105 + $rand = mt_rand() / (mt_getrandmax() + 1);
106 + $id .= $this->alphabet[intval($rand * 64)];
107 107 }
108 108 return $id;
109 109 }
110 110 }