Start with snips content abstraction
This commit is contained in:
@ -4,6 +4,7 @@ namespace App\Service;
|
||||
|
||||
use App\Entity\Snip;
|
||||
use App\Git\CustomGit;
|
||||
use App\Service\SnipContent\SnipContentGit;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
|
||||
class SnipServiceFactory
|
||||
@ -16,7 +17,7 @@ class SnipServiceFactory
|
||||
{
|
||||
}
|
||||
|
||||
public function create(Snip $snip): SnipService
|
||||
public function create(Snip $snip): SnipContentGit
|
||||
{
|
||||
$git = new CustomGit();
|
||||
$repoPath = sprintf('%s/%s', $this->snipBasePath, $snip->getId());
|
||||
@ -28,6 +29,6 @@ class SnipServiceFactory
|
||||
} else {
|
||||
$repo = $git->open($repoPath);
|
||||
}
|
||||
return new SnipService($repo, $this->security->getUser());
|
||||
return new SnipContentGit($repo, $this->security->getUser());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user