Refactor command classes to use specific interfaces
- Updated command classes to use specific interfaces for Kernel, Doctrine, PasswordHasher, Templating, and Mailer.
This commit is contained in:
parent
02a14ad587
commit
cd5a80b33b
|
@ -18,8 +18,8 @@ use Symfony\Component\HttpKernel\KernelInterface;
|
|||
#[AsCommand(name: 'webcron:cleanup', description: 'Cleanup runs')]
|
||||
class CleanupCommand extends Command
|
||||
{
|
||||
protected $kernel;
|
||||
protected $doctrine;
|
||||
protected KernelInterface $kernel;
|
||||
protected ManagerRegistry $doctrine;
|
||||
|
||||
public function __construct(KernelInterface $kernel, ManagerRegistry $doctrine)
|
||||
{
|
||||
|
|
|
@ -16,8 +16,8 @@ use Symfony\Component\HttpKernel\KernelInterface;
|
|||
#[AsCommand(name: 'webcron:daemon', description: 'The master script of Webcron Management')]
|
||||
class DaemonCommand extends Command
|
||||
{
|
||||
protected $kernel;
|
||||
protected $doctrine;
|
||||
protected KernelInterface $kernel;
|
||||
protected ManagerRegistry $doctrine;
|
||||
|
||||
public function __construct(KernelInterface $kernel, ManagerRegistry $doctrine)
|
||||
{
|
||||
|
|
|
@ -19,9 +19,9 @@ use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
|||
#[AsCommand(name: 'webcron:demodata', description: 'Install demo data')]
|
||||
class DemoInstallCommand extends Command
|
||||
{
|
||||
protected $kernel;
|
||||
protected $doctrine;
|
||||
protected $passwordHasher;
|
||||
protected KernelInterface $kernel;
|
||||
protected ManagerRegistry $doctrine;
|
||||
protected UserPasswordHasherInterface $passwordHasher;
|
||||
|
||||
public function __construct(KernelInterface $kernel, ManagerRegistry $doctrine, UserPasswordHasherInterface $passwordHasher)
|
||||
{
|
||||
|
|
|
@ -23,10 +23,10 @@ use Twig\Environment;
|
|||
#[AsCommand(name: 'webcron:mail-failed-runs', description: 'Sends email about failed runs')]
|
||||
class MailFailedRunsCommand extends Command
|
||||
{
|
||||
protected $kernel;
|
||||
protected $doctrine;
|
||||
protected $templating;
|
||||
protected $mailer;
|
||||
protected KernelInterface $kernel;
|
||||
protected ManagerRegistry $doctrine;
|
||||
protected Environment $templating;
|
||||
protected MailerInterface $mailer;
|
||||
|
||||
public function __construct(KernelInterface $kernel, ManagerRegistry $doctrine, Environment $templating, MailerInterface $mailer)
|
||||
{
|
||||
|
|
|
@ -14,8 +14,8 @@ use Symfony\Component\HttpKernel\KernelInterface;
|
|||
#[AsCommand(name: 'webcron:run', description: 'Run a single cronjob')]
|
||||
class RunCommand extends Command
|
||||
{
|
||||
protected $kernel;
|
||||
protected $doctrine;
|
||||
protected KernelInterface $kernel;
|
||||
protected ManagerRegistry $doctrine;
|
||||
|
||||
public function __construct(KernelInterface $kernel, ManagerRegistry $doctrine)
|
||||
{
|
||||
|
|
|
@ -25,7 +25,6 @@ use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
|||
#[AsCommand(name: 'webcron:user', description: 'User stuff')]
|
||||
class UserCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'webcron:user';
|
||||
protected KernelInterface $kernel;
|
||||
protected ManagerRegistry $doctrine;
|
||||
protected UserPasswordHasherInterface $passwordHasher;
|
||||
|
|
Loading…
Reference in New Issue
Block a user