Fix #79593: Manual page missing for class ReflectionReference

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@349867 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Christoph Michael Becker 2020-05-13 19:41:26 +00:00
parent 103f9d6ca7
commit 3a3b3279ef
5 changed files with 244 additions and 0 deletions

View file

@ -41,6 +41,7 @@
&reference.reflection.reflectionproperty;
&reference.reflection.reflectiontype;
&reference.reflection.reflectiongenerator;
&reference.reflection.reflectionreference;
&reference.reflection.reflector;
&reference.reflection.reflectionexception;

View file

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:classref xml:id="class.reflectionreference" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The ReflectionReference class</title>
<titleabbrev>ReflectionReference</titleabbrev>
<partintro>
<!-- {{{ ReflectionReference intro -->
<section xml:id="reflectionreference.intro">
&reftitle.intro;
<para>
The <classname>ReflectionReference</classname> class provides information about
a reference.
</para>
</section>
<!-- }}} -->
<section xml:id="reflectionreference.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>ReflectionReference</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<modifier>final</modifier> <classname>ReflectionReference</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.reflectionreference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[not(@role='procedural')])">
<xi:fallback />
</xi:include>
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
&reference.reflection.entities.reflectionreference;
</phpdoc:classref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="reflectionreference.fromarrayelement" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionReference::fromArrayElement</refname>
<refpurpose>Create a ReflectionReference from an array element</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <modifier>static</modifier> <type>ReflectionReference</type><methodname>ReflectionReference::fromArrayElement</methodname>
<methodparam><type>array</type><parameter>array</parameter></methodparam>
<methodparam><type>mixed</type><parameter>key</parameter></methodparam>
</methodsynopsis>
<para>
Creates a <classname>ReflectionReference</classname> from an array element.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>array</parameter></term>
<listitem>
<para>
The &array; which contains the potential reference.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
The key; either an &integer; or a &string;.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a <classname>ReflectionReference </classname> instance if
<literal>$array[$key]</literal> is a reference, or &null; otherwise.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
If <parameter>array</parameter> is not an &array;, or <parameter>key</parameter>
is not an &integer; or &string;, a <classname>TypeError</classname> is thrown.
If <literal>$array[$key]</literal> does not exist,
a <classname>ReflectionException</classname> is thrown.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="reflectionreference.getid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionReference::getId</refname>
<refpurpose>Get unique ID of a reference</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>mixed</type><methodname>ReflectionReference::getId</methodname>
<void />
</methodsynopsis>
<para>
Returns an ID which is unique for the reference for the lifetime of that reference.
This ID can be used to compare references for equality, or to maintain a map of
known references.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an &integer; or &string; of unspecified format.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example xml:id="reflectionreference.getid.example.basic">
<title>Basic <methodname>ReflectionReference::getId</methodname> usage</title>
<programlisting role="php">
<![CDATA[
<?php
$val1 = 'foo';
$val2 = 'bar';
$arr = [&$val1, &$val2, &$val1];
$rr1 = ReflectionReference::fromArrayElement($arr, 0);
$rr2 = ReflectionReference::fromArrayElement($arr, 1);
$rr3 = ReflectionReference::fromArrayElement($arr, 2);
var_dump($rr1->getId() === $rr2->getId());
var_dump($rr1->getId() === $rr3->getId());
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
bool(false)
bool(true)
]]>
</screen>
</example>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -331,6 +331,10 @@
<function name="reflectiongenerator::getexecutingline" from="PHP 7"/>
<function name="reflectiongenerator::getexecutingfile" from="PHP 7"/>
<function name="reflectiongenerator::getexecutinggenerator" from="PHP 7"/>
<function name="reflectionreference" from="PHP 7 &gt;= 7.4.0" />
<function name="reflectionreference::fromarrayelement" from="PHP 7 &gt;= 7.4.0" />
<function name="reflectionreference::getid" from="PHP 7 &gt;= 7.4.0" />
</versions>
<!-- Keep this comment at the end of the file
Local variables: