[prev in list] [next in list] [prev in thread] [next in thread]
List: php-doc-cvs
Subject: [DOC-CVS] [doc-en] master: Fix markup issues in language section
From: Gina Peter Banyard <noreply () php ! net>
Date: 2024-04-22 12:46:09
Message-ID: 5jrHalRXmoOdUUzSa39rFFv6K8BKdC7MmkpOQjlxk88 () main ! php ! net
[Download RAW message or body]
Author: Gina Peter Banyard (Girgias)
Date: 2024-04-22T13:37:54+01:00
Commit: https://github.com/php/doc-en/commit/f94d903985119d3ac00f4528551df947f57b667f
Raw diff: https://github.com/php/doc-en/commit/f94d903985119d3ac00f4528551df947f57b667f.diff
Fix markup issues in language section
Changed paths:
M language/functions.xml
M language/oop5/basic.xml
M language/oop5/inheritance.xml
M language/oop5/properties.xml
M language/oop5/serialization.xml
M language/predefined/arrayaccess.xml
M language/predefined/attributes/allowdynamicproperties.xml
M language/predefined/attributes/override.xml
M language/predefined/attributes/sensitiveparameter.xml
M language/predefined/iteratoraggregate.xml
M language/predefined/serializable.xml
M language/types/declarations.xml
M language/types/type-juggling.xml
M language/wrappers/audio.xml
M language/wrappers/expect.xml
Diff:
diff --git a/language/functions.xml b/language/functions.xml
index 8b75da6afbf7..b7a78f7b54c8 100644
--- a/language/functions.xml
+++ b/language/functions.xml
@@ -1044,7 +1044,7 @@ $func(); // prints "bar"
In contrast, a <classname>TypeError</classname> is emitted in strict mode.
</para>
- <example>
+ <informalexample>
<programlisting role="php">
<![CDATA[
<?php
@@ -1058,7 +1058,7 @@ var_dump(str_contains("foobar", null));
?>
]]>
</programlisting>
- </example>
+ </informalexample>
</note>
<sect2 role="seealso">
@@ -1691,7 +1691,7 @@ $privateMethod(); // Foo1::privateMethod
<note>
<para>
The first-class callable syntax cannot be combined with the <link \
linkend="language.oop5.basic.nullsafe">nullsafe operator</link>. Both of the \
following result in a compile-time error:
- <example>
+ <informalexample>
<programlisting role="php">
<![CDATA[
<?php
@@ -1700,7 +1700,7 @@ $obj?->prop->method(...);
?>
]]>
</programlisting>
- </example>
+ </informalexample>
</para>
</note>
</sect1>
diff --git a/language/oop5/basic.xml b/language/oop5/basic.xml
index 4ea7a6fc8759..3323eed1bca7 100644
--- a/language/oop5/basic.xml
+++ b/language/oop5/basic.xml
@@ -139,7 +139,7 @@ Stack trace:
<classname>AllowDynamicProperties</classname> attribute. Attempting to do so
will trigger a compile-time error.
</para>
- <example>
+ <informalexample>
<programlisting role="php">
<![CDATA[
<?php
@@ -151,14 +151,14 @@ readonly class Foo {
?>
]]>
</programlisting>
- </example>
+ </informalexample>
<para>
As neither untyped nor static properties can be marked with the
<literal>readonly</literal> modifier, readonly classes cannot declare
them either:
</para>
- <example>
+ <informalexample>
<programlisting role="php">
<![CDATA[
<?php
@@ -183,7 +183,7 @@ readonly class Foo
?>
]]>
</programlisting>
- </example>
+ </informalexample>
<para>
A <modifier>readonly</modifier> class can be
<link linkend="language.oop5.basic.extends">extended</link>
diff --git a/language/oop5/inheritance.xml b/language/oop5/inheritance.xml
index e165815ea228..ff14dbe1d56e 100644
--- a/language/oop5/inheritance.xml
+++ b/language/oop5/inheritance.xml
@@ -48,7 +48,7 @@
<note>
<para>
It is not allowed to override a read-write property with a <link \
linkend="language.oop5.properties.readonly-properties">readonly property</link> or \
vice versa.
- <example>
+ <informalexample>
<programlisting role="php">
<![CDATA[
<?php
@@ -63,14 +63,13 @@ class B extends A {
?>
]]>
</programlisting>
- </example>
+ </informalexample>
</para>
</note>
- <sect2 xml:id="language.oop5.inheritance.examples">
- <example xml:id="language.oop5.inheritance.examples.ex1">
- <title>Inheritance Example</title>
- <programlisting role="php">
+ <example>
+ <title>Inheritance Example</title>
+ <programlisting role="php">
<![CDATA[
<?php
@@ -104,9 +103,8 @@ $bar->printPHP(); // Output: 'PHP is great'
?>
]]>
- </programlisting>
- </example>
- </sect2>
+ </programlisting>
+ </example>
<sect2 xml:id="language.oop5.inheritance.internal-classes">
<title>Return Type Compatibility with Internal Classes</title>
diff --git a/language/oop5/properties.xml b/language/oop5/properties.xml
index 2516f3942e7a..40ce1ea63d8d 100644
--- a/language/oop5/properties.xml
+++ b/language/oop5/properties.xml
@@ -254,7 +254,7 @@ $test1->prop = "foobar";
<note>
<para>
Specifying an explicit default value on readonly properties is not allowed, \
because a readonly property with a default value is essentially the same as a \
constant, and thus not particularly useful.
- <example>
+ <informalexample>
<programlisting role="php">
<![CDATA[
<?php
@@ -266,7 +266,7 @@ class Test {
?>
]]>
</programlisting>
- </example>
+ </informalexample>
</para>
</note>
<note>
@@ -276,7 +276,7 @@ class Test {
</note>
<para>
Modifications are not necessarily plain assignments, all of the following will \
also result in an <classname>Error</classname> exception:
- <example>
+ <informalexample>
<programlisting role="php">
<![CDATA[
<?php
@@ -301,11 +301,11 @@ foreach ($test as &$prop);
?>
]]>
</programlisting>
- </example>
+ </informalexample>
</para>
<para>
However, readonly properties do not preclude interior mutability. Objects (or \
resources) stored in readonly properties may still be modified \
internally:
- <example>
+ <informalexample>
<programlisting role="php">
<![CDATA[
<?php
@@ -322,7 +322,7 @@ $test->obj = new stdClass;
?>
]]>
</programlisting>
- </example>
+ </informalexample>
</para>
</sect2>
diff --git a/language/oop5/serialization.xml b/language/oop5/serialization.xml
index f9910093787d..ae446e508b2e 100644
--- a/language/oop5/serialization.xml
+++ b/language/oop5/serialization.xml
@@ -3,7 +3,7 @@
<!-- TODO Rewrite to remove usage of "you" and talk about __serialize/_unserialize \
--> <sect1 xml:id="language.oop5.serialization" \
xmlns="http://docbook.org/ns/docbook"> <title>Object Serialization</title>
- <title>Serializing objects - objects in sessions</title>
+ <titleabbrev>Serializing objects - objects in sessions</titleabbrev>
<para>
<function>serialize</function> returns a string containing a
diff --git a/language/predefined/arrayaccess.xml \
b/language/predefined/arrayaccess.xml index 3e0bc0bcd189..a8005d243918 100644
--- a/language/predefined/arrayaccess.xml
+++ b/language/predefined/arrayaccess.xml
@@ -35,6 +35,7 @@
</section>
<section xml:id="arrayaccess.examples">
+ &reftitle.examples;
<example xml:id="arrayaccess.example.basic"><!-- {{{ -->
<title>Basic usage</title>
<programlisting role="php">
diff --git a/language/predefined/attributes/allowdynamicproperties.xml \
b/language/predefined/attributes/allowdynamicproperties.xml index \
afc4c14f64af..7bfab015f9bb 100644
--- a/language/predefined/attributes/allowdynamicproperties.xml
+++ b/language/predefined/attributes/allowdynamicproperties.xml
@@ -37,7 +37,7 @@
thus using them without marking the class with this attribute will emit
a deprecation notice.
</para>
- <example>
+ <informalexample>
<programlisting role="php">
<![CDATA[
<?php
@@ -60,7 +60,7 @@ $o2->nonExistingProp = true;
Deprecated: Creation of dynamic property DefaultBehaviour::$nonExistingProp is \
deprecated in file on line 10 ]]>
</screen>
- </example>
+ </informalexample>
</section>
<section xml:id="allowdynamicproperties.seealso">
diff --git a/language/predefined/attributes/override.xml \
b/language/predefined/attributes/override.xml index 511f51a59be8..5ba0817447eb 100644
--- a/language/predefined/attributes/override.xml
+++ b/language/predefined/attributes/override.xml
@@ -30,7 +30,7 @@
<section>
&reftitle.examples;
- <example>
+ <informalexample>
<programlisting role="php">
<![CDATA[
<?php
@@ -53,7 +53,7 @@ final class Extended extends Base {
Fatal error: Extended::boo() has #[\Override] attribute, but no matching parent \
method exists ]]>
</screen>
- </example>
+ </informalexample>
</section>
<section xml:id="override.seealso">
diff --git a/language/predefined/attributes/sensitiveparameter.xml \
b/language/predefined/attributes/sensitiveparameter.xml index \
7180b838a396..bd33e1b05a60 100644
--- a/language/predefined/attributes/sensitiveparameter.xml
+++ b/language/predefined/attributes/sensitiveparameter.xml
@@ -33,7 +33,7 @@
<section>
&reftitle.examples;
- <example>
+ <informalexample>
<programlisting role="php">
<![CDATA[
<?php
@@ -82,7 +82,7 @@ Stack trace:
#1 {main}
]]>
</screen>
- </example>
+ </informalexample>
</section>
<section xml:id="sensitiveparameter.seealso">
diff --git a/language/predefined/iteratoraggregate.xml \
b/language/predefined/iteratoraggregate.xml index 1aca52afc4db..c9c416df0fa0 100644
--- a/language/predefined/iteratoraggregate.xml
+++ b/language/predefined/iteratoraggregate.xml
@@ -40,6 +40,7 @@
</section>
<section xml:id="iteratoraggregate.examples">
+ &reftitle.examples;
<example xml:id="iteratoraggregate.example.basic"><!-- {{{ -->
<title>Basic usage</title>
<programlisting role="php">
diff --git a/language/predefined/serializable.xml \
b/language/predefined/serializable.xml index 24610bd7adde..bd5dca12e896 100644
--- a/language/predefined/serializable.xml
+++ b/language/predefined/serializable.xml
@@ -52,6 +52,7 @@
</section>
<section xml:id="serializable.examples">
+ &reftitle.examples;
<example xml:id="serializable.example.basic"><!-- {{{ -->
<title>Basic usage</title>
<programlisting role="php">
diff --git a/language/types/declarations.xml b/language/types/declarations.xml
index 609a2f58269e..2d6afe532c88 100644
--- a/language/types/declarations.xml
+++ b/language/types/declarations.xml
@@ -152,7 +152,7 @@
will require the value to be an &instanceof; the class or interface
<literal>boolean</literal>, rather than of type <type>bool</type>:
</para>
- <example>
+ <informalexample>
<programlisting role="php">
<![CDATA[
<?php
@@ -173,7 +173,7 @@ Stack trace:
thrown in - on line 2
]]>
</screen>
- </example>
+ </informalexample>
</warning>
</sect3>
diff --git a/language/types/type-juggling.xml b/language/types/type-juggling.xml
index 464fd92a4fbd..df10696d4e46 100644
--- a/language/types/type-juggling.xml
+++ b/language/types/type-juggling.xml
@@ -422,9 +422,7 @@ if ($fst === $str) {
<member><link linkend="types.comparisons">The type comparison \
tables</link></member> </simplelist>
</para>
- </sect2>
- <simplesect>
<note>
<simpara>
Because PHP supports indexing into <type>string</type>s via offsets
@@ -449,7 +447,7 @@ echo $a; // bar
access by character</link> for more information.
</simpara>
</note>
- </simplesect>
+ </sect2>
</sect1>
<!-- Keep this comment at the end of the file
diff --git a/language/wrappers/audio.xml b/language/wrappers/audio.xml
index 1fad3da5957d..77dbaab548b1 100644
--- a/language/wrappers/audio.xml
+++ b/language/wrappers/audio.xml
@@ -168,10 +168,6 @@
</para>
</refsect1> <!-- }}} -->
- <refsect1 role="examples"><!-- {{{ -->
- &reftitle.examples;
- </refsect1><!-- }}} -->
-
</refentry>
<!-- Keep this comment at the end of the file
diff --git a/language/wrappers/expect.xml b/language/wrappers/expect.xml
index e2a466914e75..f8992350d71c 100644
--- a/language/wrappers/expect.xml
+++ b/language/wrappers/expect.xml
@@ -91,10 +91,6 @@
</para>
</refsect1> <!-- }}} -->
- <refsect1 role="examples"><!-- {{{ -->
- &reftitle.examples;
- </refsect1><!-- }}} -->
-
</refentry>
<!-- Keep this comment at the end of the file
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic