ReflectionProperty::hasHooks

(PHP 8 >= 8.4.0)

ReflectionProperty::hasHooksReturns whether the property has any hooks defined

Beschreibung

public ReflectionProperty::hasHooks(): bool
Warnung

Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Parameter zur Verfügung.

Returns whether the property has any hooks defined.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Returns true if the property has at least one hook defined, false otherwise.

Beispiele

Beispiel #1 ReflectionProperty::hasHooks() example

<?php
class Example
{
public
string $name { get => "Name here"; }

public
string $none;
}

$rClass = new \ReflectionClass(Example::class);
var_dump($rClass->getProperty('name')->hasHooks());
var_dump($rClass->getProperty('none')->hasHooks());
?>

Anmerkungen

Hinweis: This method is equivalent to checking ReflectionProperty::getHooks() against an empty array.

Siehe auch

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top