1
0
mirror of https://github.com/php/doc-en.git synced 2026-04-30 02:33:15 +02:00
Commit Graph

2532 Commits

Author SHA1 Message Date
Tim Düsterhus 6e69d9342e Use FQCN for native attributes (#2137)
* Use FQCN for native attributes

For attributes, it's non-obvious that they need to be imported with `use` or
referenced with their FQCN, because applying a non-existent attribute is not an
error.

Make the examples copy-and-paste safe by adding the leading backslash, as
already done for `#[\SensitiveParameterValue]`.
2023-01-04 16:20:00 +00:00
Máté Kocsis 681fd84dbd Add documentation for missing attribute constructors (#2126)
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2023-01-02 21:33:51 +01:00
Máté Kocsis 1acd98a6cd Remove unnecessary documentation of non-existent constructors (#2122)
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2022-12-28 16:34:44 +01:00
Máté Kocsis 3fc56d76de List inherited constructors on the class synopsis pages (#2090) 2022-12-28 15:51:40 +01:00
Christoph M. Becker 5d775e7df5 Fix GH-2115: Typo in unpacking 2022-12-26 15:07:02 +01:00
Juliette b59634b465 OOP5/Traits/Constants: fix example code
The example code contained three errors:
* Reference to non-existent `ConstantTrait` trait (x2).
* Instantiation of non-existent `ConstantExample` class.
* Reference to an undefined constant.

Fixed now.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>

Closes GH-2118.
2022-12-25 11:59:07 +01:00
George Peter Banyard b035daa699 Nits to the type juggling page (#2098)
The big one is the need to clarify the behaviour around the coercive typing mode, as the conversion of objects to strings is relatively straight forward but in theory internal objects that overload the cast handler can convert to other types too.

Drive-by typo fix

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2022-12-21 20:16:19 +00:00
Christoph M. Becker 99ef98227f Fix GH-2082: Incorrect output for example
We fix the wording in the explanation, too.
2022-12-16 12:43:12 +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 8fee3ae971 Update Fiber and Generator role attributes (#2068) 2022-12-11 23:25:52 +01:00
Máté Kocsis 460f49a93d Update iterator and Serializable role attributes (#2070) 2022-12-11 23:25:04 +01:00
Máté Kocsis d27fdfe8f9 Update WeakMap and WeakReference role attributes (#2065) 2022-12-11 23:24:10 +01:00
Máté Kocsis ed312486ff Update ArrayAccess role attributes (#2066) 2022-12-11 23:23:10 +01:00
Máté Kocsis 9c74079f12 Update enum and Closure role attributes (#2067) 2022-12-11 23:22:44 +01:00
Dan Mooney ba65e0f4f7 Fix spelling (non existant → non-existent)
Closes GH-2048.
2022-12-08 19:42:06 +01:00
Yoshinari Takaoka 445502dead re-commited fix programlisting role in coercing type of union example.
because github actions workflow is now fixed.

https://github.com/php/doc-en/commit/e05f5718fd09ad6e99b39300761e25698294c0ab
2022-12-03 12:28:47 +09:00
Yoshinari Takaoka 854be2fbf0 reverted previous commit because build failed. 2022-12-02 23:10:33 +09:00
Yoshinari Takaoka e05f5718fd reverted programlisting role in coercing type of union example.
refs: https://github.com/php/doc-en/blob/b6f7d2d0762b52fe81ab510df30e2901fa2ff8ce/language/types/declarations.xml#L818-L842
2022-12-02 22:55:36 +09:00
Christoph M. Becker 23cda46097 Fix typo 2022-11-30 19:49:57 +01:00
George Peter Banyard 161dde4fe7 Rewrite type section (#1726)
This commit rewrites the whole type section to (hopefully) be better structured and future proof for further additions to the type system.

* Each type now gets their individual page instead of being shoved in the type declaration page.

* A type system page is added which describes PHP's type system, regardless if it is possible to declare the type in userland or not. Therefore, the type declaration page only has information related to writing type declarations in userland.

* The description of strict_type and the type coercion is moved into the type juggling page.

* Remove outdated information in string implementation section

* Add paragraph about using non string in string context can throw

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2022-11-30 15:39:41 +00:00
George Peter Banyard b6f7d2d076 Update trait docs for PHP-8.2 (#1995)
The docs for traits probably need a good overhaul, but this documents the new constant in traits feature.
2022-11-30 15:15:06 +00:00
Laurent VOULLEMIER e5bdb2471a Clarify using same method name in many interfaces
Closes GH-2003.
2022-11-30 14:56:35 +01:00
Theodore Brown 7ee696aa81 Fix inconsistent formatting for anonymous function
Closes GH-2030.
2022-11-28 11:38:16 +01:00
Yoshinari Takaoka c993be5c5d added SensitiveParameter usage example. (#2005)
based on RFC: https://wiki.php.net/rfc/redact_parameters_in_back_traces

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
2022-11-14 23:54:47 +09:00
George Peter Banyard 59578bb384 Add predefined attribute section and classes (#1990)
This provides basic documentation for all the predefined internal attribute classes.
2022-11-13 13:35:35 +00:00
George Peter Banyard 512670405c Document readonly classes (#1996)
Co-authored-by: Yoshinari Takaoka <mumumu@mumumu.org>
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2022-11-12 12:58:50 +00:00
George Peter Banyard 491a7cc9cd Change simplesect to sect1 in exception chapter (#1988)
This will fix the fact that the examples start their number at 3.
The reason for that is the numbering starts within the previous ``<sect1>`` but this is not rendered on the page, but in a follow-up page.
However, we cannot put this sections after the ``<simplesect>`` as that doesn't respect the DTD: https://tdg.docbook.org/tdg/5.0/chapter.html

Converting them to <sect1>, however, makes them render into different pages.
Therefore, we use our custom PhD DTD: ``xmlns:phd="http://www.php.net/ns/phd"`` and use the ``<sect1 phd:chunk="false">`` tag which will keep the current behaviour of not splitting the pages.
2022-11-11 15:49:51 +00:00
George Peter Banyard 6e042e0ae6 Document dynamic properties (#1942)
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2022-11-07 00:54:15 +00:00
George Peter Banyard b767006c86 Rewrite $_SERVER docs (#1941)
Drop personalisation
Drop mention of specific HTTP headers and use a general statement instead
Various mark-up nits

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2022-11-04 14:24:49 +00:00
Máté Kocsis d6aee4a500 Sync a few manual pages with the stubs (#1936) 2022-11-04 13:30:04 +01:00
蝦米 bcffb58bc0 Bold the bool value in enum section 2022-10-21 04:15:44 +08:00
Yoshinari Takaoka 4c4b829653 changed stdClass markup. 2022-10-10 00:34:49 +09:00
Kevin Cupp ce3a2d3816 Document unserialize max_depth option
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-1866.
2022-10-05 16:52:46 +02:00
Kamil Tekiela 360928c5ef Document stdClass (#1862) 2022-10-04 18:22:56 +01:00
George Peter Banyard 19e8122137 Remove references to "double" and use float instead (#1848) 2022-09-27 12:38:35 +01:00
魔王卷子 f32703dce3 Fix markup
Closes GH-1829.
2022-09-16 11:30:33 +02:00
Peter Cowburn d36cc30c3d minor changes for internaliterator
* add final modifier
* add xi:include for constructor
* fix interface markup
2022-09-15 22:22:29 +01:00
Peter Cowburn 44e26fbe36 typofix: interal -> internal 2022-09-15 22:15:26 +01:00
Christoph M. Becker 2c974ae7c4 Fix GH-896: InternalIterator is not documented
Closes GH-899.
2022-09-15 15:27:35 +02:00
Pierrick Charron 6b56d33993 Describe PHP8 behavior as default in array doc 2022-09-09 17:10:04 -04:00
Houssem Zitoun 0a89f2d439 magic methods: improve __invoke documentation
Closes GH-1776.
2022-09-05 16:09:26 +02:00
Larry Garfield 38abe7c16e Standardize casing for Enum examples
Closes GH-1785.
2022-08-31 18:01:02 +02:00
Larry Garfield 2ab7e9d763 Note the recursion checking for magic methods
Closes GH-1769.
2022-08-26 18:27:46 +02:00
Jeremy Mikola 362f36f682 Remove backslash prefix for some ReturnTypeWillChange attributes (#1756)
These backslashes were previously added in 214335df7e and cfaa7659da.

Backslashes before ReturnTypeWillChange in deprecation messages were left as-is, since those are quoting actual output from PHP. See 081cf71ecb for those messages.
2022-08-18 13:46:21 -04:00
Kamil Tekiela fb6ffde972 Add docs about array destructuring (#796) 2022-08-18 12:21:58 +01:00
Juliette 1431d18dc4 Namespaces/importing: update the list of structures which can be imported
... for completeness.

Page link: https://www.php.net/manual/en/language.namespaces.importing.php

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>

Closes GH-1748.
2022-08-15 16:19:52 +02:00
Peter Cowburn 9ef86d18a9 tpyofix 2022-08-05 18:57:40 +01:00
Caen De Silva b635b435e1 Fix minor typo (object should be singular)
In the current manual, the following is seen: "...if a very large objects...", where it should use the singular form. This PR fixes that so it becomes "...if a very large object...".

Closes GH-1736.
2022-08-05 15:28:11 +02:00
Tiffany 698f30ceeb Grammar fix
Removed the word "a" that signifies a singular word after, yet a plural word occurs
2022-08-01 22:05:41 -05:00