1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
locatorcodescommand.php
См. документацию.
1<?php
2
4
7use Symfony\Component\Console\Command\Command;
8use Symfony\Component\Console\Exception\InvalidArgumentException;
9use Symfony\Component\Console\Input\InputArgument;
10use Symfony\Component\Console\Input\InputInterface;
11use Symfony\Component\Console\Input\InputOption;
12use Symfony\Component\Console\Output\OutputInterface;
13
32final class LocatorCodesCommand extends Command
33{
34 protected function configure(): void
35 {
36 $this
37 ->setName('dev:locator-codes')
38 ->setDescription('Generate .phpstorm.meta.php file')
39 ->addArgument('module', InputArgument::REQUIRED, 'Module name')
40 ->addArgument('code', InputArgument::OPTIONAL, 'Code')
41 ->addOption('show', null, InputOption::VALUE_NONE, 'outputs to console, without saving it. It can be used to save to an arbitrary location when using the `>` operator.')
42 ;
43 }
44
45 protected function execute(InputInterface $input, OutputInterface $output): int
46 {
47 $module = $input->getArgument('module');
48 if (!is_string($module))
49 {
50 throw new InvalidArgumentException('Module name must be string');
51 }
52
53 $code = $input->getArgument('code');
54 if (!is_string($code))
55 {
56 $code = "bitrix_{$module}_locator_codes";
57 }
58
59 $dto = new LocatorCodesDto(
60 module: $module,
61 code: $code,
62 );
63
65
66 if ($input->getOption('show') === true)
67 {
68 $output->write($service->generateContent($dto));
69 $output->writeln("\n");
70 }
71 else
72 {
73 $service->generateFile($dto);
74 }
75
76 return self::SUCCESS;
77 }
78}
execute(InputInterface $input, OutputInterface $output)
Определения locatorcodescommand.php:45
$output
Определения options.php:436
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
$service
Определения payment.php:18