php-doc-en/reference/componere/functions/componere.cast.xml
Joe Watkins e644c4c46e add Componere\cast to documentation
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@344454 c90b9560-bf6c-de11-be94-00142212c4b1
2018-03-06 14:03:49 +00:00

101 lines
2.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="componere.cast" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Componere\cast</refname>
<refpurpose>Casting</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>object</type><methodname>Componere\cast</methodname>
<methodparam><type>string</type><parameter>class</parameter></methodparam>
<methodparam><type>object</type><parameter>instance</parameter></methodparam>
</methodsynopsis>
<para>
Shall cast <parameter>instance</parameter> to <parameter>class</parameter>
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>class</parameter></term>
<listitem>
<para>
A user defined class name
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>instance</parameter></term>
<listitem>
<para>
An object with a user defined type
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
A clone of <parameter>instance</parameter>, of type <parameter>class</parameter>
</para>
</refsect1>
<refsect1 role="exceptions">
<title>Exceptions</title>
<warning>
<para>
Shall throw <type>InvalidArgumentException</type> if <type>instance</type> is not of a user defined standard type
</para>
</warning>
<warning>
<para>
Shall throw <type>InvalidArgumentException</type> if <parameter>class</parameter> is an interface
</para>
</warning>
<warning>
<para>
Shall throw <type>InvalidArgumentException</type> if <parameter>class</parameter> is a trait
</para>
</warning>
<warning>
<para>
Shall throw <type>InvalidArgumentException</type> if <parameter>class</parameter> is an abstract
</para>
</warning>
<warning>
<para>
Shall throw <type>InvalidArgumentException</type> if <parameter>class</parameter> is not compatible with the type of <parameter>instance</parameter>
</para>
</warning>
</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
-->