1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-27 01:02:08 +01:00
Commit Graph

23 Commits

Author SHA1 Message Date
Máté Kocsis
3fc56d76de List inherited constructors on the class synopsis pages (#2090) 2022-12-28 15:51:40 +01:00
Christoph M. Becker
071a588364 Fix xpointer expressions
When removing the `not()` operator, some closing parentheses have been
overlooked, which resulted in broken xpointer expressions.
2022-12-13 12:13:33 +01:00
Máté Kocsis
09c49da6f0 Update Error, Exception, and Throwable role attributes (#2069) 2022-12-11 23:32:45 +01:00
Máté Kocsis
5e2031dc70 Update ext/random role attributes (#2058) 2022-12-11 22:40:19 +01:00
Yoshinari Takaoka
fae2756340 random: capitalize titleabbrev of random extension.
It seems odd to me that ONLY random extension titleabbrev is not capitalized.
2022-11-27 13:20:04 +09:00
Tim Düsterhus
6f6b2bdd24 random: Add description to PcgOneseq128XslRr64::jump() (#2019) 2022-11-23 08:36:39 +01:00
Tim Düsterhus
7453a50321 random: Add description to extension constants (#2018)
* random: Add description to extension constants

* random: Improve explanation for the `MT_RAND_*` constants
2022-11-22 13:10:33 +01:00
Yoshinari Takaoka
d8ac8ea81e deleted duplicate "generate". 2022-11-20 21:13:11 +09:00
Tim Düsterhus
fc1e94a9c2 random: Improve the non-CSPRNG warning (#2009)
* Strengthen the wording in `&caution.cryptographically-insecure;`

It’s not: “should not”, it’s “must not”.

* random: Unify use of `&caution.cryptographically-insecure;`

- The warning goes last.
- It is actually applied to all functions.

* random: Completely rewrite the `&caution.cryptographically-insecure;` warning

* random: Revert indentation changes to lcg-value.xml
2022-11-17 11:53:00 +01:00
Tim Düsterhus
371d97371f random: Describe the Secure engine (#2017) 2022-11-17 11:48:42 +01:00
Tim Düsterhus
cf96daf325 random: Add description to the jumping methods of Xoshiro256StarStar (#1991)
* random: Add description to the jumping methods of Xoshiro256StarStar

* random: Improve explanation of Xoshiro jumping

Co-authored-by: George Peter Banyard <girgias@php.net>

Co-authored-by: George Peter Banyard <girgias@php.net>
2022-11-16 08:38:11 +01:00
Tim Düsterhus
215fd48515 random: Improve short descriptions for methods (#2007)
* random: Unify the short description for random_(bytes|int) with Randomizer

* random: Use imperative mood for short descriptions of engine methods

This is for consistency. The PHP manual appears to use imperative mood for the
majority of functions and all of Randomizer’s functions already too.

* random: Shorten the short description for random_int and Randomizer::getInt()
2022-11-15 17:22:51 +01:00
Tim Düsterhus
501c662caa random: Add description to Randomizer::pickArrayKeys() (#2010) 2022-11-15 12:07:27 +01:00
Tim Düsterhus
52c495140b random: Clean up cross-references for randomness related functions (#2008)
* random: Reference the corresponding Randomizer methods in random_(bytes|int)

* random: Cross-reference the Randomizer in `str_shuffle()`

* random: Cross-reference the Randomizer in `shuffle()`

* random: Cross-reference the Randomizer in `array_rand()`

* random: Cross-reference `random_bytes()` in `uniqid()`

* random: Do not cross-reference `uniqid()` in `openssl_random_pseudo_bytes()`

uniqid() really is no good alternative to *anything*. In the vast majority of
cases it is better replaced by `bin2hex(random_bytes(…))`.

* random: Replace the `mt_rand()` cross-reference in `openssl_random_pseudo_bytes()` with `random_int()`

random_int() is a CSPRNG like openssl_random_pseudo_bytes(), mt_rand() is not.
2022-11-15 11:19:28 +01:00
Tim Düsterhus
e1305cf04f random: Add descriptions to Randomizer::shuffleArray() and Randomizer::shuffleBytes() (#1992)
* random: Add descriptions to Randomizer::shuffleArray() and Randomizer::shuffleBytes()

* random: Move detailed explanation about the input/outputs into the respective sections for Randomizer::shuffle*()
2022-11-13 21:52:09 +01:00
Tim Düsterhus
2ab45105b4 Stop referring to openssl_random_pseudo_bytes() outside of ext/openssl (#1967)
* random: Remove openssl_random_pseudo_bytes() from caution.cryptographically-insecure

The `random_bytes()` and `random_int()` alternatives are available since since
PHP 7.0, are available by default and directly map to the OS' CSPRNG and thus
are likely more secure.

Thus this commit stops mentioning `openssl_random_pseudo_bytes()` as a possible
option any more to keep things simple for the reader.

* random: Remove `openssl_random_pseudo_bytes()` from “See Also” sections for ext/random

The reasoning as with the previous commit applies.

* hash: Replace `openssl_random_pseudo_bytes()` by `random_bytes()`

* session: Replace `openssl_random_pseudo_bytes()` by `random_bytes()`
2022-11-10 14:08:01 +01:00
Tim Düsterhus
c52c4ef2ed Document the Random\Engine (#1969)
* random: Add a description to the Engine interface

* random: Add description to the Random::generate() method

* random: Hard wrap the description for the Engine interface

* random: Hard wrap the Random::generate() error list

* random: Fix phrasing in Engine interface description

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: George Peter Banyard <girgias@php.net>

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: George Peter Banyard <girgias@php.net>
2022-11-10 14:07:44 +01:00
Tim Düsterhus
466f58e332 Extend ext/random documentation (3) (#1951)
* random: Remove redundant “Returns” prefix from return value explanation

* random: Document Engine::generate()'s return value

* random: Document Xoshiro256StarStar::generate()'s return value

* random: Document PcgOneseq128XslRr64::generate()'s return value

* random: Document Mt19937::generate()'s return value

* random: Document Secure::generate()'s return value

* random: Document the Randomizer::$engine property

* random: Clarify the int seeding for PcgOneseq128XslRr64

This change is relevant for negative seed values.

* random: Document Mt19937::__construct()'s parameter value

* random: Add description for CryptoSafeEngine

* random: Add description for RandomError

* random: Add description for RandomException

* random: Improve phrasing for MT_RAND_PHP for Mt19937

Co-authored-by: George Peter Banyard <girgias@php.net>

* random: Explain the `$mode` parameter for Mt19937 construction with a list

Co-authored-by: George Peter Banyard <girgias@php.net>
2022-11-08 17:42:23 +01:00
Tim Düsterhus
a0fb05bc06 random: Fix copy and paste mistake in errors for PcgOneseq128XslRr64::jump()
The `&random.engineErrors;` only make sense for Randomizer methods.
2022-11-05 13:47:37 +01:00
Tim Düsterhus
4bb7c8dab4 Extend ext/random documentation (2) (#1922)
* random: Document Randomizer::shuffleArray()'s parameter and return value

* random: Document Randomizer::shuffleBytes()' parameter and return value

* random: Document Randomizer::pickArrayKeys()' parameter and return value

* random: Unify sentence structure for integer parameter constraints

* random: Document PcgOneseq128XslRr64::jump()'s parameter and return value

* random: Add external reference links for the engines

* random: Document PcgOneseq128XslRr64::__construct()'s parameter value

* random: Document Xoshiro256StarStar::__construct()'s parameter value

* random: Fix casing of "bytes" and "bits"

* fixup! random: Document PcgOneseq128XslRr64::__construct()'s parameter value

* fixup! random: Document PcgOneseq128XslRr64::__construct()'s parameter value

* fixup! random: Document Xoshiro256StarStar::__construct()'s parameter value

* fixup! random: Document PcgOneseq128XslRr64::__construct()'s parameter value

* random: Use entities to link to the engine specifications

see php/doc-base#76

* random: Fix typo in Randomizer::getInt()'s return value description
2022-11-05 10:15:28 +01:00
Máté Kocsis
d6aee4a500 Sync a few manual pages with the stubs (#1936) 2022-11-04 13:30:04 +01:00
Tim Düsterhus
4b1b9be99e Extend ext/random documentation (#1920)
* random: Fix Randomizer::__construct()'s default value

The parameter is nullable and the actual default value should rather be
considered `null`. `null` is then *internally* replaced with a new instance of
`Random\Engine\Secure`.

* random: Document Randomizer::__construct()'s parameters

* random: Document Randomizer::getBytes()' parameter and return value

The phrasing is adapted from and synced with `random_bytes()`.

* random: Fix classname references for CSPRNG failures

* random: Unify phrasing random_int parameter description

* random: Document Randomizer::getInt()'s parameter and return value

The phrasing is adapted from and synced with `random_int()`.

* random: Add random.engineErrors snippets

This explains that the Randomizer's methods will pass through any Throwables
thrown by the engine.

* random: Fix definition of Randomizer::$engine

* random: Improve random_int/getInt parameter descriptions

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

* random: Improve random_int return value description

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

* random: Fix link to Randomizer::$engine property

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

* random: Use `&null;` entity in Randomizer::__construct()

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2022-10-30 14:58:54 +01:00
Tim Düsterhus
2166824858 Bootstrap ext/random docs with docgen
Closes GH-1916.
2022-10-28 15:21:01 +02:00