1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-24 07:42:22 +01:00
Files
2023-08-02 09:10:28 +03:00

200 lines
4.9 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: d52f1e69082873b36f133ecda1ecd2a87a4df4ad Maintainer: aur Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="reflectionclass.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionClass::__construct</refname>
<refpurpose>Создаёт объект класса ReflectionClass</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<constructorsynopsis role="ReflectionClass">
<modifier>public</modifier> <methodname>ReflectionClass::__construct</methodname>
<methodparam><type class="union"><type>object</type><type>string</type></type><parameter>objectOrClass</parameter></methodparam>
</constructorsynopsis>
<para>
Создаёт новый объект класса <classname>ReflectionClass</classname>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>objectOrClass</parameter></term>
<listitem>
<para>
В качестве аргумента может принимать строку (<type>string</type>),
содержащую имя исследуемого класса, либо объект (<type>object</type>).
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Вызывает исключение <classname>ReflectionException</classname>, если заданный класс
не существует.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Простой пример использования ReflectionClass</title>
<programlisting role="php">
<![CDATA[
<?php
$reflection = new ReflectionClass('Exception');
echo $reflection;
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Class [ <internal:Core> class Exception implements Stringable, Throwable ] {
- Constants [0] {
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [7] {
Property [ protected $message = '' ]
Property [ private string $string = '' ]
Property [ protected $code = 0 ]
Property [ protected string $file = '' ]
Property [ protected int $line = 0 ]
Property [ private array $trace = [] ]
Property [ private ?Throwable $previous = NULL ]
}
- Methods [11] {
Method [ <internal:Core> private method __clone ] {
- Parameters [0] {
}
- Return [ void ]
}
Method [ <internal:Core, ctor> public method __construct ] {
- Parameters [3] {
Parameter #0 [ <optional> string $message = "" ]
Parameter #1 [ <optional> int $code = 0 ]
Parameter #2 [ <optional> ?Throwable $previous = null ]
}
}
Method [ <internal:Core> public method __wakeup ] {
- Parameters [0] {
}
- Tentative return [ void ]
}
Method [ <internal:Core, prototype Throwable> final public method getMessage ] {
- Parameters [0] {
}
- Return [ string ]
}
Method [ <internal:Core, prototype Throwable> final public method getCode ] {
- Parameters [0] {
}
}
Method [ <internal:Core, prototype Throwable> final public method getFile ] {
- Parameters [0] {
}
- Return [ string ]
}
Method [ <internal:Core, prototype Throwable> final public method getLine ] {
- Parameters [0] {
}
- Return [ int ]
}
Method [ <internal:Core, prototype Throwable> final public method getTrace ] {
- Parameters [0] {
}
- Return [ array ]
}
Method [ <internal:Core, prototype Throwable> final public method getPrevious ] {
- Parameters [0] {
}
- Return [ ?Throwable ]
}
Method [ <internal:Core, prototype Throwable> final public method getTraceAsString ] {
- Parameters [0] {
}
- Return [ string ]
}
Method [ <internal:Core, prototype Stringable> public method __toString ] {
- Parameters [0] {
}
- Return [ string ]
}
}
}
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>ReflectionObject::__construct</methodname></member>
<member><link linkend="language.oop5.decon.constructor">Конструкторы</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
-->