missingClass = TRUE; if (str_ends_with($class, 'Trait')) { $this->missingTraits[] = $class; class_alias(StubTrait::class, $class); } } /** * Returns whether there was an attempt to load a missing class. * * @return bool * TRUE if there was an attempt to load a missing class, otherwise FALSE. */ public function hasMissingClass(): bool { return $this->missingClass; } /** * Returns all recorded missing traits since the last reset. * * @return string[] * An array of traits recorded as missing. */ public function getMissingTraits(): array { return $this->missingTraits; } /** * Resets class variables. */ public function reset(): void { $this->missingClass = FALSE; $this->missingTraits = []; } }