1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
moduleskeletoncommand.php
См. документацию.
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
Bitrix\Main\Cli\Command\Dev;
6
7
use Bitrix\Main\Cli\Command\Dev\Service\Module\ModuleSkeletonDto;
8
use Bitrix\Main\Cli\Command\Dev\Service\ModuleSkeletonService;
9
use Symfony\Component\Console\Command\Command;
10
use Symfony\Component\Console\Exception\InvalidArgumentException;
11
use Symfony\Component\Console\Input\InputArgument;
12
use Symfony\Component\Console\Input\InputInterface;
13
use Symfony\Component\Console\Output\OutputInterface;
14
28
final
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
54
$service
=
new
ModuleSkeletonService
();
55
56
$service
->generateSkeleton($dto);
57
58
return
self::SUCCESS;
59
}
60
}
Bitrix\Main\Cli\Command\Dev\ModuleSkeletonCommand
Определения
moduleskeletoncommand.php:29
Bitrix\Main\Cli\Command\Dev\ModuleSkeletonCommand\configure
configure()
Определения
moduleskeletoncommand.php:30
Bitrix\Main\Cli\Command\Dev\ModuleSkeletonCommand\execute
execute(InputInterface $input, OutputInterface $output)
Определения
moduleskeletoncommand.php:40
Bitrix\Main\Cli\Command\Dev\Service\Module\ModuleSkeletonDto
Определения
moduleskeletondto.php:8
Bitrix\Main\Cli\Command\Dev\Service\ModuleSkeletonService
Определения
moduleskeletonservice.php:14
$output
$output
Определения
options.php:436
$service
$service
Определения
payment.php:18
$dir
$dir
Определения
quickway.php:303
bitrix
modules
main
lib
cli
command
dev
moduleskeletoncommand.php
Создано системой
1.14.0