There is translations of some methods of ReflectionFunctionAbstract class

-- 
Provided by anonymous 64551 (romahakov@gmail.com)
review rjhdby

git-svn-id: https://svn.php.net/repository/phpdoc/ru/trunk@340080 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Andrey Gromov
2016-09-21 14:59:56 +00:00
parent a8ae8dc29c
commit 651b2cd321
5 changed files with 410 additions and 0 deletions

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 24ec4b99dfa16a9dda8369a379a8734b9648538b Maintainer: rjhdby Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision$ -->
<refentry xml:id="reflectionfunctionabstract.getclosurescopeclass" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionFunctionAbstract::getClosureScopeClass</refname>
<refpurpose>Возвращает класс в рамках которого было объявлено замыкание</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>ReflectionClass</type><methodname>ReflectionFunctionAbstract::getClosureScopeClass</methodname>
<void />
</methodsynopsis>
<para>
</para>
&warn.undocumented.func;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает класс в случае успеха или &null; в случае ошибки.
</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
-->

View File

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: e8d98d6a566aa57ab1926126ee2b2a333ee758e7 Maintainer: rjhdby Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision$ -->
<refentry xml:id="reflectionfunctionabstract.getreturntype" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionFunctionAbstract::getReturnType</refname>
<refpurpose>Получает объявленный тип возвращаемого функцией значения</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>ReflectionType</type><methodname>ReflectionFunctionAbstract::getReturnType</methodname>
<void />
</methodsynopsis>
<para>
Получает объявленный тип возвращаемого функцией значения.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает объект класса <classname>ReflectionType</classname> если у функции объявлен тип возвращаемого значения,
&null; в противном случае.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример <methodname>ReflectionFunctionAbstract::getReturnType</methodname></title>
<programlisting role="php">
<![CDATA[
<?php
function to_int($param) : int {
return (int) $param;
}
$reflection1 = new ReflectionFunction('to_int');
echo $reflection1->getReturnType();
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
int
]]>
</screen>
</example>
<example>
<title>Применение к встроенным функциям</title>
<programlisting role="php">
<![CDATA[
<?php
$reflection2 = new ReflectionFunction('array_merge');
var_dump($reflection2->getReturnType());
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
null
]]>
</screen>
</example>
</para>
<para>
Это происходит из-за того, что многие внутренние функции не имеют объявленных
типов для аргументов или возвращаемого значения. Поэтому лучше избегать
использование данного метода на встроенных функциях.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>ReflectionFunctionAbstract::hasReturnType</methodname></member>
<member><methodname>ReflectionType::__toString</methodname></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
-->

View File

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: e8d98d6a566aa57ab1926126ee2b2a333ee758e7 Maintainer: rjhdby Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision$ -->
<refentry xml:id="reflectionfunctionabstract.hasreturntype" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionFunctionAbstract::hasReturnType</refname>
<refpurpose>Проверяет, иммет ли функция объявленный тип возвращаемого значения</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>bool</type><methodname>ReflectionFunctionAbstract::hasReturnType</methodname>
<void />
</methodsynopsis>
<para>
Проверяет, иммет ли функция объявленный тип возвращаемого значения.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возвращает &true; если функция имеет объявленный тип возвращаемого значения, &false; в противном случае.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример <methodname>ReflectionFunctionAbstract::hasReturnType</methodname></title>
<programlisting role="php">
<![CDATA[
<?php
function to_int($param) : int {
return (int) $param;
}
$reflection1 = new ReflectionFunction('to_int');
var_dump($reflection1->hasReturnType());
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
bool(true)
]]>
</screen>
</example>
<example>
<title>Применение к встроенным функциям</title>
<programlisting role="php">
<![CDATA[
<?php
$reflection2 = new ReflectionFunction('array_merge');
var_dump($reflection2->hasReturnType());
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
bool(false)
]]>
</screen>
</example>
</para>
<para>
Это происходит из-за того, что многие внутренние функции не имеют объявленных
типов для аргументов или возвращаемого значения. Поэтому лучше избегать использование
данного метода на внутренних функциях.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>ReflectionFunctionAbstract::getReturnType</methodname></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
-->

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 24ec4b99dfa16a9dda8369a379a8734b9648538b Maintainer: rjhdby Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision$ -->
<refentry xml:id="reflectionfunctionabstract.isgenerator" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionFunctionAbstract::isGenerator</refname>
<refpurpose>Проверяет, является ли функция генератором</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>bool</type><methodname>ReflectionFunctionAbstract::isGenerator</methodname>
<void />
</methodsynopsis>
<para>
</para>
&warn.undocumented.func;
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возврашает &true;, если функция является генератором, в противном случае &false; или &null;, в случае ошибки.
</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
-->

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: dacbac0ab235af3ea462c87068d8993f1032f367 Maintainer: rjhdby Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision$ -->
<refentry xml:id="reflectionfunctionabstract.isvariadic" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionFunctionAbstract::isVariadic</refname>
<refpurpose>Проверяет, является ли функция функцией с переменным числом аргументов</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>bool</type><methodname>ReflectionFunctionAbstract::isVariadic</methodname>
<void />
</methodsynopsis>
<para>
Проверяет, является ли функция функцией с
<link linkend="functions.variable-arg-list.new">переменным числом аргументов</link>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Возврашает &true;, если функция с переменным числом аргументов, и &false; в противном случае.
</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
-->