Note that getTraits will NOT return any traits inherited from a parent.
This is currently viewed as the desired behavior. See https://bugs.php.net/bug.php?id=61554
(PHP 5 >= 5.4.0, PHP 7, PHP 8)
ReflectionClass::getTraits — このクラスが使うトレイトの配列を返す
この関数にはパラメータはありません。
トレイト名をキー、トレイトの
ReflectionClass のインスタンスを値とする配列を返します。
エラー時には null
を返します。
Note that getTraits will NOT return any traits inherited from a parent.
This is currently viewed as the desired behavior. See https://bugs.php.net/bug.php?id=61554