for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* This file is part of the mailserver-admin package.
* (c) Jeffrey Boehm <https://github.com/jeboehm/mailserver-admin>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Service\Config;
use App\Entity\Domain;
use Doctrine\ORM\EntityManagerInterface;
class Manager
{
private $cleaner;
private $generator;
private $manager;
public function __construct(LeftoverFileCleaner $cleaner, MapGenerator $generator, EntityManagerInterface $manager)
$this->cleaner = $cleaner;
$this->generator = $generator;
$this->manager = $manager;
}
public function refresh(): void
/** @var Domain $domains */
$domains = $this->manager->getRepository(Domain::class)->findAll();
$this->cleaner->clean(...$domains);
$this->generator->generate(...$domains);