mirror of
https://github.com/php/doc-ru.git
synced 2026-04-26 16:58:14 +02:00
f66b45a8ed
* Update gethook.xml to en * Update gethooks.xml to en * Update getrawvalue.xml to en * Update getsettabletype.xml to en * Update hashook.xml to en * Update hashooks.xml to en * Update isfinal.xml to en * Update isvirtual.xml to en * Update setrawvalue.xml to en
106 lines
3.6 KiB
XML
106 lines
3.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: a16ad380e58039833f84dac4ad95893104868338 Maintainer: malferov Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="reflectionproperty.isfinal" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>ReflectionProperty::isFinal</refname>
|
|
<refpurpose>Определяет, окончательно ли свойство</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis role="ReflectionProperty">
|
|
<modifier>public</modifier> <type>bool</type><methodname>ReflectionProperty::isFinal</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
&warn.undocumented.func;
|
|
<simpara>
|
|
Метод возвращает информацию о том, пометили ли свойство ключевым словом
|
|
<link linkend="language.oop5.final"><literal>final</literal></link>.
|
|
Свойства с закрытой областью видимости для установки — <literal>private(set)</literal>
|
|
неявно становятся окончательными, как будто свойство определили со словом <literal>final</literal>.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
&no.function.parameters;
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<simpara>
|
|
Метод возвращает значение &true;, если свойство явно пометили ключевым словом <literal>final</literal>,
|
|
или если свойство получило неявное определение <literal>final</literal> из-за установки инструкцией <literal>private(set)</literal>
|
|
закрытой области видимости свойства для записи значения.
|
|
В остальных случаях метод возвращает значение &false;.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example xml:id="reflectionproperty.isfinal.example.basic">
|
|
<title>Пример определения окончательности свойства методом <methodname>ReflectionProperty::isFinal</methodname></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
class Example
|
|
{
|
|
public string $name;
|
|
|
|
final protected int $age;
|
|
|
|
public private(set) string $job;
|
|
}
|
|
|
|
$rClass = new \ReflectionClass(Example::class);
|
|
|
|
var_dump($rClass->getProperty('name')->isFinal());
|
|
var_dump($rClass->getProperty('age')->isFinal());
|
|
var_dump($rClass->getProperty('job')->isFinal());
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
bool(false)
|
|
bool(true)
|
|
bool(true)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member>Ключевое слово <link linkend="language.oop5.final"><literal>final</literal></link> и окончательные элементы класса</member>
|
|
<member><link linkend="language.oop5.visibility-members-aviz">Асимметричная видимость свойств</link></member>
|
|
</simplelist>
|
|
</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
|
|
-->
|