mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-26 09:52:17 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@301659 c90b9560-bf6c-de11-be94-00142212c4b1
132 lines
3.3 KiB
XML
132 lines
3.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 8ce9ec16a216fe67070f8b5b636b0d78dfb5a0a8 Maintainer: jpauli Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="reflectionmethod.invoke" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>ReflectionMethod::invoke</refname>
|
|
<refpurpose>Invoque</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>mixed</type><methodname>ReflectionMethod::invoke</methodname>
|
|
<methodparam><type>object</type><parameter>object</parameter></methodparam>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>parameter</parameter></methodparam>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Invoque une méthode reflétée.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>object</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
L'objet sur lequel invoquer la méthode. Dans le cas des méthodes statiques, vous pouvez
|
|
passer <type>null</type> comme paramètre.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>parameter</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Paramètres à passer à la méthode. Une liste variable de paramètres à passer
|
|
est utilisée.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne le résultat de la méthode.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Une <classname>ReflectionException</classname> si <parameter>object</parameter>
|
|
n'est pas une instance de la classe possédant la méthode réfléchie.
|
|
</para>
|
|
<para>
|
|
Une <classname>ReflectionException</classname> si l'invocation de la méthode échoue.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <methodname>ReflectionMethod::invoke</methodname></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
class HelloWorld {
|
|
|
|
public function sayHelloTo($name) {
|
|
return 'Hello ' . $name;
|
|
}
|
|
|
|
}
|
|
|
|
$reflectionMethod = new ReflectionMethod('HelloWorld', 'sayHelloTo');
|
|
echo $reflectionMethod->invoke(new HelloWorld(), 'Mike');
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Hello Mike
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><methodname>ReflectionMethod::invokeArgs</methodname></member>
|
|
<member><link linkend="language.oop5.magic.invoke">__invoke</link></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
|
|
-->
|