protected function replaceTraits($entityMetadata, &$stub)
    {
        $traits = [];

        // versionable
        if (! empty($entityMetadata['versionTable'])) {
            $traits['versionable'] = 'use \ProAI\Versioning\Versionable;';
        }

        // softDeletes
        if ($entityMetadata['softDeletes']) {
            $traits['softDeletes'] = 'use \ProAI\Versioning\SoftDeletes;';
        }

        // autoUuid
        if ($this->hasAutoUuidColumn($entityMetadata)) {
            $traits['autoUuid'] = 'use \ProAI\Datamapper\Eloquent\AutoUuid;';
        }

        $separator = PHP_EOL . PHP_EOL . '    ';
        $stub = str_replace('{{traits}}', implode($separator, $traits) . $separator, $stub);
    }