ReflectionProperty::hasHooks

Returns whether the property has any hooks defined

説明

public bool ReflectionProperty::hasHooks()
警告

この関数は、 現在のところ詳細な情報はありません。引数のリストのみが 記述されています。

Returns whether the property has any hooks defined.

パラメータ

この関数にはパラメータはありません。

戻り値

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

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

上の例の出力は以下となります。

bool(true)
bool(false)

注意

注意: This method is equivalent to checking ReflectionProperty::getHooks against an empty array.

参考

  • ReflectionProperty::getHooks