$hasTrait method

bool $hasTrait(
  1. Type trait
)

Returns whether this node has the given trait.

Implementation

bool $hasTrait(Type trait) => $traits.contains(trait);