ReflectionProperty::hasHooks

(PHP 8 >= 8.4.0)

ReflectionProperty::hasHooksReturns whether the property has any hooks defined

Descrição

public ReflectionProperty::hasHooks(): bool
Aviso

Esta função não está documentada; apenas a lista de argumentos está disponível.

Returns whether the property has any hooks defined.

Parâmetros

Esta função não possui parâmetros.

Valor Retornado

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

Exemplos

Exemplo #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());
?>

Notas

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

Veja Também

adicione uma nota

Notas Enviadas por Usuários (em inglês)

Não há notas de usuários para esta página.
To Top