73 Commits

Author SHA1 Message Date
haszi
48ce43fe79 Remove empty resources pages (#3545)
Co-authored-by: haszi <haszika80@gmail.com>
2024-07-26 02:17:29 +01:00
haszi
765b2d6eec Remove empty configuration pages (#3538)
Co-authored-by: haszi <haszika80@gmail.com>
2024-07-09 22:24:55 +01:00
haszi
605553e228 Remove empty requirements pages (#3464)
Co-authored-by: haszi <haszika80@gmail.com>
2024-07-07 14:34:34 +01:00
haszi
57d1b0df36 Remove empty installation pages (#3462)
Co-authored-by: haszi <haszika80@gmail.com>
2024-06-21 02:38:44 +01:00
Gina Peter Banyard
4d17b7b494 [skip-revcheck] Convert class markup to be compatible with DocBook 5.2
Closes GH-3415
2024-06-14 17:04:53 +01:00
vlakoff
05579435b4 [skip-recheck] Fix typo in description of Random\Randomizer::nextFloat() (#3161) 2024-02-02 08:45:55 +01:00
Sergey Panteleev
9eb92e5c18 [PHP 8.3] Update mt-srand and srand functions (#3095)
Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
2024-01-11 08:18:27 +03:00
Yoshinari Takaoka
7a7f52a7c3 fixed output of Random\Randomizer::nextFloat example. 2023-12-04 02:07:26 +09:00
Yoshinari Takaoka
07b8fdd1f2 deleted needless dollar sign. 2023-11-25 16:48:14 +09:00
Tim Düsterhus
0ec8e36e0f Interlink Randomizer::getFloat() and Randomizer::getInt() (#2880) 2023-10-21 12:30:48 +01:00
Tim Düsterhus
9b01d72951 Randomizer::nextFloat(): Expand the documentation (#2879) 2023-10-21 12:30:21 +01:00
Tim Düsterhus
21e24bf8de Randomizer::nextFloat(): Improve caution note (#2878) 2023-10-20 18:09:16 +01:00
Tim Düsterhus
be4c3688d5 [skip-revcheck] Randomizer::getFloat(): Reflow 2023-10-20 18:45:08 +02:00
Tim Düsterhus
a262f32667 Randomizer::getFloat(): Add step-by-step explanation of γ-section (#2870)
Co-authored-by: Larry Garfield <larry@garfieldtech.com>
2023-10-20 17:32:53 +01:00
Tim Düsterhus
9ace2f096f Randomizer::getFloat(): Fix example output
The `printf()` format intended to always add the sign.
2023-10-18 16:32:08 +02:00
Tim Düsterhus
7d9e18e0ad Randomizer::getFloat(): Add documentation (#2856)
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
Co-authored-by: Larry Garfield <larry@garfieldtech.com>
2023-10-16 19:27:19 +02:00
Tim Düsterhus
6b62527df5 Randomizer::getBytesFromString(): Showcase a non-uniform input string (#2855) 2023-10-14 19:25:57 +02:00
Tim Düsterhus
ece499cdc1 [skip-revcheck] Fix typo in random_int() 2023-10-05 20:38:59 +02:00
Tim Düsterhus
c174b16add mt_getrandmax: Remove example (#2835)
This affine transformation results in a bias and `Randomizer::getFloat()` must
be used.
2023-10-04 13:57:41 +01:00
Tim Düsterhus
c72d86b5e1 Randomizer::getFloat(): Expand documentation (#2833)
Co-authored-by: George Peter Banyard <girgias@php.net>
2023-10-03 19:52:07 +02:00
Tim Düsterhus
67f4068107 lcg_value: Include the caution from Randomizer::nextFloat() (#2834)
see php/doc-en#2825
2023-10-03 18:51:28 +01:00
Tim Düsterhus
c4f24e2eef MT_RAND_PHP: Indicate deprecation (#2829) 2023-10-03 14:59:33 +02:00
Tim Düsterhus
0b6c76516a mt_rand: Remove rand() from the see also section (#2827)
Nowadays it's the same function and in older version it's the worse
alternative.
2023-10-03 13:55:38 +01:00
Tim Düsterhus
5f9d1aecdf Randomizer::nextFloat(): Add caution note (#2825) 2023-10-03 13:55:14 +01:00
Tim Düsterhus
f08b9a8aee Randomizer::getBytesFromString(): Write documentation (#2824) 2023-10-03 13:53:39 +01:00
Tim Düsterhus
b2c7c9910e random: Update “See Also” list for lcg_value() (#2820) 2023-10-03 13:48:58 +01:00
Tim Düsterhus
f4fddd46d8 random: Add initial contents for the PHP 8.3 methods (#2818)
Co-authored-by: George Peter Banyard <girgias@php.net>
2023-10-01 16:31:06 +02:00
George Peter Banyard
b869c16087 random: Add stubs generated from php-src stubs (#2815) 2023-10-01 16:04:08 +02:00
Máté Kocsis
3b67c8e90c Synchronize predefined constants with stubs - part 2) (#2741)
Fix wrong formatting of constant types
2023-09-05 11:14:58 +01:00
Máté Kocsis
14767af0f0 Use new class synopsis markup (#2611)
Follow-up on https://github.com/php/phd/pull/77
2023-08-30 12:28:30 +01:00
Máté Kocsis
9eb4a46bba Use new class synopsis markup for interfaces (#2620) 2023-07-29 05:55:01 +01:00
KapitanOczywisty
788ec8e5e7 random: Randomizer::nextInt return value and 32-bit note (#2562)
* Randomizer::nextInt will throw on 32-bit with 64-bit engines

* Document Randomizer::nextInt return value

* Wording

* Apply suggestions from code review

---------

Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
2023-07-19 18:57:33 +02:00
Máté Kocsis
96a8379cd8 Render interfaces according to the new PhD format (#2556)
According to https://github.com/php/phd/pull/75
2023-07-04 20:35:33 +01:00
Tim Düsterhus
553952f03f Improve descriptions for random_*() functions (#2528)
* random: Improve description for random_bytes() / getBytes()

* random: Improve description for random_int()

* random: Reference both bin2hex and base64_encode for random_bytes() / getBytes()
2023-06-16 03:27:25 +01:00
Tim Düsterhus
6756cbedb9 random: Fix duplicate empty line in Xoshiro256StarStar::jump() example
see 8260735225
2023-02-24 16:54:15 +01:00
Tim Düsterhus
8260735225 random: Unify code style in examples (#2318)
The spaces within a function call have been introduced in
ad458c5f01 and I have been trying to emulate
them, but failed due to muscle memory, resulting in very inconsistently
formatted examples.

Adjust the code examples purely stylistically, without changing their output:

- Remove the extra spaces within the function calls to match the commonly
  accepted code style (e.g. PSR-12).
- Use `implode()` instead of the `join()` alias.
- Use comma instead of string concatenation when echo-ing.
- Consistently use "\n" to emit newlines, not `PHP_EOL`.
- Unify to double quotes.
2023-02-24 16:34:38 +01:00
Tim Düsterhus
cb010c77b6 random: Fix incorrect example output in Randomizer::shuffleBytes() 2023-02-21 17:47:58 +01:00
Tim Düsterhus
81af2a8f5d random: Add warning about Mt19937’s tiny seed (#2305) 2023-02-21 11:34:09 +01:00
Tim Düsterhus
823cfabfbd random: Remove examples for mt_srand() and srand() (#2304)
These examples teach the readers bad practices, because they indicate that
seeding from the current time is reasonable (it is not). Users should ideally
use the `random_int()` function. If that is not possible, the
`Random\Randomizer` is the next best choice. If that's not an option either,
then relying on the random seed of the global Mt19937 is better than any manual
seeding that relies on the current time.
2023-02-21 11:33:49 +01:00
Tim Düsterhus
38785e9877 random: Showcase that Randomizer::shuffleBytes() breaks Unicode characters (#2179) 2023-02-20 17:50:38 +01:00
Tim Düsterhus
ba1733f099 random: Add example for PcgOneseq128XslRr64::jump() (#2260) 2023-02-02 08:40:26 +01:00
Tim Düsterhus
7948e7406a random: Showcase turning picked array keys into values (#2261)
see php/php-src#10412
2023-01-30 20:25:19 +01:00
Tim Düsterhus
4c873e06af random: Reorder engines documentation (#2250)
This patch reorders the engines in the overview to list the “Secure” engine
first, as that is the preferred engine for the majority of use cases. As a side
effect the CryptoSafeEngine interface is documented right after the Engine
interface.

The other engines remain sorted alphabetically.
2023-01-25 00:34:47 +01:00
Tim Düsterhus
02580ba1bb random: Drop example section from the generate() method of the Engines (#2249)
This method is not meant to be used directly and showcasing some random bytes
of fixed length does not provide a value-add for the reader.
2023-01-24 20:12:50 +01:00
Tim Düsterhus
f5b15841e6 random: Add examples to xoshiro256**’s jump methods (#2236)
* random: Add example for Xoshiro256StarStar::jump()

* random: Fix description of Xoshiro256StarStar::jumpLong()

* random: Add example to Xoshiro256StarStar::jumpLong()

* random: Use static closure in Xoshiro256StarStar::jump() example

Co-authored-by: Go Kudo <zeriyoshi@gmail.com>
2023-01-24 12:10:30 +01:00
Tim Düsterhus
970d08a3b3 random: Drop the range constraints from getInt()/random_int() (#2216)
It’s impossible to pass an integer that does not fall into the documented
range, making this useless information. Integers outside these ranges will be
converted into floats, making those a TypeError.
2023-01-18 10:47:15 +01:00
Tim Düsterhus
96368da0b0 random: Add examples for the engine constructors (#2197) 2023-01-17 11:03:14 +01:00
Tim Düsterhus
43756e54fb random: Add LCG engine demonstrating the Random\Engine interface (#2180) 2023-01-16 11:25:06 +01:00
Tim Düsterhus
cf3c65dc53 Improve random fruit examples (#2176)
* random: Expand random fruit examples

Picking two of three elements and receiving the first two fails to properly
showcase randomness.

* random: Run fruit examples twice

This showcases that the result is actually different when trying again.

* random: Strip duplicated space in examples
2023-01-13 11:23:38 +01:00
Derick Rethans
ad458c5f01 Added examples for Random extension 2023-01-11 11:28:54 +00:00