Skip to content
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class EntryTypeExtension extends AbstractTypeExtension
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
// 職業を必須項目に変更するサンプル
$builder->remove('job');
Expand Down
10 changes: 5 additions & 5 deletions app/Plugin/MigrationSample/PluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class PluginManager extends AbstractPluginManager
*
* @return void
*/
public function install(array $meta, ContainerInterface $container)
public function install(array $meta, ContainerInterface $container): void
{
dump('install '.self::VERSION);
}
Expand All @@ -44,7 +44,7 @@ public function install(array $meta, ContainerInterface $container)
*
* @return void
*/
public function update(array $meta, ContainerInterface $container)
public function update(array $meta, ContainerInterface $container): void
{
$entityManager = $container->get('doctrine')->getManager();
dump('update '.self::VERSION);
Expand All @@ -59,7 +59,7 @@ public function update(array $meta, ContainerInterface $container)
*
* @return void
*/
public function enable(array $meta, ContainerInterface $container)
public function enable(array $meta, ContainerInterface $container): void
{
dump('enable '.self::VERSION);
}
Expand All @@ -72,7 +72,7 @@ public function enable(array $meta, ContainerInterface $container)
*
* @return void
*/
public function disable(array $meta, ContainerInterface $container)
public function disable(array $meta, ContainerInterface $container): void
{
$entityManager = $container->get('doctrine')->getManager();
dump('disable '.self::VERSION);
Expand All @@ -87,7 +87,7 @@ public function disable(array $meta, ContainerInterface $container)
*
* @return void
*/
public function uninstall(array $meta, ContainerInterface $container)
public function uninstall(array $meta, ContainerInterface $container): void
{
dump('uninstall '.self::VERSION);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class SaleLimitOneValidator extends ItemValidator
*
* @throws InvalidItemException
*/
protected function validate(ItemInterface $item, PurchaseContext $context)
protected function validate(ItemInterface $item, PurchaseContext $context): void
{
if (!$item->isProduct()) {
return;
Expand All @@ -63,7 +63,7 @@ protected function validate(ItemInterface $item, PurchaseContext $context)
}
}

protected function handle(ItemInterface $item, PurchaseContext $context)
protected function handle(ItemInterface $item, PurchaseContext $context): void
{
$item->setQuantity(1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AdminCustomerCustomizer extends WhereCustomizer
*
* @return WhereClause[]
*/
protected function createStatements($params, $queryKey)
protected function createStatements($params, $queryKey): array
{
// travis-ciのテストが通らないため、コメントアウト
// 試してみるにはコメントアウトを解除してください.
Expand All @@ -41,7 +41,7 @@ protected function createStatements($params, $queryKey)
*
* @return string
*/
public function getQueryKey()
public function getQueryKey(): string
{
return QueryKey::CUSTOMER_SEARCH;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Eccube/Annotation/ForwardOnly.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class ForwardOnly
*
* @return string
*/
public function getAliasName()
public function getAliasName(): string
{
return 'forward_only';
}
Expand All @@ -31,7 +31,7 @@ public function getAliasName()
*
* @return bool
*/
public function allowArray()
public function allowArray(): bool
{
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Eccube/Command/ComposerInstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public function __construct(ComposerApiService $composerService)
* @return void
*/
#[\Override]
protected function configure()
protected function configure(): void
{
$this->addOption('dry-run');
}

#[\Override]
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->composerService->execInstall($input->getOption('dry-run'), $output);

Expand Down
4 changes: 2 additions & 2 deletions src/Eccube/Command/ComposerRemoveCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ public function __construct(ComposerApiService $composerService)
* @return void
*/
#[\Override]
protected function configure()
protected function configure(): void
{
$this->addArgument('package', InputArgument::REQUIRED);
}

#[\Override]
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->composerService->execRemove($input->getArgument('package'), $output);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ public function __construct(
* @return void
*/
#[\Override]
public function initialize(InputInterface $input, OutputInterface $output)
public function initialize(InputInterface $input, OutputInterface $output): void
{
$this->io = new SymfonyStyle($input, $output);
}

#[\Override]
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$packageNames = [];
$unSupportedPlugins = [];
Expand Down
4 changes: 2 additions & 2 deletions src/Eccube/Command/ComposerRequireCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public function __construct(ComposerApiService $composerService)
* @return void
*/
#[\Override]
protected function configure()
protected function configure(): void
{
$this->addArgument('package', InputArgument::REQUIRED)
->addArgument('version', InputArgument::OPTIONAL)
->addOption('from', null, InputOption::VALUE_OPTIONAL, 'Path of composer repository');
}

#[\Override]
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$packageName = $input->getArgument('package');
if ($input->getArgument('version')) {
Expand Down
4 changes: 2 additions & 2 deletions src/Eccube/Command/ComposerUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public function __construct(ComposerApiService $composerService)
* @return void
*/
#[\Override]
protected function configure()
protected function configure(): void
{
$this->addOption('dry-run');
}

#[\Override]
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->composerService->execUpdate($input->getOption('dry-run'), $output);

Expand Down
12 changes: 6 additions & 6 deletions src/Eccube/Command/DeleteCartsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function __construct(EccubeConfig $eccubeConfig, EntityManagerInterface $
* @return void
*/
#[\Override]
protected function configure()
protected function configure(): void
{
$this
->setDescription('Delete Carts from the database')
Expand All @@ -89,7 +89,7 @@ protected function configure()
* @throws \Exception
*/
#[\Override]
protected function interact(InputInterface $input, OutputInterface $output)
protected function interact(InputInterface $input, OutputInterface $output): void
{
if (null !== $input->getArgument('date')) {
return;
Expand Down Expand Up @@ -124,7 +124,7 @@ protected function interact(InputInterface $input, OutputInterface $output)
* @throws \Exception
*/
#[\Override]
protected function initialize(InputInterface $input, OutputInterface $output)
protected function initialize(InputInterface $input, OutputInterface $output): void
{
$this->io = new SymfonyStyle($input, $output);
$this->locale = $this->eccubeConfig->get('locale');
Expand All @@ -133,7 +133,7 @@ protected function initialize(InputInterface $input, OutputInterface $output)
}

#[\Override]
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$dateStr = $input->getArgument('date');
$timestamp = $this->formatter->parse($dateStr);
Expand All @@ -151,7 +151,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
*
* @return void
*/
protected function deleteCarts(\DateTime $dateTime)
protected function deleteCarts(\DateTime $dateTime): void
{
try {
$this->entityManager->beginTransaction();
Expand All @@ -176,7 +176,7 @@ protected function deleteCarts(\DateTime $dateTime)
/**
* @return \IntlDateFormatter|null
*/
protected function createIntlFormatter()
protected function createIntlFormatter(): ?\IntlDateFormatter
{
return \IntlDateFormatter::create(
$this->locale,
Expand Down
4 changes: 2 additions & 2 deletions src/Eccube/Command/GenerateDummyDataCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function __construct(?Generator $generator = null, ?EntityManagerInterfac
* @return void
*/
#[\Override]
protected function configure()
protected function configure(): void
{
$this
->setDescription('Dummy data generator')
Expand All @@ -86,7 +86,7 @@ protected function configure()
}

#[\Override]
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$locale = $input->getOption('with-locale');
$notImage = $input->getOption('without-image');
Expand Down
4 changes: 2 additions & 2 deletions src/Eccube/Command/GenerateProxyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ public function __construct(EntityProxyService $entityProxyService, EccubeConfig
* @return void
*/
#[\Override]
protected function configure()
protected function configure(): void
{
$this
->setDescription('Generate entity proxies');
}

#[\Override]
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$projectDir = $this->eccubeConfig->get('kernel.project_dir');
$includeDirs = [$projectDir.'/app/Customize/Entity'];
Expand Down
18 changes: 9 additions & 9 deletions src/Eccube/Command/InstallerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function __construct(EccubeConfig $eccubeConfig)
/**
* @return array<string,mixed>
*/
private function getEnvParameters()
private function getEnvParameters(): array
{
return [
'APP_ENV' => $this->appEnv,
Expand All @@ -142,7 +142,7 @@ private function getEnvParameters()
*
* @return void
*/
public function updateEnvFile()
public function updateEnvFile(): void
{
// $envDir = $this->eccubeConfig->get('kernel.project_dir');
$envFile = $this->envDir.'/.env';
Expand All @@ -163,7 +163,7 @@ public function updateEnvFile()
* @return void
*/
#[\Override]
protected function configure()
protected function configure(): void
{
$this
->setDescription('Install EC-CUBE');
Expand All @@ -176,7 +176,7 @@ protected function configure()
* @return void
*/
#[\Override]
protected function interact(InputInterface $input, OutputInterface $output)
protected function interact(InputInterface $input, OutputInterface $output): void
{
$this->io->title('EC-CUBE Installer Interactive Wizard');
$this->io->text([
Expand Down Expand Up @@ -281,13 +281,13 @@ protected function interact(InputInterface $input, OutputInterface $output)
* @return void
*/
#[\Override]
protected function initialize(InputInterface $input, OutputInterface $output)
protected function initialize(InputInterface $input, OutputInterface $output): void
{
$this->io = new SymfonyStyle($input, $output);
}

#[\Override]
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
// Process実行時に, APP_ENV/APP_DEBUGが子プロセスに引き継がれてしまうため,
// 生成された.envをロードして上書きする.
Expand Down Expand Up @@ -341,7 +341,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
*
* @return string
*/
protected function getDatabaseName($databaseUrl)
protected function getDatabaseName($databaseUrl): string
{
if (str_starts_with((string) $databaseUrl, 'sqlite')) {
return 'sqlite';
Expand All @@ -359,11 +359,11 @@ protected function getDatabaseName($databaseUrl)
/**
* @param string $databaseUrl
*
* @return false|mixed|string
* @return false|string
*
* @throws \Doctrine\DBAL\Exception
*/
protected function getDatabaseServerVersion($databaseUrl)
protected function getDatabaseServerVersion($databaseUrl): false|string
{
try {
$conn = DriverManager::getConnection([
Expand Down
4 changes: 2 additions & 2 deletions src/Eccube/Command/LoadDataFixturesEccubeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct(ManagerRegistry $registry, EccubeConfig $eccubeConfi
* @return void
*/
#[\Override]
protected function configure()
protected function configure(): void
{
$this
->setDescription('Load data fixtures to your database.')
Expand All @@ -60,7 +60,7 @@ protected function configure()
}

#[\Override]
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$em = $this->getEntityManager($this->getDoctrine()->getDefaultManagerName());

Expand Down
6 changes: 3 additions & 3 deletions src/Eccube/Command/PluginCommandTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ trait PluginCommandTrait
* @return void
*/
#[Required]
public function setPluginService(PluginService $pluginService)
public function setPluginService(PluginService $pluginService): void
{
$this->pluginService = $pluginService;
}
Expand All @@ -49,7 +49,7 @@ public function setPluginService(PluginService $pluginService)
* @return void
*/
#[Required]
public function setPluginRepository(PluginRepository $pluginRepository)
public function setPluginRepository(PluginRepository $pluginRepository): void
{
$this->pluginRepository = $pluginRepository;
}
Expand All @@ -59,7 +59,7 @@ public function setPluginRepository(PluginRepository $pluginRepository)
*
* @return void
*/
protected function clearCache(SymfonyStyle $io)
protected function clearCache(SymfonyStyle $io): void
{
$command = ['bin/console', 'cache:clear', '--no-warmup'];
try {
Expand Down
Loading
Loading