(PHP 8 >= 8.4.0)
ReflectionProperty::hasHooks — Indica si la propiedad tiene hooks definidos
Esta función está actualmente no documentada; solo la lista de sus argumentos está disponible.
Indica si la propiedad tiene hooks definidos.
Esta función no contiene ningún parámetro.
Devuelve true
si la propiedad tiene al menos un hook definido, de lo contrario false
.
Ejemplo #1 Ejemplo de ReflectionProperty::hasHooks()
<?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());
?>
El ejemplo anterior mostrará :
bool(true) bool(false)
Nota: Este método es equivalente a verificar ReflectionProperty::getHooks() con un array vacío.