/** * Register trait * * @param string $trait * @param string $pattern * @param float $sort * * @return TraitReflection */ public function registerTrait($trait, $pattern = null, $sort = null) { return $this->_traitRegistry->register($trait, $pattern, $sort); }
/** * A pattern for trait is required * * @test * @expectedException \RuntimeException * @expectedExceptionMessage No `pattern` defined for trait */ public function shouldFailOnMissingPattern() { $registry = new TraitRegistry(); $registry->register(TraitSample::class); }