mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-12-12 21:33:13 +00:00
40 lines
1.0 KiB
PHP
40 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Chill\MainBundle\Command;
|
|
|
|
use Chill\MainBundle\Service\Import\PostalCodeFRFromOpenData;
|
|
use Symfony\Component\Console\Command\Command;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
|
|
#[\Symfony\Component\Console\Attribute\AsCommand(name: 'chill:main:postal-code:load:FR')]
|
|
class LoadPostalCodeFR extends Command
|
|
{
|
|
protected static $defaultDescription = 'Load France\'s postal code from online open data';
|
|
|
|
public function __construct(private readonly PostalCodeFRFromOpenData $loader)
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
public function configure(): void
|
|
{
|
|
}
|
|
|
|
public function execute(InputInterface $input, OutputInterface $output): int
|
|
{
|
|
$this->loader->import();
|
|
|
|
return Command::SUCCESS;
|
|
}
|
|
}
|