public function getTraitByName($name)
    {
        $variables = [];
        foreach ($this->collection as $trait) {
            if (\is_array($name)) {
                $variables = \reset($name);
                $name = \key($name);
            }
            /** @var $trait TraitDefinition */
            if ($trait->getName() === $name) {
                return $trait->parseVariables($variables);
            }
        }

        throw new Exception(\sprintf('No trait found for name %s, list: %s', \var_export($name, true), \var_export($this->collection, true)));
    }