Skip to content

Commit

Permalink
PHP 8.4: Document reflection changes (#4037)
Browse files Browse the repository at this point in the history
  • Loading branch information
Girgias authored Nov 12, 2024
1 parent 0d4f735 commit 790f63a
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 2 deletions.
43 changes: 43 additions & 0 deletions reference/reflection/reflectionattribute.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
<varname linkend="reflectionattribute.constants.is-instanceof">ReflectionAttribute::IS_INSTANCEOF</varname>
</fieldsynopsis>

<classsynopsisinfo role="comment">&Properties;</classsynopsisinfo>
<fieldsynopsis>
<modifier>public</modifier>
<type>string</type>
<varname linkend="reflectionattribute.props.name">name</varname>
</fieldsynopsis>

<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.reflectionattribute')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='ReflectionAttribute'])">
<xi:fallback/>
Expand All @@ -51,6 +58,20 @@

</section>

<section xml:id="reflectionattribute.props">
&reftitle.properties;
<variablelist>
<varlistentry xml:id="reflectionattribute.props.name">
<term><varname>name</varname></term>
<listitem>
<simpara>
The name of the attribute.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>

<!-- {{{ ReflectionAttribute constants -->
<section xml:id="reflectionattribute.constants">
&reftitle.constants;
Expand Down Expand Up @@ -80,6 +101,28 @@
</section>
<!-- }}} -->

<section role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.4.0</entry>
<entry>
Added <property>ReflectionAttribute::$name</property>.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>

</partintro>

&reference.reflection.entities.reflectionattribute;
Expand Down
7 changes: 7 additions & 0 deletions reference/reflection/reflectionmethod/construct.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
<modifier>public</modifier> <methodname>ReflectionMethod::__construct</methodname>
<methodparam><type>string</type><parameter>classMethod</parameter></methodparam>
</constructorsynopsis>
<warning>
<simpara>
The alternative signature is deprecated as of PHP 8.4.0,
use <methodname>ReflectionMethod::createFromMethodName</methodname>
instead.
</simpara>
</warning>
<para>
Constructs a new <classname>ReflectionMethod</classname>.
</para>
Expand Down
89 changes: 89 additions & 0 deletions reference/reflection/reflectionproperty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,36 @@
<type>int</type>
<varname linkend="reflectionproperty.constants.is-private">ReflectionProperty::IS_PRIVATE</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>const</modifier>
<type>int</type>
<varname linkend="reflectionproperty.constants.is-abstract">ReflectionProperty::IS_ABSTRACT</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>const</modifier>
<type>int</type>
<varname linkend="reflectionproperty.constants.is-protected-set">ReflectionProperty::IS_PROTECTED_SET</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>const</modifier>
<type>int</type>
<varname linkend="reflectionproperty.constants.is-private-set">ReflectionProperty::IS_PRIVATE_SET</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>const</modifier>
<type>int</type>
<varname linkend="reflectionproperty.constants.is-virtual">ReflectionProperty::IS_VIRTUAL</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>const</modifier>
<type>int</type>
<varname linkend="reflectionproperty.constants.is-final">ReflectionProperty::IS_FINAL</varname>
</fieldsynopsis>

<classsynopsisinfo role="comment">&Properties;</classsynopsisinfo>
<fieldsynopsis>
Expand Down Expand Up @@ -176,6 +206,55 @@
</listitem>
</varlistentry>

<varlistentry xml:id="reflectionproperty.constants.is-abstract">
<term><constant>ReflectionProperty::IS_ABSTRACT</constant></term>
<listitem>
<simpara>
Indicates the property is
<link linkend="language.oop5.abstract">abstract</link>.
Available as of PHP 8.4.0.
</simpara>
</listitem>
</varlistentry>

<varlistentry xml:id="reflectionproperty.constants.is-protected-set">
<term><constant>ReflectionProperty::IS_PROTECTED_SET</constant></term>
<listitem>
<simpara>
Available as of PHP 8.4.0.
</simpara>
</listitem>
</varlistentry>

<varlistentry xml:id="reflectionproperty.constants.is-private-set">
<term><constant>ReflectionProperty::IS_PRIVATE_SET</constant></term>
<listitem>
<simpara>
Available as of PHP 8.4.0.
</simpara>
</listitem>
</varlistentry>

<varlistentry xml:id="reflectionproperty.constants.is-virtual">
<term><constant>ReflectionProperty::IS_VIRTUAL</constant></term>
<listitem>
<simpara>
Available as of PHP 8.4.0.
</simpara>
</listitem>
</varlistentry>

<varlistentry xml:id="reflectionproperty.constants.is-final">
<term><constant>ReflectionProperty::IS_FINAL</constant></term>
<listitem>
<simpara>
Indicates the property is
<link linkend="language.oop5.final">final</link>.
Available as of PHP 8.4.0.
</simpara>
</listitem>
</varlistentry>

</variablelist>
<note>
<para>
Expand All @@ -199,6 +278,16 @@
</row>
</thead>
<tbody>
<row>
<entry>8.4.0</entry>
<entry>
Added <constant>ReflectionProperty::IS_VIRTUAL</constant>,
<constant>ReflectionProperty::IS_PRIVATE_SET</constant>,
<constant>ReflectionProperty::IS_PROTECTED_SET</constant>,
<constant>ReflectionProperty::IS_ABSTRACT</constant>,
and <constant>ReflectionProperty::IS_FINAL</constant>.
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
Expand Down
2 changes: 1 addition & 1 deletion reference/reflection/reflectionproperty/islazy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<methodsynopsis role="ReflectionProperty">
<modifier>public</modifier> <type>bool</type><methodname>ReflectionProperty::isLazy</methodname>
<methodparam><type>object</type><parameter>object</parameter></methodparam>
</methodsynopsis>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<methodsynopsis role="ReflectionProperty">
<modifier>public</modifier> <type>void</type><methodname>ReflectionProperty::setRawValueWithoutLazyInitialization</methodname>
<methodparam><type>object</type><parameter>object</parameter></methodparam>
<methodparam><type class="union"><type>mixed</type><type>null</type></type><parameter>value</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<simpara>
Sets (changes) the property's value without triggering lazy initialization
Expand Down

0 comments on commit 790f63a

Please sign in to comment.