public function add(TraitDefinition $traitToAdd)
    {
        foreach ($this->collection as $trait) {
            if ($trait === $traitToAdd) {
                throw new Exception(\sprintf('Trait already exists %s', \var_export($traitToAdd, true)));
            }
        }
        $this->collection[] = $traitToAdd;
    }
public function add(TraitDefinition $traitToAdd)
    {
        foreach ($this->collection as $trait) {
            if ($trait === $traitToAdd) {
                throw new Exception(\sprintf('Trait already exists %s', \var_export($traitToAdd, true)));
            }
        }
        $this->collection[] = $traitToAdd;
    }
public function add ( TraitDefinition $ traitToAdd ) { foreach ( $ this -> collection as $ trait ) { if ( $ trait === $ traitToAdd ) { throw new Exception ( \ sprintf ( 'Trait already exists %s' , \ var_export ( $ traitToAdd , true ) ) ) ; } } $ this -> collection [ ] = $ traitToAdd ; }
Adds a Type to the collection

@param TraitDefinition $traitToAdd Type to add.
Adds a Type to the collection