1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
moduleskeletoncommand.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
5namespace Bitrix\Main\Cli\Command\Dev;
6
7use Bitrix\Main\Cli\Command\Dev\Service\Module\ModuleSkeletonDto;
8use Bitrix\Main\Cli\Command\Dev\Service\ModuleSkeletonService;
9use Symfony\Component\Console\Command\Command;
10use Symfony\Component\Console\Exception\InvalidArgumentException;
11use Symfony\Component\Console\Input\InputArgument;
12use Symfony\Component\Console\Input\InputInterface;
13use Symfony\Component\Console\Output\OutputInterface;
14
28final class ModuleSkeletonCommand extends Command
29{
30 protected function configure(): void
31 {
32 $this
33 ->setName('dev:module-skeleton')
34 ->setDescription('Generate module skeleton')
35 ->addArgument('module', InputArgument::REQUIRED, 'Module name')
36 ->addArgument('dir', InputArgument::OPTIONAL, 'Directory in [module]/lib, where you want to place skeleton')
37 ;
38 }
39
40 protected function execute(InputInterface $input, OutputInterface $output): int
41 {
42 $module = $input->getArgument('module');
43 if (!is_string($module))
44 {
45 throw new InvalidArgumentException('Module name must be string');
46 }
47
48 $dir = $input->getArgument('dir') ?? '';
49
50 $dto = new ModuleSkeletonDto(
51 module: $module, directory: $dir,
52 );
53
55
56 $service->generateSkeleton($dto);
57
58 return self::SUCCESS;
59 }
60}
execute(InputInterface $input, OutputInterface $output)
Определения moduleskeletoncommand.php:40
$output
Определения options.php:436
$service
Определения payment.php:18
$dir
Определения quickway.php:303