protected function makeRepository()
    {
        $full_path = $this->getFullRepositoryPath();
        if (file_exists($full_path)) {
            throw new RepositoryExistsException(sprintf('%s file already exists', $full_path));
        }
        $contract_contents = str_replace(
            [
                '%%MODEL_BASENAME%%',
                '%%MODEL_NAME%%',
                '%%CLASS_NAME%%',
                '%%NAMESPACE%%',
                '%%CONTRACT%%',
            ],
            [
                $this->getModelBasename(),
                $this->getModelName(),
                $this->getRepositoryBaseName(),
                trim($this->getRepositoriesNamespace(), '\\'),
                $this->getContractsNamespace() . '\\' . $this->getContractBaseName(),

            ],
            $this->contentsFromStub('Repository')
        );
        if (!file_exists(dirname($full_path))) {
            mkdir(dirname($full_path), 0755, true);
        }
        file_put_contents($full_path, $contract_contents);
    }