mirror of
https://github.com/php/doc-fr.git
synced 2026-03-24 07:02:06 +01:00
159 lines
3.8 KiB
XML
159 lines
3.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: ec2fe9a592f794978114ef5021db9f1d00c2e05d Maintainer: girgias Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry xml:id="reflectionclass.getreflectionconstants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>ReflectionClass::getReflectionConstants</refname>
|
|
<refpurpose>Récupère les constantes de classe</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="ReflectionClass">
|
|
<modifier>public</modifier> <type>array</type><methodname>ReflectionClass::getReflectionConstants</methodname>
|
|
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>filter</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Récupère les constantes réfléchies.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>filter</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le filtre optionnel, pour filtrer les constantes avec la visibilité désirée. C'est configuré en
|
|
utilisant les
|
|
<link linkend="reflectionclassconstant.constants.modifiers">constantes ReflectionClassConstant</link>,
|
|
et par défaut récupère toutes les constantes peu importe la visibilité.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Un tableau d'objets <classname>ReflectionClassConstant</classname>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
<parameter>filter</parameter> a été ajouté.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example xml:id="reflectionclass.getreflectionconstants.example">
|
|
<title>Exemple basique de <function>ReflectionClass::getReflectionConstants</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
class Foo {
|
|
public const FOO = 1;
|
|
protected const BAR = 2;
|
|
private const BAZ = 3;
|
|
}
|
|
|
|
$foo = new Foo();
|
|
|
|
$reflect = new ReflectionClass($foo);
|
|
$consts = $reflect->getReflectionConstants();
|
|
|
|
foreach ($consts as $const) {
|
|
print $const->getName() . "\n";
|
|
}
|
|
|
|
var_dump($consts);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
FOO
|
|
BAR
|
|
BAZ
|
|
array(3) {
|
|
[0]=>
|
|
object(ReflectionClassConstant)#3 (2) {
|
|
["name"]=>
|
|
string(3) "FOO"
|
|
["class"]=>
|
|
string(3) "Foo"
|
|
}
|
|
[1]=>
|
|
object(ReflectionClassConstant)#4 (2) {
|
|
["name"]=>
|
|
string(3) "BAR"
|
|
["class"]=>
|
|
string(3) "Foo"
|
|
}
|
|
[2]=>
|
|
object(ReflectionClassConstant)#5 (2) {
|
|
["name"]=>
|
|
string(3) "BAZ"
|
|
["class"]=>
|
|
string(3) "Foo"
|
|
}
|
|
}
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><methodname>ReflectionClass::getReflectionConstant</methodname></member>
|
|
<member><classname>ReflectionClassConstant</classname></member>
|
|
</simplelist>
|
|
</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
|
|
-->
|