This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace App\Command;
|
||||
|
||||
use App\Helper\HiltesImport;
|
||||
use App\Repository\StockRepository;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
@@ -19,6 +21,14 @@ use Symfony\Component\Finder\Finder;
|
||||
)]
|
||||
class HiltesImportCommand extends Command
|
||||
{
|
||||
private $stockRepository;
|
||||
private $logger;
|
||||
public function __construct(StockRepository $stockRepository, LoggerInterface $logger)
|
||||
{
|
||||
$this->stockRepository = $stockRepository;
|
||||
$this->logger = $logger;
|
||||
parent::__construct();
|
||||
}
|
||||
protected function configure(): void
|
||||
{
|
||||
$this
|
||||
@@ -38,12 +48,12 @@ class HiltesImportCommand extends Command
|
||||
/**
|
||||
* @var HiltesImport
|
||||
*/
|
||||
$hiltesImport = new HiltesImport();
|
||||
$hiltesImport = new HiltesImport($this->stockRepository,$this->logger);
|
||||
|
||||
$hiltesImport->startImport();
|
||||
|
||||
|
||||
$io->success('You have a new command! Now make it your own! Pass --help to see your options.');
|
||||
$io->success('Done.');
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user