First fully working version of saving snips content with git control
This commit is contained in:
22
src/Service/SnipServiceFactory.php
Normal file
22
src/Service/SnipServiceFactory.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service;
|
||||
|
||||
use App\Entity\Snip;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
|
||||
class SnipServiceFactory
|
||||
{
|
||||
|
||||
public function __construct(
|
||||
private readonly string $snipBasePath,
|
||||
private readonly Security $security,
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
public function create(Snip $snip): SnipService
|
||||
{
|
||||
return new SnipService($snip, $this->snipBasePath, $this->security->getUser());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user