protected function checkTraitDependencies($traitName)
    {
        if(isset($this->traitsDependencies[$traitName])) {
            $reflection = new \ReflectionClass($this);
            foreach($this->traitsDependencies[$traitName] as $requiredTrait) {
                $propertyName = 'has' . $requiredTrait;
                if(!$reflection->hasProperty($propertyName) || !$this->$propertyName) {
                    throw new \Exception(sprintf('Class %s uses %s trait but %s required trait is not used', $this->buildClassName($this->name), $traitName, $requiredTrait));
                }
            }
        }
    }
protected function checkTraitDependencies($traitName)
    {
        if(isset($this->traitsDependencies[$traitName])) {
            $reflection = new \ReflectionClass($this);
            foreach($this->traitsDependencies[$traitName] as $requiredTrait) {
                $propertyName = 'has' . $requiredTrait;
                if(!$reflection->hasProperty($propertyName) || !$this->$propertyName) {
                    throw new \Exception(sprintf('Class %s uses %s trait but %s required trait is not used', $this->buildClassName($this->name), $traitName, $requiredTrait));
                }
            }
        }
    }
protected function checkTraitDependencies ( $ traitName ) { if ( isset ( $ this -> traitsDependencies [ $ traitName ] ) ) { $ reflection = new \ ReflectionClass ( $ this ) ; foreach ( $ this -> traitsDependencies [ $ traitName ] as $ requiredTrait ) { $ propertyName = 'has' . $ requiredTrait ; if ( ! $ reflection -> hasProperty ( $ propertyName ) || ! $ this -> $ propertyName ) { throw new \ Exception ( sprintf ( 'Class %s uses %s trait but %s required trait is not used' , $ this -> buildClassName ( $ this -> name ) , $ traitName , $ requiredTrait ) ) ; } } } }
Checks whether traits required by another trait are used
@param string $traitName
@param string $injectedProperty
Checks whether traits required by another trait are used