1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-23 23:32:18 +01:00
Files
Mikhail Alferov 79c0572a57 ReflectionProperty Fix typo, CS nits (#4481)
* getrawvalue.xml Fix typo, and add a newlines for more readable output

* getsettabletype.xml Cs nits

* hashook.xml Remove the extra dot
2025-02-22 19:29:43 +00:00

98 lines
2.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="reflectionproperty.hashook" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionProperty::hasHook</refname>
<refpurpose>Returns whether the property has a given hook defined</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="ReflectionProperty">
<modifier>public</modifier> <type>bool</type><methodname>ReflectionProperty::hasHook</methodname>
<methodparam><type>PropertyHookType</type><parameter>type</parameter></methodparam>
</methodsynopsis>
<simpara>
Returns whether the property has a given hook defined.
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>PropertyHookType</parameter></term>
<listitem>
<simpara>
The type of hook to check for.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
Returns &true; if the hook is defined on this property, &false; if not.
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example xml:id="reflectionproperty.hashook.example.basic">
<title><methodname>ReflectionProperty::hasHook</methodname> example</title>
<programlisting role="php">
<![CDATA[
<?php
class Example
{
public string $name { get => "Name here"; }
}
$rClass = new \ReflectionClass(Example::class);
$rProp = $rClass->getProperty('name');
var_dump($rProp->hasHook(PropertyHookType::Get));
var_dump($rProp->hasHook(PropertyHookType::Set));
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
bool(true)
bool(false)
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><classname>ReflectionMethod</classname></member>
<member><classname>PropertyHookType</classname></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
-->