diff --git a/app/Plugin/FormExtension/Form/Extension/EntryTypeExtension.php b/app/Plugin/FormExtension/Form/Extension/EntryTypeExtension.php index 89f2f0c81de..fbe8befaa37 100644 --- a/app/Plugin/FormExtension/Form/Extension/EntryTypeExtension.php +++ b/app/Plugin/FormExtension/Form/Extension/EntryTypeExtension.php @@ -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'); diff --git a/app/Plugin/MigrationSample/PluginManager.php b/app/Plugin/MigrationSample/PluginManager.php index b8db8ac5941..474867d90b1 100644 --- a/app/Plugin/MigrationSample/PluginManager.php +++ b/app/Plugin/MigrationSample/PluginManager.php @@ -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); } @@ -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); @@ -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); } @@ -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); @@ -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); } diff --git a/app/Plugin/PurchaseProcessors/Service/PurchaseFlow/Processor/SaleLimitOneValidator.php b/app/Plugin/PurchaseProcessors/Service/PurchaseFlow/Processor/SaleLimitOneValidator.php index 28db306da14..0e95b5f0deb 100644 --- a/app/Plugin/PurchaseProcessors/Service/PurchaseFlow/Processor/SaleLimitOneValidator.php +++ b/app/Plugin/PurchaseProcessors/Service/PurchaseFlow/Processor/SaleLimitOneValidator.php @@ -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; @@ -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); } diff --git a/app/Plugin/QueryCustomize/Repository/AdminCustomerCustomizer.php b/app/Plugin/QueryCustomize/Repository/AdminCustomerCustomizer.php index eb03803ca98..ed75c982c8c 100644 --- a/app/Plugin/QueryCustomize/Repository/AdminCustomerCustomizer.php +++ b/app/Plugin/QueryCustomize/Repository/AdminCustomerCustomizer.php @@ -27,7 +27,7 @@ class AdminCustomerCustomizer extends WhereCustomizer * * @return WhereClause[] */ - protected function createStatements($params, $queryKey) + protected function createStatements($params, $queryKey): array { // travis-ciのテストが通らないため、コメントアウト // 試してみるにはコメントアウトを解除してください. @@ -41,7 +41,7 @@ protected function createStatements($params, $queryKey) * * @return string */ - public function getQueryKey() + public function getQueryKey(): string { return QueryKey::CUSTOMER_SEARCH; } diff --git a/src/Eccube/Annotation/ForwardOnly.php b/src/Eccube/Annotation/ForwardOnly.php index 6ffd518a515..37283f0472b 100644 --- a/src/Eccube/Annotation/ForwardOnly.php +++ b/src/Eccube/Annotation/ForwardOnly.php @@ -21,7 +21,7 @@ final class ForwardOnly * * @return string */ - public function getAliasName() + public function getAliasName(): string { return 'forward_only'; } @@ -31,7 +31,7 @@ public function getAliasName() * * @return bool */ - public function allowArray() + public function allowArray(): bool { return false; } diff --git a/src/Eccube/Command/ComposerInstallCommand.php b/src/Eccube/Command/ComposerInstallCommand.php index 84ba357bcb3..3df8a9b028e 100644 --- a/src/Eccube/Command/ComposerInstallCommand.php +++ b/src/Eccube/Command/ComposerInstallCommand.php @@ -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); diff --git a/src/Eccube/Command/ComposerRemoveCommand.php b/src/Eccube/Command/ComposerRemoveCommand.php index 8d00eec74a0..c996f6f74d0 100644 --- a/src/Eccube/Command/ComposerRemoveCommand.php +++ b/src/Eccube/Command/ComposerRemoveCommand.php @@ -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); diff --git a/src/Eccube/Command/ComposerRequireAlreadyInstalledPluginsCommand.php b/src/Eccube/Command/ComposerRequireAlreadyInstalledPluginsCommand.php index 865e0853d46..eac54803ae0 100644 --- a/src/Eccube/Command/ComposerRequireAlreadyInstalledPluginsCommand.php +++ b/src/Eccube/Command/ComposerRequireAlreadyInstalledPluginsCommand.php @@ -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 = []; diff --git a/src/Eccube/Command/ComposerRequireCommand.php b/src/Eccube/Command/ComposerRequireCommand.php index 4662b9776e3..5a21d9cc5f5 100644 --- a/src/Eccube/Command/ComposerRequireCommand.php +++ b/src/Eccube/Command/ComposerRequireCommand.php @@ -39,7 +39,7 @@ public function __construct(ComposerApiService $composerService) * @return void */ #[\Override] - protected function configure() + protected function configure(): void { $this->addArgument('package', InputArgument::REQUIRED) ->addArgument('version', InputArgument::OPTIONAL) @@ -47,7 +47,7 @@ protected function configure() } #[\Override] - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $packageName = $input->getArgument('package'); if ($input->getArgument('version')) { diff --git a/src/Eccube/Command/ComposerUpdateCommand.php b/src/Eccube/Command/ComposerUpdateCommand.php index 9043cb5c021..33183e67210 100644 --- a/src/Eccube/Command/ComposerUpdateCommand.php +++ b/src/Eccube/Command/ComposerUpdateCommand.php @@ -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); diff --git a/src/Eccube/Command/DeleteCartsCommand.php b/src/Eccube/Command/DeleteCartsCommand.php index c65fe402fe5..b6615ac67a0 100644 --- a/src/Eccube/Command/DeleteCartsCommand.php +++ b/src/Eccube/Command/DeleteCartsCommand.php @@ -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') @@ -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; @@ -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'); @@ -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); @@ -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(); @@ -176,7 +176,7 @@ protected function deleteCarts(\DateTime $dateTime) /** * @return \IntlDateFormatter|null */ - protected function createIntlFormatter() + protected function createIntlFormatter(): ?\IntlDateFormatter { return \IntlDateFormatter::create( $this->locale, diff --git a/src/Eccube/Command/GenerateDummyDataCommand.php b/src/Eccube/Command/GenerateDummyDataCommand.php index 4faf302d750..67e9756d68c 100644 --- a/src/Eccube/Command/GenerateDummyDataCommand.php +++ b/src/Eccube/Command/GenerateDummyDataCommand.php @@ -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') @@ -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'); diff --git a/src/Eccube/Command/GenerateProxyCommand.php b/src/Eccube/Command/GenerateProxyCommand.php index e91cf7d0003..606b2e361df 100644 --- a/src/Eccube/Command/GenerateProxyCommand.php +++ b/src/Eccube/Command/GenerateProxyCommand.php @@ -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']; diff --git a/src/Eccube/Command/InstallerCommand.php b/src/Eccube/Command/InstallerCommand.php index 72e1166f637..a31b7dcbf35 100644 --- a/src/Eccube/Command/InstallerCommand.php +++ b/src/Eccube/Command/InstallerCommand.php @@ -120,7 +120,7 @@ public function __construct(EccubeConfig $eccubeConfig) /** * @return array */ - private function getEnvParameters() + private function getEnvParameters(): array { return [ 'APP_ENV' => $this->appEnv, @@ -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'; @@ -163,7 +163,7 @@ public function updateEnvFile() * @return void */ #[\Override] - protected function configure() + protected function configure(): void { $this ->setDescription('Install EC-CUBE'); @@ -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([ @@ -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をロードして上書きする. @@ -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'; @@ -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([ diff --git a/src/Eccube/Command/LoadDataFixturesEccubeCommand.php b/src/Eccube/Command/LoadDataFixturesEccubeCommand.php index 37123e96505..d2d1d500267 100644 --- a/src/Eccube/Command/LoadDataFixturesEccubeCommand.php +++ b/src/Eccube/Command/LoadDataFixturesEccubeCommand.php @@ -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.') @@ -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()); diff --git a/src/Eccube/Command/PluginCommandTrait.php b/src/Eccube/Command/PluginCommandTrait.php index c1f3c66a719..9fdc3fe1e2c 100644 --- a/src/Eccube/Command/PluginCommandTrait.php +++ b/src/Eccube/Command/PluginCommandTrait.php @@ -38,7 +38,7 @@ trait PluginCommandTrait * @return void */ #[Required] - public function setPluginService(PluginService $pluginService) + public function setPluginService(PluginService $pluginService): void { $this->pluginService = $pluginService; } @@ -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; } @@ -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 { diff --git a/src/Eccube/Command/PluginDisableCommand.php b/src/Eccube/Command/PluginDisableCommand.php index 582c469d5ec..d73706bccb0 100644 --- a/src/Eccube/Command/PluginDisableCommand.php +++ b/src/Eccube/Command/PluginDisableCommand.php @@ -28,14 +28,14 @@ class PluginDisableCommand extends Command * @return void */ #[\Override] - protected function configure() + protected function configure(): void { $this ->addOption('code', null, InputOption::VALUE_OPTIONAL, 'plugin code'); } #[\Override] - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); diff --git a/src/Eccube/Command/PluginEnableCommand.php b/src/Eccube/Command/PluginEnableCommand.php index 06223173001..0d5c25e291b 100644 --- a/src/Eccube/Command/PluginEnableCommand.php +++ b/src/Eccube/Command/PluginEnableCommand.php @@ -28,14 +28,14 @@ class PluginEnableCommand extends Command * @return void */ #[\Override] - protected function configure() + protected function configure(): void { $this ->addOption('code', null, InputOption::VALUE_OPTIONAL, 'plugin code'); } #[\Override] - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); diff --git a/src/Eccube/Command/PluginGenerateCommand.php b/src/Eccube/Command/PluginGenerateCommand.php index 1e6e1e8dafd..4ed229693d6 100644 --- a/src/Eccube/Command/PluginGenerateCommand.php +++ b/src/Eccube/Command/PluginGenerateCommand.php @@ -52,7 +52,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - protected function configure() + protected function configure(): void { $this ->addArgument('name', InputOption::VALUE_REQUIRED, 'plugin name') @@ -68,7 +68,7 @@ protected function configure() * @return void */ #[\Override] - protected function initialize(InputInterface $input, OutputInterface $output) + protected function initialize(InputInterface $input, OutputInterface $output): void { $this->io = new SymfonyStyle($input, $output); $this->fs = new Filesystem(); @@ -81,7 +81,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) * @return void */ #[\Override] - protected function interact(InputInterface $input, OutputInterface $output) + protected function interact(InputInterface $input, OutputInterface $output): void { if (null !== $input->getArgument('name') && null !== $input->getArgument('code') && null !== $input->getArgument('ver')) { return; @@ -118,7 +118,7 @@ protected function interact(InputInterface $input, OutputInterface $output) } #[\Override] - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $name = $input->getArgument('name'); $code = $input->getArgument('code'); @@ -149,7 +149,7 @@ protected function execute(InputInterface $input, OutputInterface $output) * * @return string */ - public function validateCode($code) + public function validateCode($code): string { if (empty($code)) { throw new InvalidArgumentException('The code can not be empty.'); @@ -172,9 +172,9 @@ public function validateCode($code) /** * @param string $version * - * @return mixed + * @return string */ - public function validateVersion($version) + public function validateVersion($version): string { // TODO return $version; @@ -185,7 +185,7 @@ public function validateVersion($version) * * @return void */ - protected function createDirectories($pluginDir) + protected function createDirectories($pluginDir): void { $dirs = [ 'Controller/Admin', @@ -212,7 +212,7 @@ protected function createDirectories($pluginDir) * * @return void */ - protected function createConfig($pluginDir, $name, $code, $version) + protected function createConfig($pluginDir, $name, $code, $version): void { $lowerCode = mb_strtolower((string) $code); $source = <<fs->dumpFile($pluginDir.'/Resource/locale/validators.ja.yaml', ''); @@ -302,7 +302,7 @@ protected function createMessages($pluginDir) * * @return void */ - protected function createTwigBlock($pluginDir, $code) + protected function createTwigBlock($pluginDir, $code): void { $source = <<addOption('path', null, InputOption::VALUE_OPTIONAL, 'path of tar or zip') @@ -38,7 +38,7 @@ protected function configure() } #[\Override] - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); diff --git a/src/Eccube/Command/PluginSchemaUpdateCommand.php b/src/Eccube/Command/PluginSchemaUpdateCommand.php index 2e6f62cd660..04c47887146 100644 --- a/src/Eccube/Command/PluginSchemaUpdateCommand.php +++ b/src/Eccube/Command/PluginSchemaUpdateCommand.php @@ -30,7 +30,7 @@ class PluginSchemaUpdateCommand extends Command * @return void */ #[\Override] - protected function configure() + protected function configure(): void { $this ->addArgument('code', InputArgument::REQUIRED, 'Plugin code') @@ -38,7 +38,7 @@ protected function configure() } #[\Override] - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); diff --git a/src/Eccube/Command/PluginUninstallCommand.php b/src/Eccube/Command/PluginUninstallCommand.php index 0cf5b2c8d94..49654e32534 100644 --- a/src/Eccube/Command/PluginUninstallCommand.php +++ b/src/Eccube/Command/PluginUninstallCommand.php @@ -28,7 +28,7 @@ class PluginUninstallCommand extends Command * @return void */ #[\Override] - protected function configure() + protected function configure(): void { $this ->addOption('code', null, InputOption::VALUE_OPTIONAL, 'plugin code') @@ -37,7 +37,7 @@ protected function configure() } #[\Override] - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); diff --git a/src/Eccube/Command/PluginUpdateCommand.php b/src/Eccube/Command/PluginUpdateCommand.php index b65675680cb..8c565d4bd6e 100644 --- a/src/Eccube/Command/PluginUpdateCommand.php +++ b/src/Eccube/Command/PluginUpdateCommand.php @@ -29,7 +29,7 @@ class PluginUpdateCommand extends Command * @return void */ #[\Override] - protected function configure() + protected function configure(): void { $this ->addArgument('code', InputArgument::REQUIRED, 'Plugin code') @@ -37,7 +37,7 @@ protected function configure() } #[\Override] - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); diff --git a/src/Eccube/Command/UpdateSchemaDoctrineCommand.php b/src/Eccube/Command/UpdateSchemaDoctrineCommand.php index 31d20ccbe60..4a35e5194a1 100644 --- a/src/Eccube/Command/UpdateSchemaDoctrineCommand.php +++ b/src/Eccube/Command/UpdateSchemaDoctrineCommand.php @@ -135,7 +135,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int * * @return void */ - protected function removeOutputDir($outputDir) + protected function removeOutputDir($outputDir): void { if (file_exists($outputDir)) { $files = Finder::create() diff --git a/src/Eccube/Common/EccubeConfig.php b/src/Eccube/Common/EccubeConfig.php index 22025fa3790..7b40202ce64 100644 --- a/src/Eccube/Common/EccubeConfig.php +++ b/src/Eccube/Common/EccubeConfig.php @@ -35,7 +35,7 @@ public function __construct(ContainerBagInterface $container) * * @return mixed */ - public function get($key) + public function get($key): mixed { return $this->container->get($key); } @@ -45,7 +45,7 @@ public function get($key) * * @return bool */ - public function has($key) + public function has($key): bool { return $this->container->has($key); } @@ -57,7 +57,7 @@ public function has($key) */ #[\ReturnTypeWillChange] #[\Override] - public function offsetExists($offset) + public function offsetExists($offset): bool { return $this->has($offset); } @@ -69,7 +69,7 @@ public function offsetExists($offset) */ #[\ReturnTypeWillChange] #[\Override] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return $this->get($offset); } @@ -80,7 +80,7 @@ public function offsetGet($offset) */ #[\ReturnTypeWillChange] #[\Override] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { throw new \LogicException(); } @@ -92,7 +92,7 @@ public function offsetSet($offset, $value) */ #[\ReturnTypeWillChange] #[\Override] - public function offsetUnset($offset) + public function offsetUnset($offset): void { throw new \LogicException(); } diff --git a/src/Eccube/Common/EccubeNav.php b/src/Eccube/Common/EccubeNav.php index fd8af35b8a6..0f2f1042e43 100644 --- a/src/Eccube/Common/EccubeNav.php +++ b/src/Eccube/Common/EccubeNav.php @@ -18,5 +18,5 @@ interface EccubeNav /** * @return array */ - public static function getNav(); + public static function getNav(): array; } diff --git a/src/Eccube/Common/EccubeTwigBlock.php b/src/Eccube/Common/EccubeTwigBlock.php index ecfc0fce8b3..49d865b1272 100644 --- a/src/Eccube/Common/EccubeTwigBlock.php +++ b/src/Eccube/Common/EccubeTwigBlock.php @@ -18,5 +18,5 @@ interface EccubeTwigBlock /** * @return array */ - public static function getTwigBlock(); + public static function getTwigBlock(): array; } diff --git a/src/Eccube/Controller/AbstractController.php b/src/Eccube/Controller/AbstractController.php index 335fcac0bb8..f6941707e23 100644 --- a/src/Eccube/Controller/AbstractController.php +++ b/src/Eccube/Controller/AbstractController.php @@ -71,7 +71,7 @@ class AbstractController extends Controller * @return void */ #[Required] - public function setEccubeConfig(EccubeConfig $eccubeConfig) + public function setEccubeConfig(EccubeConfig $eccubeConfig): void { $this->eccubeConfig = $eccubeConfig; } @@ -82,7 +82,7 @@ public function setEccubeConfig(EccubeConfig $eccubeConfig) * @return void */ #[Required] - public function setEntityManager(EntityManagerInterface $entityManager) + public function setEntityManager(EntityManagerInterface $entityManager): void { $this->entityManager = $entityManager; } @@ -93,7 +93,7 @@ public function setEntityManager(EntityManagerInterface $entityManager) * @return void */ #[Required] - public function setTranslator(TranslatorInterface $translator) + public function setTranslator(TranslatorInterface $translator): void { $this->translator = $translator; } @@ -104,7 +104,7 @@ public function setTranslator(TranslatorInterface $translator) * @return void */ #[Required] - public function setSession(Session $session) + public function setSession(Session $session): void { $this->session = $session; } @@ -115,7 +115,7 @@ public function setSession(Session $session) * @return void */ #[Required] - public function setFormFactory(FormFactoryInterface $formFactory) + public function setFormFactory(FormFactoryInterface $formFactory): void { $this->formFactory = $formFactory; } @@ -126,7 +126,7 @@ public function setFormFactory(FormFactoryInterface $formFactory) * @return void */ #[Required] - public function setEventDispatcher(EventDispatcherInterface $eventDispatcher) + public function setEventDispatcher(EventDispatcherInterface $eventDispatcher): void { $this->eventDispatcher = $eventDispatcher; } @@ -137,7 +137,7 @@ public function setEventDispatcher(EventDispatcherInterface $eventDispatcher) * @return void */ #[Required] - public function setRouter(RouterInterface $router) + public function setRouter(RouterInterface $router): void { $this->router = $router; } @@ -148,7 +148,7 @@ public function setRouter(RouterInterface $router) * * @return void */ - public function addSuccess($message, $namespace = 'front') + public function addSuccess($message, $namespace = 'front'): void { $this->addFlash('eccube.'.$namespace.'.success', $message); } @@ -159,7 +159,7 @@ public function addSuccess($message, $namespace = 'front') * * @return void */ - public function addSuccessOnce($message, $namespace = 'front') + public function addSuccessOnce($message, $namespace = 'front'): void { $this->addFlashOnce('eccube.'.$namespace.'.success', $message); } @@ -170,7 +170,7 @@ public function addSuccessOnce($message, $namespace = 'front') * * @return void */ - public function addError($message, $namespace = 'front') + public function addError($message, $namespace = 'front'): void { $this->addFlash('eccube.'.$namespace.'.error', $message); } @@ -181,7 +181,7 @@ public function addError($message, $namespace = 'front') * * @return void */ - public function addErrorOnce($message, $namespace = 'front') + public function addErrorOnce($message, $namespace = 'front'): void { $this->addFlashOnce('eccube.'.$namespace.'.error', $message); } @@ -192,7 +192,7 @@ public function addErrorOnce($message, $namespace = 'front') * * @return void */ - public function addDanger($message, $namespace = 'front') + public function addDanger($message, $namespace = 'front'): void { $this->addFlash('eccube.'.$namespace.'.danger', $message); } @@ -203,7 +203,7 @@ public function addDanger($message, $namespace = 'front') * * @return void */ - public function addDangerOnce($message, $namespace = 'front') + public function addDangerOnce($message, $namespace = 'front'): void { $this->addFlashOnce('eccube.'.$namespace.'.danger', $message); } @@ -214,7 +214,7 @@ public function addDangerOnce($message, $namespace = 'front') * * @return void */ - public function addWarning($message, $namespace = 'front') + public function addWarning($message, $namespace = 'front'): void { $this->addFlash('eccube.'.$namespace.'.warning', $message); } @@ -225,7 +225,7 @@ public function addWarning($message, $namespace = 'front') * * @return void */ - public function addWarningOnce($message, $namespace = 'front') + public function addWarningOnce($message, $namespace = 'front'): void { $this->addFlashOnce('eccube.'.$namespace.'.warning', $message); } @@ -236,7 +236,7 @@ public function addWarningOnce($message, $namespace = 'front') * * @return void */ - public function addInfo($message, $namespace = 'front') + public function addInfo($message, $namespace = 'front'): void { $this->addFlash('eccube.'.$namespace.'.info', $message); } @@ -247,7 +247,7 @@ public function addInfo($message, $namespace = 'front') * * @return void */ - public function addInfoOnce($message, $namespace = 'front') + public function addInfoOnce($message, $namespace = 'front'): void { $this->addFlashOnce('eccube.'.$namespace.'.info', $message); } @@ -258,7 +258,7 @@ public function addInfoOnce($message, $namespace = 'front') * * @return void */ - public function addRequestError($message, $namespace = 'front') + public function addRequestError($message, $namespace = 'front'): void { $this->addFlash('eccube.'.$namespace.'.request.error', $message); } @@ -269,7 +269,7 @@ public function addRequestError($message, $namespace = 'front') * * @return void */ - public function addRequestErrorOnce($message, $namespace = 'front') + public function addRequestErrorOnce($message, $namespace = 'front'): void { $this->addFlashOnce('eccube.'.$namespace.'.request.error', $message); } @@ -277,7 +277,7 @@ public function addRequestErrorOnce($message, $namespace = 'front') /** * @return void */ - public function clearMessage() + public function clearMessage(): void { /** @var Session $session */ $session = $this->session; @@ -287,7 +287,7 @@ public function clearMessage() /** * @return void */ - public function deleteMessage() + public function deleteMessage(): void { $this->clearMessage(); $this->addWarning('admin.common.delete_error_already_deleted', 'admin'); @@ -343,7 +343,7 @@ protected function addFlash(string $type, $message): void * * @return void */ - public function setLoginTargetPath($targetPath, $namespace = null) + public function setLoginTargetPath($targetPath, $namespace = null): void { if (is_null($namespace)) { /** @var Session $session */ @@ -365,7 +365,7 @@ public function setLoginTargetPath($targetPath, $namespace = null) * * @return \Symfony\Component\HttpFoundation\Response A Response instance */ - public function forwardToRoute($route, array $path = [], array $query = []) + public function forwardToRoute($route, array $path = [], array $query = []): \Symfony\Component\HttpFoundation\Response { $Route = $this->router->getRouteCollection()->get($route); if (!$Route) { @@ -384,7 +384,7 @@ public function forwardToRoute($route, array $path = [], array $query = []) * * @throws AccessDeniedHttpException */ - protected function isTokenValid() + protected function isTokenValid(): bool { /** @var Request $request */ $request = $this->container->get('request_stack')->getCurrentRequest(); diff --git a/src/Eccube/Controller/AbstractShoppingController.php b/src/Eccube/Controller/AbstractShoppingController.php index 187962015ac..dd3be49a26e 100644 --- a/src/Eccube/Controller/AbstractShoppingController.php +++ b/src/Eccube/Controller/AbstractShoppingController.php @@ -33,7 +33,7 @@ class AbstractShoppingController extends AbstractController * @return void */ #[Required] - public function setPurchaseFlow(PurchaseFlow $shoppingPurchaseFlow) + public function setPurchaseFlow(PurchaseFlow $shoppingPurchaseFlow): void { $this->purchaseFlow = $shoppingPurchaseFlow; } @@ -44,7 +44,7 @@ public function setPurchaseFlow(PurchaseFlow $shoppingPurchaseFlow) * * @return PurchaseFlowResult|RedirectResponse|null */ - protected function executePurchaseFlow(ItemHolderInterface $itemHolder, $returnResponse = true) + protected function executePurchaseFlow(ItemHolderInterface $itemHolder, $returnResponse = true): PurchaseFlowResult|RedirectResponse|null { /** @var PurchaseFlowResult $flowResult */ $flowResult = $this->purchaseFlow->validate($itemHolder, new PurchaseContext(clone $itemHolder, $itemHolder->getCustomer())); diff --git a/src/Eccube/Controller/Admin/AbstractCsvImportController.php b/src/Eccube/Controller/Admin/AbstractCsvImportController.php index 2fd6b21cfb6..4eaa1d3f292 100644 --- a/src/Eccube/Controller/Admin/AbstractCsvImportController.php +++ b/src/Eccube/Controller/Admin/AbstractCsvImportController.php @@ -37,7 +37,7 @@ class AbstractCsvImportController extends AbstractController * * @return CsvImportService|bool */ - protected function getImportData(UploadedFile $formFile) + protected function getImportData(UploadedFile $formFile): CsvImportService|bool { // アップロードされたCSVファイルを一時ディレクトリに保存 $this->csvFileName = 'upload_'.StringUtil::random().'.'.$formFile->getClientOriginalExtension(); @@ -60,7 +60,7 @@ protected function getImportData(UploadedFile $formFile) * * @return StreamedResponse */ - protected function sendTemplateResponse(Request $request, $columns, $filename) + protected function sendTemplateResponse(Request $request, $columns, $filename): StreamedResponse { set_time_limit(0); @@ -88,7 +88,7 @@ protected function sendTemplateResponse(Request $request, $columns, $filename) * * @return void */ - protected function removeUploadedFile() + protected function removeUploadedFile(): void { if (!empty($this->csvFileName)) { try { diff --git a/src/Eccube/Controller/Admin/AdminController.php b/src/Eccube/Controller/Admin/AdminController.php index 61cd3129c96..3b281d723f2 100644 --- a/src/Eccube/Controller/Admin/AdminController.php +++ b/src/Eccube/Controller/Admin/AdminController.php @@ -131,7 +131,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/login', name: 'admin_login', methods: ['GET', 'POST'])] #[Template('@admin/login.twig')] - public function login(Request $request) + public function login(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array { if ($this->authorizationChecker->isGranted('ROLE_ADMIN')) { return $this->redirectToRoute('admin_homepage'); @@ -167,7 +167,7 @@ public function login(Request $request) */ #[Route('/%eccube_admin_route%/', name: 'admin_homepage', methods: ['GET'])] #[Template('@admin/index.twig')] - public function index(Request $request) + public function index(Request $request): array { $adminRoute = $this->eccubeConfig['eccube_admin_route']; $is_danger_admin_url = false; @@ -278,7 +278,7 @@ public function index(Request $request) * @return \Symfony\Component\HttpFoundation\JsonResponse */ #[Route('/%eccube_admin_route%/sale_chart', name: 'admin_homepage_sale', methods: ['GET'])] - public function sale(Request $request) + public function sale(Request $request): \Symfony\Component\HttpFoundation\JsonResponse { if (!($request->isXmlHttpRequest() && $this->isTokenValid())) { return $this->json(['status' => 'NG'], 400); @@ -397,7 +397,7 @@ public function searchNonStockProducts(Request $request): Response * @return Response */ #[Route('/%eccube_admin_route%/search_customer', name: 'admin_homepage_customer', methods: ['GET'])] - public function searchCustomer(Request $request) + public function searchCustomer(Request $request): Response { $searchData = []; $searchData['customer_status'] = [CustomerStatus::REGULAR]; @@ -414,7 +414,7 @@ public function searchCustomer(Request $request) * * @return array|null */ - protected function getOrderEachStatus(array $excludes) + protected function getOrderEachStatus(array $excludes): ?array { $sql = 'SELECT t1.order_status_id as status, @@ -444,11 +444,11 @@ protected function getOrderEachStatus(array $excludes) /** * @param \DateTime $dateTime * - * @return array|mixed + * @return array * * @throws \Doctrine\ORM\NonUniqueResultException */ - protected function getSalesByDay($dateTime) + protected function getSalesByDay($dateTime): array { $dateTimeStart = clone $dateTime; $dateTimeStart->setTime(0, 0, 0, 0); @@ -481,11 +481,11 @@ protected function getSalesByDay($dateTime) /** * @param \DateTime $dateTime * - * @return array|mixed + * @return array * * @throws \Doctrine\ORM\NonUniqueResultException */ - protected function getSalesByMonth($dateTime) + protected function getSalesByMonth($dateTime): array { $dateTimeStart = clone $dateTime; $dateTimeStart->setTime(0, 0, 0, 0); @@ -520,11 +520,11 @@ protected function getSalesByMonth($dateTime) /** * 在庫切れ商品数を取得 * - * @return mixed + * @return int|string|null * * @throws \Doctrine\ORM\NonUniqueResultException */ - protected function countNonStockProducts() + protected function countNonStockProducts(): int|string|null { $qb = $this->productRepository->createQueryBuilder('p') ->select('count(DISTINCT p.id)') @@ -540,11 +540,11 @@ protected function countNonStockProducts() /** * 商品数を取得 * - * @return mixed + * @return int|string|null * * @throws \Doctrine\ORM\NonUniqueResultException */ - protected function countProducts() + protected function countProducts(): int|string|null { $qb = $this->productRepository->createQueryBuilder('p') ->select('count(p.id)') @@ -557,11 +557,11 @@ protected function countProducts() /** * 本会員数を取得 * - * @return mixed + * @return int|string|null * * @throws \Doctrine\ORM\NonUniqueResultException */ - protected function countCustomers() + protected function countCustomers(): int|string|null { $qb = $this->customerRepository->createQueryBuilder('c') ->select('count(c.id)') @@ -580,7 +580,7 @@ protected function countCustomers() * * @return array */ - protected function getData(Carbon $fromDate, Carbon $toDate, $format) + protected function getData(Carbon $fromDate, Carbon $toDate, $format): array { $qb = $this->orderRepository->createQueryBuilder('o') ->andWhere('o.order_date >= :fromDate') @@ -606,7 +606,7 @@ protected function getData(Carbon $fromDate, Carbon $toDate, $format) * * @return array */ - protected function convert($result, Carbon $fromDate, Carbon $toDate, $format) + protected function convert($result, Carbon $fromDate, Carbon $toDate, $format): array { $raw = []; for ($date = $fromDate; $date <= $toDate; $date = $date->addDay()) { diff --git a/src/Eccube/Controller/Admin/Content/BlockController.php b/src/Eccube/Controller/Admin/Content/BlockController.php index 99fca273deb..d7cc42602ac 100644 --- a/src/Eccube/Controller/Admin/Content/BlockController.php +++ b/src/Eccube/Controller/Admin/Content/BlockController.php @@ -57,7 +57,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/content/block', name: 'admin_content_block', methods: ['GET'])] #[Template('@admin/Content/block.twig')] - public function index(Request $request) + public function index(Request $request): array { $DeviceType = $this->deviceTypeRepository ->find(DeviceType::DEVICE_TYPE_PC); @@ -93,7 +93,7 @@ public function index(Request $request) #[Route('/%eccube_admin_route%/content/block/new', name: 'admin_content_block_new', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/content/block/{id}/edit', name: 'admin_content_block_edit', requirements: ['id' => '\d+'], methods: ['GET', 'POST'])] #[Template('@admin/Content/block_edit.twig')] - public function edit(Request $request, Environment $twig, Filesystem $fs, CacheUtil $cacheUtil, $id = null) + public function edit(Request $request, Environment $twig, Filesystem $fs, CacheUtil $cacheUtil, $id = null): \Symfony\Component\HttpFoundation\RedirectResponse|array { $this->addInfoOnce('admin.common.restrict_file_upload_info', 'admin'); @@ -197,7 +197,7 @@ public function edit(Request $request, Environment $twig, Filesystem $fs, CacheU * @return \Symfony\Component\HttpFoundation\RedirectResponse */ #[Route('/%eccube_admin_route%/content/block/{id}/delete', name: 'admin_content_block_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, Block $Block, Filesystem $fs, CacheUtil $cacheUtil) + public function delete(Request $request, Block $Block, Filesystem $fs, CacheUtil $cacheUtil): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); diff --git a/src/Eccube/Controller/Admin/Content/CacheController.php b/src/Eccube/Controller/Admin/Content/CacheController.php index e071c1a44c4..07ba8a52144 100644 --- a/src/Eccube/Controller/Admin/Content/CacheController.php +++ b/src/Eccube/Controller/Admin/Content/CacheController.php @@ -28,7 +28,7 @@ class CacheController extends AbstractController */ #[Route('/%eccube_admin_route%/content/cache', name: 'admin_content_cache', methods: ['GET', 'POST'])] #[Template('@admin/Content/cache.twig')] - public function index(Request $request, CacheUtil $cacheUtil, SystemService $systemService) + public function index(Request $request, CacheUtil $cacheUtil, SystemService $systemService): array { $builder = $this->formFactory->createBuilder(FormType::class); $form = $builder->getForm(); diff --git a/src/Eccube/Controller/Admin/Content/CssController.php b/src/Eccube/Controller/Admin/Content/CssController.php index f9e285cedeb..ced5a320c06 100644 --- a/src/Eccube/Controller/Admin/Content/CssController.php +++ b/src/Eccube/Controller/Admin/Content/CssController.php @@ -29,7 +29,7 @@ class CssController extends AbstractController */ #[Route('/%eccube_admin_route%/content/css', name: 'admin_content_css', methods: ['GET', 'POST'])] #[Template('@admin/Content/css.twig')] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array { $this->addInfoOnce('admin.common.restrict_file_upload_info', 'admin'); diff --git a/src/Eccube/Controller/Admin/Content/FileController.php b/src/Eccube/Controller/Admin/Content/FileController.php index 5be3fe37bd8..d009b42fb3a 100644 --- a/src/Eccube/Controller/Admin/Content/FileController.php +++ b/src/Eccube/Controller/Admin/Content/FileController.php @@ -62,7 +62,7 @@ public function __construct() */ #[Route('/%eccube_admin_route%/content/file_manager', name: 'admin_content_file', methods: ['GET', 'POST'])] #[Template('@admin/Content/file.twig')] - public function index(Request $request) + public function index(Request $request): array { $this->addInfoOnce('admin.common.restrict_file_upload_info', 'admin'); @@ -132,7 +132,7 @@ public function index(Request $request) * @throws NotFoundHttpException */ #[Route('/%eccube_admin_route%/content/file_view', name: 'admin_content_file_view', methods: ['GET'])] - public function view(Request $request) + public function view(Request $request): BinaryFileResponse { $file = $this->convertStrToServer($this->getUserDataDir($request->get('file'))); if ($this->checkDir($file, $this->getUserDataDir())) { @@ -153,7 +153,7 @@ public function view(Request $request) * * @throws IOException */ - public function create(Request $request) + public function create(Request $request): void { $form = $this->formFactory->createBuilder(FormType::class) ->add('file', FileType::class, [ @@ -221,7 +221,7 @@ public function create(Request $request) * @return \Symfony\Component\HttpFoundation\RedirectResponse */ #[Route('/%eccube_admin_route%/content/file_delete', name: 'admin_content_file_delete', methods: ['DELETE'])] - public function delete(Request $request) + public function delete(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -250,14 +250,14 @@ public function delete(Request $request) * @throws NotFoundHttpException */ #[Route('/%eccube_admin_route%/content/file_download', name: 'admin_content_file_download', methods: ['GET'])] - public function download(Request $request) + public function download(Request $request): BinaryFileResponse { $topDir = $this->getUserDataDir(); $file = $this->convertStrToServer($this->getUserDataDir($request->get('select_file'))); if ($this->checkDir($file, $topDir)) { if (!is_dir($file)) { setlocale(LC_ALL, 'ja_JP.UTF-8'); - $pathParts = pathinfo((string) $file); + $pathParts = pathinfo($file); $patterns = [ '/[a-zA-Z0-9!"#$%&()=~^|@`:*;+{}]/', @@ -284,7 +284,7 @@ public function download(Request $request) * * @return void */ - public function upload(Request $request) + public function upload(Request $request): void { $form = $this->formFactory->createBuilder(FormType::class) ->add('file', FileType::class, [ @@ -326,15 +326,15 @@ public function upload(Request $request) $filename = $this->convertStrToServer($file->getClientOriginalName()); try { // フォルダの存在チェック - if (is_dir(rtrim((string) $nowDir, '/\\').\DIRECTORY_SEPARATOR.$filename)) { + if (is_dir(rtrim($nowDir, '/\\').\DIRECTORY_SEPARATOR.$filename)) { throw new UnsupportedMediaTypeHttpException(trans('admin.content.file.same_name_folder_exists')); } // 英数字, 半角スペース, _-.() のみ許可 - if (!preg_match('/\A[a-zA-Z0-9_\-\.\(\) ]+\Z/', (string) $filename)) { + if (!preg_match('/\A[a-zA-Z0-9_\-\.\(\) ]+\Z/', $filename)) { throw new UnsupportedMediaTypeHttpException(trans('admin.content.file.folder_name_symbol_error')); } // dotファイルはアップロード不可 - if (str_starts_with((string) $filename, '.')) { + if (str_starts_with($filename, '.')) { throw new UnsupportedMediaTypeHttpException(trans('admin.content.file.dotfile_error')); } // 許可した拡張子以外アップロード不可 @@ -370,7 +370,7 @@ public function upload(Request $request) * * @return array> */ - private function getTreeToArray($tree) + private function getTreeToArray($tree): array { $arrTree = []; foreach ($tree as $key => $val) { @@ -392,7 +392,7 @@ private function getTreeToArray($tree) * * @return array,mixed> */ - private function getPathsToArray($tree) + private function getPathsToArray($tree): array { $paths = []; foreach ($tree as $val) { @@ -408,7 +408,7 @@ private function getPathsToArray($tree) * * @return array> */ - private function getTree($topDir, $request) + private function getTree($topDir, $request): array { $finder = Finder::create()->in($topDir) ->directories() @@ -449,7 +449,7 @@ private function getTree($topDir, $request) * * @return array */ - private function getFileList($nowDir) + private function getFileList($nowDir): array { $topDir = $this->getuserDataDir(); $filter = function (\SplFileInfo $file) use ($topDir) { @@ -522,7 +522,7 @@ private function getFileList($nowDir) * * @return array|false|string|string[] */ - protected function normalizePath($path) + protected function normalizePath($path): array|false|string { return str_replace('\\', '/', realpath($path)); } @@ -533,7 +533,7 @@ protected function normalizePath($path) * * @return bool */ - protected function checkDir($targetDir, $topDir) + protected function checkDir($targetDir, $topDir): bool { if (str_contains((string) $targetDir, '..')) { return false; @@ -549,7 +549,7 @@ protected function checkDir($targetDir, $topDir) * * @return string */ - private function convertStrFromServer($target) + private function convertStrFromServer($target): string { if ($this->encode == self::SJIS) { return mb_convert_encoding($target, self::UTF, self::SJIS); @@ -563,7 +563,7 @@ private function convertStrFromServer($target) * * @return string */ - private function convertStrToServer($target) + private function convertStrToServer($target): string { if ($this->encode == self::SJIS) { return mb_convert_encoding($target, self::SJIS, self::UTF); @@ -577,7 +577,7 @@ private function convertStrToServer($target) * * @return string */ - private function getUserDataDir($nowDir = null) + private function getUserDataDir($nowDir = null): string { return rtrim($this->getParameter('kernel.project_dir').'/html/user_data'.$nowDir, '/'); } @@ -587,7 +587,7 @@ private function getUserDataDir($nowDir = null) * * @return string */ - private function getJailDir($path) + private function getJailDir($path): string { $realpath = (string) realpath($path); $jailPath = str_replace((string) realpath($this->getUserDataDir()), '', $realpath); diff --git a/src/Eccube/Controller/Admin/Content/JsController.php b/src/Eccube/Controller/Admin/Content/JsController.php index 2634e9be177..ab4cd7d8443 100644 --- a/src/Eccube/Controller/Admin/Content/JsController.php +++ b/src/Eccube/Controller/Admin/Content/JsController.php @@ -31,7 +31,7 @@ class JsController extends AbstractController */ #[Route('/%eccube_admin_route%/content/js', name: 'admin_content_js', methods: ['GET', 'POST'])] #[Template('@admin/Content/js.twig')] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array { $this->addInfoOnce('admin.common.restrict_file_upload_info', 'admin'); diff --git a/src/Eccube/Controller/Admin/Content/LayoutController.php b/src/Eccube/Controller/Admin/Content/LayoutController.php index 3f337495a2f..a4342d1babe 100644 --- a/src/Eccube/Controller/Admin/Content/LayoutController.php +++ b/src/Eccube/Controller/Admin/Content/LayoutController.php @@ -104,7 +104,7 @@ public function __construct(BlockRepository $blockRepository, BlockPositionRepos */ #[Route('/%eccube_admin_route%/content/layout', name: 'admin_content_layout', methods: ['GET'])] #[Template('@admin/Content/layout_list.twig')] - public function index() + public function index(): array { $qb = $this->layoutRepository->createQueryBuilder('l'); $Layouts = $qb->where('l.id != :DefaultLayoutPreviewPage') @@ -125,7 +125,7 @@ public function index() * @return RedirectResponse */ #[Route('/%eccube_admin_route%/content/layout/{id}/delete', name: 'admin_content_layout_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Layout $Layout, CacheUtil $cacheUtil) + public function delete(Layout $Layout, CacheUtil $cacheUtil): RedirectResponse { $this->isTokenValid(); @@ -160,7 +160,7 @@ public function delete(Layout $Layout, CacheUtil $cacheUtil) #[Route('/%eccube_admin_route%/content/layout/{id}/edit', requirements: ['id' => '\d+'], name: 'admin_content_layout_edit', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/content/layout/new', name: 'admin_content_layout_new', methods: ['GET', 'POST'])] #[Template('@admin/Content/layout.twig')] - public function edit(Request $request, CacheUtil $cacheUtil, $id = null, $previewPageId = null) + public function edit(Request $request, CacheUtil $cacheUtil, $id = null, $previewPageId = null): RedirectResponse|array { if (is_null($id)) { $Layout = new Layout(); @@ -253,7 +253,7 @@ public function edit(Request $request, CacheUtil $cacheUtil, $id = null, $previe * @return JsonResponse */ #[Route('/%eccube_admin_route%/content/layout/view_block', name: 'admin_content_layout_view_block', methods: ['GET'])] - public function viewBlock(Request $request, Twig $twig) + public function viewBlock(Request $request, Twig $twig): JsonResponse { if (!$request->isXmlHttpRequest()) { throw new BadRequestHttpException(); @@ -287,7 +287,7 @@ public function viewBlock(Request $request, Twig $twig) * @return RedirectResponse|array */ #[Route('/%eccube_admin_route%/content/layout/{id}/preview', requirements: ['id' => '\d+'], name: 'admin_content_layout_preview', methods: ['POST'])] - public function preview(Request $request, $id, CacheUtil $cacheUtil) + public function preview(Request $request, $id, CacheUtil $cacheUtil): RedirectResponse|array { $form = $request->get('admin_layout'); $this->isPreview = true; diff --git a/src/Eccube/Controller/Admin/Content/MaintenanceController.php b/src/Eccube/Controller/Admin/Content/MaintenanceController.php index fd4ca0ef70a..23b713afa98 100644 --- a/src/Eccube/Controller/Admin/Content/MaintenanceController.php +++ b/src/Eccube/Controller/Admin/Content/MaintenanceController.php @@ -90,7 +90,7 @@ public function index(Request $request): \Symfony\Component\HttpFoundation\Redir * @throws BadRequestHttpException */ #[Route('/%eccube_admin_route%/disable_maintenance/{mode}', name: 'admin_disable_maintenance', requirements: ['mode' => 'manual|auto_maintenance|auto_maintenance_update'], methods: ['POST'])] - public function disableMaintenance(Request $request, $mode, SystemService $systemService) + public function disableMaintenance(Request $request, $mode, SystemService $systemService): \Symfony\Component\HttpFoundation\JsonResponse { $this->isTokenValid(); diff --git a/src/Eccube/Controller/Admin/Content/NewsController.php b/src/Eccube/Controller/Admin/Content/NewsController.php index 8662f48f543..1f46d60c722 100644 --- a/src/Eccube/Controller/Admin/Content/NewsController.php +++ b/src/Eccube/Controller/Admin/Content/NewsController.php @@ -56,7 +56,7 @@ public function __construct(NewsRepository $newsRepository) #[Route('/%eccube_admin_route%/content/news', name: 'admin_content_news', methods: ['GET'])] #[Route('/%eccube_admin_route%/content/news/page/{page_no}', name: 'admin_content_news_page', requirements: ['page_no' => '\d+'], methods: ['GET'])] #[Template('@admin/Content/news.twig')] - public function index(Request $request, PaginatorInterface $paginator, $page_no = 1) + public function index(Request $request, PaginatorInterface $paginator, $page_no = 1): array { $qb = $this->newsRepository->getQueryBuilderAll(); @@ -90,7 +90,7 @@ public function index(Request $request, PaginatorInterface $paginator, $page_no #[Route('/%eccube_admin_route%/content/news/new', name: 'admin_content_news_new', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/content/news/{id}/edit', requirements: ['id' => '\d+'], name: 'admin_content_news_edit', methods: ['GET', 'POST'])] #[Template('@admin/Content/news_edit.twig')] - public function edit(Request $request, CacheUtil $cacheUtil, $id = null) + public function edit(Request $request, CacheUtil $cacheUtil, $id = null): array|RedirectResponse { if ($id) { $News = $this->newsRepository->find($id); @@ -155,7 +155,7 @@ public function edit(Request $request, CacheUtil $cacheUtil, $id = null) * @return RedirectResponse */ #[Route('/%eccube_admin_route%/content/news/{id}/delete', name: 'admin_content_news_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, News $News, CacheUtil $cacheUtil) + public function delete(Request $request, News $News, CacheUtil $cacheUtil): RedirectResponse { $this->isTokenValid(); diff --git a/src/Eccube/Controller/Admin/Content/PageController.php b/src/Eccube/Controller/Admin/Content/PageController.php index b3031c97a27..f9591562e97 100644 --- a/src/Eccube/Controller/Admin/Content/PageController.php +++ b/src/Eccube/Controller/Admin/Content/PageController.php @@ -69,7 +69,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/content/page', name: 'admin_content_page', methods: ['GET'])] #[Template('@admin/Content/page.twig')] - public function index(Request $request, RouterInterface $router) + public function index(Request $request, RouterInterface $router): array { $Pages = $this->pageRepository->getPageList(); @@ -95,7 +95,7 @@ public function index(Request $request, RouterInterface $router) #[Route('/%eccube_admin_route%/content/page/new', name: 'admin_content_page_new', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/content/page/{id}/edit', requirements: ['id' => '\d+'], name: 'admin_content_page_edit', methods: ['GET', 'POST'])] #[Template('@admin/Content/page_edit.twig')] - public function edit(Request $request, Environment $twig, RouterInterface $router, CacheUtil $cacheUtil, $id = null) + public function edit(Request $request, Environment $twig, RouterInterface $router, CacheUtil $cacheUtil, $id = null): \Symfony\Component\HttpFoundation\RedirectResponse|array { $this->addInfoOnce('admin.common.restrict_file_upload_info', 'admin'); @@ -263,7 +263,7 @@ public function edit(Request $request, Environment $twig, RouterInterface $route * @return \Symfony\Component\HttpFoundation\RedirectResponse */ #[Route('/%eccube_admin_route%/content/page/{id}/delete', name: 'admin_content_page_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, CacheUtil $cacheUtil, $id = null) + public function delete(Request $request, CacheUtil $cacheUtil, $id = null): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); diff --git a/src/Eccube/Controller/Admin/Customer/CustomerController.php b/src/Eccube/Controller/Admin/Customer/CustomerController.php index 57a2067239a..df0c0a66ad0 100644 --- a/src/Eccube/Controller/Admin/Customer/CustomerController.php +++ b/src/Eccube/Controller/Admin/Customer/CustomerController.php @@ -95,7 +95,7 @@ public function __construct( #[Route('/%eccube_admin_route%/customer', name: 'admin_customer', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/customer/page/{page_no}', name: 'admin_customer_page', requirements: ['page_no' => '\d+'], methods: ['GET', 'POST'])] #[Template('@admin/Customer/index.twig')] - public function index(Request $request, PaginatorInterface $paginator, $page_no = null) + public function index(Request $request, PaginatorInterface $paginator, $page_no = null): array { $session = $this->session; $builder = $this->formFactory->createBuilder(SearchCustomerType::class); @@ -195,7 +195,7 @@ public function index(Request $request, PaginatorInterface $paginator, $page_no * @throws NotFoundHttpException */ #[Route('/%eccube_admin_route%/customer/{id}/resend', name: 'admin_customer_resend', requirements: ['id' => '\d+'], methods: ['GET'])] - public function resend(Request $request, $id) + public function resend(Request $request, $id): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -241,7 +241,7 @@ public function resend(Request $request, $id) * @return \Symfony\Component\HttpFoundation\RedirectResponse */ #[Route('/%eccube_admin_route%/customer/{id}/delete', name: 'admin_customer_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, $id, TranslatorInterface $translator) + public function delete(Request $request, $id, TranslatorInterface $translator): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -293,7 +293,7 @@ public function delete(Request $request, $id, TranslatorInterface $translator) * @return StreamedResponse */ #[Route('/%eccube_admin_route%/customer/export', name: 'admin_customer_export', methods: ['GET'])] - public function export(Request $request) + public function export(Request $request): StreamedResponse { // タイムアウトを無効にする. set_time_limit(0); diff --git a/src/Eccube/Controller/Admin/Customer/CustomerDeliveryEditController.php b/src/Eccube/Controller/Admin/Customer/CustomerDeliveryEditController.php index 12e080d2cbc..0b7a6d39efb 100644 --- a/src/Eccube/Controller/Admin/Customer/CustomerDeliveryEditController.php +++ b/src/Eccube/Controller/Admin/Customer/CustomerDeliveryEditController.php @@ -53,7 +53,7 @@ public function __construct( #[Route('/%eccube_admin_route%/customer/{id}/delivery/new', name: 'admin_customer_delivery_new', requirements: ['id' => '\d+'], methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/customer/{id}/delivery/{did}/edit', name: 'admin_customer_delivery_edit', requirements: ['id' => '\d+', 'did' => '\d+'], methods: ['GET', 'POST'])] #[Template('@admin/Customer/delivery_edit.twig')] - public function edit(Request $request, Customer $Customer, $did = null) + public function edit(Request $request, Customer $Customer, $did = null): array|\Symfony\Component\HttpFoundation\RedirectResponse { // 配送先住所最大値判定 // $idが存在する際は、追加処理ではなく、編集の処理ため本ロジックスキップ @@ -137,7 +137,7 @@ public function edit(Request $request, Customer $Customer, $did = null) * @throws NotFoundHttpException */ #[Route('/%eccube_admin_route%/customer/{id}/delivery/{did}/delete', name: 'admin_customer_delivery_delete', requirements: ['id' => '\d+', 'did' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, Customer $Customer, $did) + public function delete(Request $request, Customer $Customer, $did): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); diff --git a/src/Eccube/Controller/Admin/Customer/CustomerEditController.php b/src/Eccube/Controller/Admin/Customer/CustomerEditController.php index 5603b4d7234..aec00f91cd8 100644 --- a/src/Eccube/Controller/Admin/Customer/CustomerEditController.php +++ b/src/Eccube/Controller/Admin/Customer/CustomerEditController.php @@ -76,7 +76,7 @@ public function __construct( #[Route('/%eccube_admin_route%/customer/new', name: 'admin_customer_new', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/customer/{id}/edit', requirements: ['id' => '\d+'], name: 'admin_customer_edit', methods: ['GET', 'POST'])] #[Template('@admin/Customer/edit.twig')] - public function index(Request $request, PaginatorInterface $paginator, $id = null) + public function index(Request $request, PaginatorInterface $paginator, $id = null): \Symfony\Component\HttpFoundation\RedirectResponse|array { $this->entityManager->getFilters()->enable('incomplete_order_status_hidden'); // 編集 diff --git a/src/Eccube/Controller/Admin/Order/CsvImportController.php b/src/Eccube/Controller/Admin/Order/CsvImportController.php index e8133def5a1..a11571dce3e 100644 --- a/src/Eccube/Controller/Admin/Order/CsvImportController.php +++ b/src/Eccube/Controller/Admin/Order/CsvImportController.php @@ -55,7 +55,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/order/shipping_csv_upload', name: 'admin_shipping_csv_import', methods: ['GET', 'POST'])] #[Template('@admin/Order/csv_shipping.twig')] - public function csvShipping(Request $request) + public function csvShipping(Request $request): array { $form = $this->formFactory->createBuilder(CsvImportType::class)->getForm(); $columnConfig = $this->getColumnConfig(); @@ -103,7 +103,7 @@ public function csvShipping(Request $request) * * @return void */ - protected function loadCsv($csv, &$errors) + protected function loadCsv($csv, &$errors): void { $columnConfig = $this->getColumnConfig(); @@ -206,7 +206,7 @@ protected function loadCsv($csv, &$errors) * @return \Symfony\Component\HttpFoundation\StreamedResponse */ #[Route('/%eccube_admin_route%/order/csv_template', name: 'admin_shipping_csv_template', methods: ['GET'])] - public function csvTemplate(Request $request) + public function csvTemplate(Request $request): \Symfony\Component\HttpFoundation\StreamedResponse { $columns = array_column($this->getColumnConfig(), 'name'); @@ -216,7 +216,7 @@ public function csvTemplate(Request $request) /** * @return array> */ - protected function getColumnConfig() + protected function getColumnConfig(): array { return [ 'id' => [ diff --git a/src/Eccube/Controller/Admin/Order/EditController.php b/src/Eccube/Controller/Admin/Order/EditController.php index 6533b0c258c..b9207e3fe2b 100644 --- a/src/Eccube/Controller/Admin/Order/EditController.php +++ b/src/Eccube/Controller/Admin/Order/EditController.php @@ -190,7 +190,7 @@ public function __construct( #[Route('/%eccube_admin_route%/order/new', name: 'admin_order_new', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/order/{id}/edit', name: 'admin_order_edit', requirements: ['id' => '\d+'], methods: ['GET', 'POST'])] #[Template('@admin/Order/edit.twig')] - public function index(Request $request, RouterInterface $router, $id = null) + public function index(Request $request, RouterInterface $router, $id = null): \Symfony\Component\HttpFoundation\RedirectResponse|array { if (null === $id) { // 空のエンティティを作成. @@ -429,7 +429,7 @@ public function index(Request $request, RouterInterface $router, $id = null) #[Route('/%eccube_admin_route%/order/search/customer/html', name: 'admin_order_search_customer_html', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/order/search/customer/html/page/{page_no}', name: 'admin_order_search_customer_html_page', requirements: ['page_no' => '\d+'], methods: ['GET', 'POST'])] #[Template('@admin/Order/search_customer.twig')] - public function searchCustomerHtml(Request $request, PaginatorInterface $paginator, $page_no = null) + public function searchCustomerHtml(Request $request, PaginatorInterface $paginator, $page_no = null): array { if ($request->isXmlHttpRequest() && $this->isTokenValid()) { log_debug('search customer start.'); @@ -523,7 +523,7 @@ public function searchCustomerHtml(Request $request, PaginatorInterface $paginat * @return \Symfony\Component\HttpFoundation\JsonResponse */ #[Route('/%eccube_admin_route%/order/search/customer/id', name: 'admin_order_search_customer_by_id', methods: ['POST'])] - public function searchCustomerById(Request $request) + public function searchCustomerById(Request $request): \Symfony\Component\HttpFoundation\JsonResponse { if ($request->isXmlHttpRequest() && $this->isTokenValid()) { log_debug('search customer by id start.'); @@ -584,12 +584,12 @@ public function searchCustomerById(Request $request) * @param PaginatorInterface $paginator * @param string|null $page_no * - * @return array|void + * @return array */ #[Route('/%eccube_admin_route%/order/search/product', name: 'admin_order_search_product', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/order/search/product/page/{page_no}', name: 'admin_order_search_product_page', requirements: ['page_no' => '\d+'], methods: ['GET', 'POST'])] #[Template('@admin/Order/search_product.twig')] - public function searchProduct(Request $request, PaginatorInterface $paginator, $page_no = null) + public function searchProduct(Request $request, PaginatorInterface $paginator, $page_no = null): array { if ($request->isXmlHttpRequest() && $this->isTokenValid()) { log_debug('search product start.'); @@ -672,6 +672,8 @@ public function searchProduct(Request $request, PaginatorInterface $paginator, $ 'pagination' => $pagination, ]; } + + return []; } /** @@ -685,7 +687,7 @@ public function searchProduct(Request $request, PaginatorInterface $paginator, $ */ #[Route('/%eccube_admin_route%/order/search/order_item_type', name: 'admin_order_search_order_item_type', methods: ['POST'])] #[Template('@admin/Order/order_item_type.twig')] - public function searchOrderItemType(Request $request) + public function searchOrderItemType(Request $request): array { if ($request->isXmlHttpRequest() && $this->isTokenValid()) { log_debug('search order item type start.'); diff --git a/src/Eccube/Controller/Admin/Order/MailController.php b/src/Eccube/Controller/Admin/Order/MailController.php index d33cb1b80ec..697f821f349 100644 --- a/src/Eccube/Controller/Admin/Order/MailController.php +++ b/src/Eccube/Controller/Admin/Order/MailController.php @@ -83,7 +83,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/order/{id}/mail', requirements: ['id' => '\d+'], name: 'admin_order_mail', methods: ['GET', 'POST'])] #[Template('@admin/Order/mail.twig')] - public function index(Request $request, Order $Order) + public function index(Request $request, Order $Order): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse|array { $MailHistories = $this->mailHistoryRepository->findBy(['Order' => $Order]); @@ -209,7 +209,7 @@ public function index(Request $request, Order $Order) * * @return string */ - private function createBody($Order, $twig = 'Mail/order.twig') + private function createBody($Order, $twig = 'Mail/order.twig'): string { $body = ''; try { diff --git a/src/Eccube/Controller/Admin/Order/OrderController.php b/src/Eccube/Controller/Admin/Order/OrderController.php index 997d36afc25..2e23e22eb44 100644 --- a/src/Eccube/Controller/Admin/Order/OrderController.php +++ b/src/Eccube/Controller/Admin/Order/OrderController.php @@ -198,7 +198,7 @@ public function __construct( #[Route('/%eccube_admin_route%/order', name: 'admin_order', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/order/page/{page_no}', name: 'admin_order_page', requirements: ['page_no' => '\d+'], methods: ['GET', 'POST'])] #[Template('@admin/Order/index.twig')] - public function index(Request $request, PaginatorInterface $paginator, $page_no = null) + public function index(Request $request, PaginatorInterface $paginator, $page_no = null): array { $builder = $this->formFactory ->createBuilder(SearchOrderType::class); @@ -339,7 +339,7 @@ public function index(Request $request, PaginatorInterface $paginator, $page_no * @return RedirectResponse */ #[Route('/%eccube_admin_route%/order/bulk_delete', name: 'admin_order_bulk_delete', methods: ['POST'])] - public function bulkDelete(Request $request) + public function bulkDelete(Request $request): RedirectResponse { $this->isTokenValid(); $ids = $request->get('ids'); @@ -367,7 +367,7 @@ public function bulkDelete(Request $request) * @return StreamedResponse */ #[Route('/%eccube_admin_route%/order/export/order', name: 'admin_order_export_order', methods: ['GET'])] - public function exportOrder(Request $request) + public function exportOrder(Request $request): StreamedResponse { $filename = 'order_'.(new \DateTime())->format('YmdHis').'.csv'; $response = $this->exportCsv($request, CsvType::CSV_TYPE_ORDER, $filename); @@ -384,7 +384,7 @@ public function exportOrder(Request $request) * @return StreamedResponse */ #[Route('/%eccube_admin_route%/order/export/shipping', name: 'admin_order_export_shipping', methods: ['GET'])] - public function exportShipping(Request $request) + public function exportShipping(Request $request): StreamedResponse { $filename = 'shipping_'.(new \DateTime())->format('YmdHis').'.csv'; $response = $this->exportCsv($request, CsvType::CSV_TYPE_SHIPPING, $filename); @@ -400,7 +400,7 @@ public function exportShipping(Request $request) * * @return StreamedResponse */ - protected function exportCsv(Request $request, $csvTypeId, $fileName) + protected function exportCsv(Request $request, $csvTypeId, $fileName): StreamedResponse { // タイムアウトを無効にする. set_time_limit(0); @@ -481,7 +481,7 @@ protected function exportCsv(Request $request, $csvTypeId, $fileName) * @return \Symfony\Component\HttpFoundation\JsonResponse */ #[Route('/%eccube_admin_route%/shipping/{id}/order_status', name: 'admin_shipping_update_order_status', requirements: ['id' => '\d+'], methods: ['PUT'])] - public function updateOrderStatus(Request $request, Shipping $Shipping) + public function updateOrderStatus(Request $request, Shipping $Shipping): \Symfony\Component\HttpFoundation\JsonResponse { if (!($request->isXmlHttpRequest() && $this->isTokenValid())) { return $this->json(['status' => 'NG'], 400); @@ -579,7 +579,7 @@ public function updateOrderStatus(Request $request, Shipping $Shipping) * @return Response */ #[Route('/%eccube_admin_route%/shipping/{id}/tracking_number', name: 'admin_shipping_update_tracking_number', requirements: ['id' => '\d+'], methods: ['PUT'])] - public function updateTrackingNumber(Request $request, Shipping $shipping) + public function updateTrackingNumber(Request $request, Shipping $shipping): Response { if (!($request->isXmlHttpRequest() && $this->isTokenValid())) { return $this->json(['status' => 'NG'], 400); @@ -632,7 +632,7 @@ public function updateTrackingNumber(Request $request, Shipping $shipping) */ #[Route('/%eccube_admin_route%/order/export/pdf', name: 'admin_order_export_pdf', methods: ['GET', 'POST'])] #[Template('@admin/Order/order_pdf.twig')] - public function exportPdf(Request $request) + public function exportPdf(Request $request): array|RedirectResponse { // requestから出荷番号IDの一覧を取得する. $ids = $request->get('ids', []); @@ -679,7 +679,7 @@ public function exportPdf(Request $request) */ #[Route('/%eccube_admin_route%/order/export/pdf/download', name: 'admin_order_pdf_download', methods: ['POST'])] #[Template('@admin/Order/order_pdf.twig')] - public function exportPdfDownload(Request $request, OrderPdfService $orderPdfService) + public function exportPdfDownload(Request $request, OrderPdfService $orderPdfService): Response { /** * @var FormBuilder diff --git a/src/Eccube/Controller/Admin/Order/ShippingController.php b/src/Eccube/Controller/Admin/Order/ShippingController.php index 14865413e14..4226fe81f48 100644 --- a/src/Eccube/Controller/Admin/Order/ShippingController.php +++ b/src/Eccube/Controller/Admin/Order/ShippingController.php @@ -134,7 +134,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/shipping/{id}/edit', requirements: ['id' => '\d+'], name: 'admin_shipping_edit', methods: ['GET', 'POST'])] #[Template('@admin/Order/shipping.twig')] - public function index(Request $request, Order $Order) + public function index(Request $request, Order $Order): \Symfony\Component\HttpFoundation\RedirectResponse|array { $OriginOrder = clone $Order; $purchaseContext = new PurchaseContext($OriginOrder, $OriginOrder->getCustomer()); @@ -304,7 +304,7 @@ public function index(Request $request, Order $Order) * @return Response */ #[Route('/%eccube_admin_route%/shipping/preview_notify_mail/{id}', requirements: ['id' => '\d+'], name: 'admin_shipping_preview_notify_mail', methods: ['GET'])] - public function previewShippingNotifyMail(Shipping $Shipping) + public function previewShippingNotifyMail(Shipping $Shipping): Response { return new Response($this->mailService->getShippingNotifyMailBody($Shipping, $Shipping->getOrder(), null, true)); } @@ -315,7 +315,7 @@ public function previewShippingNotifyMail(Shipping $Shipping) * @return JsonResponse */ #[Route('/%eccube_admin_route%/shipping/notify_mail/{id}', name: 'admin_shipping_notify_mail', requirements: ['id' => '\d+'], methods: ['PUT'])] - public function notifyMail(Shipping $Shipping) + public function notifyMail(Shipping $Shipping): JsonResponse { $this->isTokenValid(); diff --git a/src/Eccube/Controller/Admin/Product/CategoryController.php b/src/Eccube/Controller/Admin/Product/CategoryController.php index f8eb689180b..a4402d1c9e8 100644 --- a/src/Eccube/Controller/Admin/Product/CategoryController.php +++ b/src/Eccube/Controller/Admin/Product/CategoryController.php @@ -70,7 +70,7 @@ public function __construct( #[Route('/%eccube_admin_route%/product/category/{parent_id}', name: 'admin_product_category_show', requirements: ['parent_id' => "\d+"], methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/product/category/{id}/edit', name: 'admin_product_category_edit', requirements: ['id' => '\d+'], methods: ['GET', 'POST'])] #[Template('@admin/Product/category.twig')] - public function index(Request $request, CacheUtil $cacheUtil, $parent_id = null, $id = null) + public function index(Request $request, CacheUtil $cacheUtil, $parent_id = null, $id = null): \Symfony\Component\HttpFoundation\RedirectResponse|array { if ($parent_id) { /** @var Category|null $Parent */ @@ -229,7 +229,7 @@ public function index(Request $request, CacheUtil $cacheUtil, $parent_id = null, * @throws \Exception */ #[Route('/%eccube_admin_route%/product/category/{id}/delete', name: 'admin_product_category_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, $id, CacheUtil $cacheUtil) + public function delete(Request $request, $id, CacheUtil $cacheUtil): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -277,12 +277,12 @@ public function delete(Request $request, $id, CacheUtil $cacheUtil) * @param Request $request * @param CacheUtil $cacheUtil * - * @return Response|void + * @return Response * * @throws BadRequestHttpException|\Exception */ #[Route('/%eccube_admin_route%/product/category/sort_no/move', name: 'admin_product_category_sort_no_move', methods: ['POST'])] - public function moveSortNo(Request $request, CacheUtil $cacheUtil) + public function moveSortNo(Request $request, CacheUtil $cacheUtil): Response { if (!$request->isXmlHttpRequest()) { throw new BadRequestHttpException(); @@ -303,6 +303,8 @@ public function moveSortNo(Request $request, CacheUtil $cacheUtil) return new Response('Successful'); } + + throw new BadRequestHttpException(); } /** @@ -313,7 +315,7 @@ public function moveSortNo(Request $request, CacheUtil $cacheUtil) * @return StreamedResponse */ #[Route('/%eccube_admin_route%/product/category/export', name: 'admin_product_category_export', methods: ['GET'])] - public function export(Request $request) + public function export(Request $request): StreamedResponse { // タイムアウトを無効にする. set_time_limit(0); diff --git a/src/Eccube/Controller/Admin/Product/ClassCategoryController.php b/src/Eccube/Controller/Admin/Product/ClassCategoryController.php index 914ce175588..acde29e1cee 100644 --- a/src/Eccube/Controller/Admin/Product/ClassCategoryController.php +++ b/src/Eccube/Controller/Admin/Product/ClassCategoryController.php @@ -85,7 +85,7 @@ public function __construct( #[Route('/%eccube_admin_route%/product/class_category/{class_name_id}', name: 'admin_product_class_category', requirements: ['class_name_id' => '\d+'], methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/product/class_category/{class_name_id}/{id}/edit', name: 'admin_product_class_category_edit', requirements: ['class_name_id' => "\d+", 'id' => "\d+"], methods: ['GET', 'POST'])] #[Template('@admin/Product/class_category.twig')] - public function index(Request $request, $class_name_id, $id = null) + public function index(Request $request, $class_name_id, $id = null): \Symfony\Component\HttpFoundation\RedirectResponse|array { $ClassName = $this->classNameRepository->find($class_name_id); if (!$ClassName) { @@ -183,7 +183,7 @@ public function index(Request $request, $class_name_id, $id = null) * @throws NotFoundHttpException */ #[Route('/%eccube_admin_route%/product/class_category/{class_name_id}/{id}/delete', name: 'admin_product_class_category_delete', requirements: ['class_name_id' => '\d+', 'id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, $class_name_id, $id) + public function delete(Request $request, $class_name_id, $id): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -236,7 +236,7 @@ public function delete(Request $request, $class_name_id, $id) * @throws NotFoundHttpException */ #[Route('/%eccube_admin_route%/product/class_category/{class_name_id}/{id}/visibility', name: 'admin_product_class_category_visibility', requirements: ['class_name_id' => '\d+', 'id' => '\d+'], methods: ['PUT'])] - public function visibility(Request $request, $class_name_id, $id) + public function visibility(Request $request, $class_name_id, $id): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -279,12 +279,12 @@ public function visibility(Request $request, $class_name_id, $id) /** * @param Request $request * - * @return Response|void + * @return Response * * @throws BadRequestHttpException */ #[Route('/%eccube_admin_route%/product/class_category/sort_no/move', name: 'admin_product_class_category_sort_no_move', methods: ['POST'])] - public function moveSortNo(Request $request) + public function moveSortNo(Request $request): Response { if (!$request->isXmlHttpRequest()) { throw new BadRequestHttpException(); @@ -302,6 +302,8 @@ public function moveSortNo(Request $request) return new Response('Successful'); } + + throw new BadRequestHttpException(); } /** @@ -313,7 +315,7 @@ public function moveSortNo(Request $request) * @return StreamedResponse */ #[Route('/%eccube_admin_route%/product/class_category/export/{class_name_id}', name: 'admin_product_class_category_export', requirements: ['class_name_id' => '\d+'], methods: ['GET'])] - public function export(Request $request, $class_name_id) + public function export(Request $request, $class_name_id): StreamedResponse { // タイムアウトを無効にする. set_time_limit(0); diff --git a/src/Eccube/Controller/Admin/Product/ClassNameController.php b/src/Eccube/Controller/Admin/Product/ClassNameController.php index aac1e6d2ce0..11c94d15ea7 100644 --- a/src/Eccube/Controller/Admin/Product/ClassNameController.php +++ b/src/Eccube/Controller/Admin/Product/ClassNameController.php @@ -66,7 +66,7 @@ public function __construct( #[Route('/%eccube_admin_route%/product/class_name', name: 'admin_product_class_name', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/product/class_name/{id}/edit', requirements: ['id' => '\d+'], name: 'admin_product_class_name_edit', methods: ['GET', 'POST'])] #[Template('@admin/Product/class_name.twig')] - public function index(Request $request, $id = null) + public function index(Request $request, $id = null): \Symfony\Component\HttpFoundation\RedirectResponse|array { if ($id) { $TargetClassName = $this->classNameRepository->find($id); @@ -161,7 +161,7 @@ public function index(Request $request, $id = null) * @throws \Exception */ #[Route('/%eccube_admin_route%/product/class_name/{id}/delete', name: 'admin_product_class_name_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, ClassName $ClassName) + public function delete(Request $request, ClassName $ClassName): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -189,14 +189,14 @@ public function delete(Request $request, ClassName $ClassName) /** * @param Request $request * - * @return Response|void + * @return Response * * @throws BadRequestHttpException */ #[Route('/%eccube_admin_route%/product/class_name/sort_no/move', name: 'admin_product_class_name_sort_no_move', methods: ['POST'])] - public function moveSortNo(Request $request) + public function moveSortNo(Request $request): Response { - if (!$request->isXmlHttpRequest() && $this->isTokenValid()) { + if (!$request->isXmlHttpRequest()) { throw new BadRequestHttpException(); } @@ -212,6 +212,8 @@ public function moveSortNo(Request $request) return new Response(); } + + throw new BadRequestHttpException(); } /** @@ -222,7 +224,7 @@ public function moveSortNo(Request $request) * @return StreamedResponse */ #[Route('/%eccube_admin_route%/product/class_name/export', name: 'admin_product_class_name_export', methods: ['GET'])] - public function export(Request $request) + public function export(Request $request): StreamedResponse { // タイムアウトを無効にする. set_time_limit(0); diff --git a/src/Eccube/Controller/Admin/Product/CsvImportController.php b/src/Eccube/Controller/Admin/Product/CsvImportController.php index 42753581c1f..c00fb9491df 100644 --- a/src/Eccube/Controller/Admin/Product/CsvImportController.php +++ b/src/Eccube/Controller/Admin/Product/CsvImportController.php @@ -197,7 +197,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/product/product_csv_upload', name: 'admin_product_csv_import', methods: ['GET', 'POST'])] #[Template('@admin/Product/csv_product.twig')] - public function csvProduct(Request $request, CacheUtil $cacheUtil) + public function csvProduct(Request $request, CacheUtil $cacheUtil): array|JsonResponse { $form = $this->formFactory->createBuilder(CsvImportType::class)->getForm(); $headers = $this->getProductCsvHeader(); @@ -260,7 +260,7 @@ public function csvProduct(Request $request, CacheUtil $cacheUtil) $Product = new Product(); $this->entityManager->persist($Product); } else { - if (preg_match('/^\d+$/', (string) $row[$headerByKey['id']])) { + if (preg_match('/^\d+$/', $row[$headerByKey['id']])) { $Product = $this->productRepository->find($row[$headerByKey['id']]); if (!$Product) { $message = trans('admin.common.csv_invalid_not_found', ['%line%' => $line, '%name%' => $headerByKey['id']]); @@ -299,7 +299,7 @@ public function csvProduct(Request $request, CacheUtil $cacheUtil) $message = trans('admin.common.csv_invalid_required', ['%line%' => $line, '%name%' => $headerByKey['status']]); $this->addErrors($message); } else { - if (preg_match('/^\d+$/', (string) $row[$headerByKey['status']])) { + if (preg_match('/^\d+$/', $row[$headerByKey['status']])) { $ProductStatus = $this->productStatusRepository->find($row[$headerByKey['status']]); if (!$ProductStatus) { $message = trans('admin.common.csv_invalid_not_found', ['%line%' => $line, '%name%' => $headerByKey['status']]); @@ -340,7 +340,7 @@ public function csvProduct(Request $request, CacheUtil $cacheUtil) if (isset($row[$headerByKey['description_detail']])) { if (StringUtil::isNotBlank($row[$headerByKey['description_detail']])) { - if (mb_strlen((string) $row[$headerByKey['description_detail']]) > $this->eccubeConfig['eccube_ltext_len']) { + if (mb_strlen($row[$headerByKey['description_detail']]) > $this->eccubeConfig['eccube_ltext_len']) { $message = trans('admin.common.csv_invalid_description_detail_upper_limit', [ '%line%' => $line, '%name%' => $headerByKey['description_detail'], @@ -452,7 +452,7 @@ public function csvProduct(Request $request, CacheUtil $cacheUtil) // 規格分類1、2をそれぞれセットし作成 $ClassCategory1 = null; - if (preg_match('/^\d+$/', (string) $row[$headerByKey['class_category1']])) { + if (preg_match('/^\d+$/', $row[$headerByKey['class_category1']])) { $ClassCategory1 = $this->classCategoryRepository->find($row[$headerByKey['class_category1']]); if (!$ClassCategory1) { $message = trans('admin.common.csv_invalid_not_found', ['%line%' => $line, '%name%' => $headerByKey['class_category1']]); @@ -466,7 +466,7 @@ public function csvProduct(Request $request, CacheUtil $cacheUtil) } if (isset($row[$headerByKey['class_category2']]) && StringUtil::isNotBlank($row[$headerByKey['class_category2']])) { - if (preg_match('/^\d+$/', (string) $row[$headerByKey['class_category2']])) { + if (preg_match('/^\d+$/', $row[$headerByKey['class_category2']])) { $ClassCategory2 = $this->classCategoryRepository->find($row[$headerByKey['class_category2']]); if (!$ClassCategory2) { $message = trans('admin.common.csv_invalid_not_found', ['%line%' => $line, '%name%' => $headerByKey['class_category2']]); @@ -720,7 +720,7 @@ public function csvProduct(Request $request, CacheUtil $cacheUtil) */ #[Route('/%eccube_admin_route%/product/category_csv_upload', name: 'admin_product_category_csv_import', methods: ['GET', 'POST'])] #[Template('@admin/Product/csv_category.twig')] - public function csvCategory(Request $request, CacheUtil $cacheUtil) + public function csvCategory(Request $request, CacheUtil $cacheUtil): array|JsonResponse { $form = $this->formFactory->createBuilder(CsvImportType::class)->getForm(); @@ -766,8 +766,8 @@ public function csvCategory(Request $request, CacheUtil $cacheUtil) foreach ($data as $row) { /** @var Category $Category */ $Category = new Category(); - if (isset($row[$headerByKey['id']]) && strlen((string) $row[$headerByKey['id']]) > 0) { - if (!preg_match('/^\d+$/', (string) $row[$headerByKey['id']])) { + if (isset($row[$headerByKey['id']]) && strlen($row[$headerByKey['id']]) > 0) { + if (!preg_match('/^\d+$/', $row[$headerByKey['id']])) { $this->addErrors(($data->key() + 1).'行目のカテゴリIDが存在しません。'); return $this->renderWithError($form, $headers); @@ -815,7 +815,7 @@ public function csvCategory(Request $request, CacheUtil $cacheUtil) $ParentCategory = null; if (isset($row[$headerByKey['parent_category_id']]) && StringUtil::isNotBlank($row[$headerByKey['parent_category_id']])) { - if (!preg_match('/^\d+$/', (string) $row[$headerByKey['parent_category_id']])) { + if (!preg_match('/^\d+$/', $row[$headerByKey['parent_category_id']])) { $this->addErrors(($data->key() + 1).'行目の親カテゴリIDは数字で入力してください。'); return $this->renderWithError($form, $headers); @@ -886,7 +886,7 @@ public function csvCategory(Request $request, CacheUtil $cacheUtil) */ #[Route('/%eccube_admin_route%/product/class_name_csv_upload', name: 'admin_product_class_name_csv_import', methods: ['GET', 'POST'])] #[Template('@admin/Product/csv_class_name.twig')] - public function csvClassName(Request $request, CacheUtil $cacheUtil) + public function csvClassName(Request $request, CacheUtil $cacheUtil): array|JsonResponse { $form = $this->formFactory->createBuilder(CsvImportType::class)->getForm(); @@ -933,8 +933,8 @@ public function csvClassName(Request $request, CacheUtil $cacheUtil) // dump($row,$headerByKey);exit; /** @var ClassName $ClassName */ $ClassName = new ClassName(); - if (isset($row[$headerByKey['id']]) && strlen((string) $row[$headerByKey['id']]) > 0) { - if (!preg_match('/^\d+$/', (string) $row[$headerByKey['id']])) { + if (isset($row[$headerByKey['id']]) && strlen($row[$headerByKey['id']]) > 0) { + if (!preg_match('/^\d+$/', $row[$headerByKey['id']])) { $this->addErrors(($data->key() + 1).'行目の規格IDが存在しません。'); return $this->renderWithError($form, $headers); @@ -1009,7 +1009,7 @@ public function csvClassName(Request $request, CacheUtil $cacheUtil) */ #[Route('/%eccube_admin_route%/product/class_category_csv_upload', name: 'admin_product_class_category_csv_import', methods: ['GET', 'POST'])] #[Template('@admin/Product/csv_class_category.twig')] - public function csvClassCategory(Request $request, CacheUtil $cacheUtil) + public function csvClassCategory(Request $request, CacheUtil $cacheUtil): array|JsonResponse { $form = $this->formFactory->createBuilder(CsvImportType::class)->getForm(); @@ -1057,8 +1057,8 @@ public function csvClassCategory(Request $request, CacheUtil $cacheUtil) /** @var ClassCategory $ClassCategory */ $ClassCategory = new ClassCategory(); - if (isset($row[$headerByKey['id']]) && strlen((string) $row[$headerByKey['id']]) > 0) { - if (!preg_match('/^\d+$/', (string) $row[$headerByKey['id']])) { + if (isset($row[$headerByKey['id']]) && strlen($row[$headerByKey['id']]) > 0) { + if (!preg_match('/^\d+$/', $row[$headerByKey['id']])) { $this->addErrors(($data->key() + 1).'行目の規格分類IDが存在しません。'); return $this->renderWithError($form, $headers); @@ -1071,8 +1071,8 @@ public function csvClassCategory(Request $request, CacheUtil $cacheUtil) } } - if (isset($row[$headerByKey['class_name_id']]) && strlen((string) $row[$headerByKey['class_name_id']]) > 0) { - if (!preg_match('/^\d+$/', (string) $row[$headerByKey['class_name_id']])) { + if (isset($row[$headerByKey['class_name_id']]) && strlen($row[$headerByKey['class_name_id']]) > 0) { + if (!preg_match('/^\d+$/', $row[$headerByKey['class_name_id']])) { $this->addErrors(($data->key() + 1).'行目の規格IDが存在しません。'); return $this->renderWithError($form, $headers); @@ -1149,7 +1149,7 @@ public function csvClassCategory(Request $request, CacheUtil $cacheUtil) * @throws NotFoundHttpException */ #[Route('/%eccube_admin_route%/product/csv_template/{type}', name: 'admin_product_csv_template', requirements: ['type' => '\w+'], methods: ['GET'])] - public function csvTemplate(Request $request, $type) + public function csvTemplate(Request $request, $type): StreamedResponse { if ($type == 'product') { $headers = $this->getProductCsvHeader(); @@ -1181,7 +1181,7 @@ public function csvTemplate(Request $request, $type) * * @throws \Doctrine\DBAL\ConnectionException|\Doctrine\DBAL\Exception */ - protected function renderWithError($form, $headers, $rollback = true) + protected function renderWithError($form, $headers, $rollback = true): JsonResponse|array { if ($this->hasErrors()) { if ($rollback) { @@ -1220,7 +1220,7 @@ protected function renderWithError($form, $headers, $rollback = true) * * @return void */ - protected function createProductImage($row, Product $Product, $data, $headerByKey) + protected function createProductImage($row, Product $Product, $data, $headerByKey): void { if (!isset($row[$headerByKey['product_image']])) { return; @@ -1273,7 +1273,7 @@ protected function createProductImage($row, Product $Product, $data, $headerByKe * * @return void */ - protected function createProductCategory($row, Product $Product, $data, $headerByKey) + protected function createProductCategory($row, Product $Product, $data, $headerByKey): void { if (!isset($row[$headerByKey['product_category']])) { return; @@ -1343,7 +1343,7 @@ protected function createProductCategory($row, Product $Product, $data, $headerB * * @return void */ - protected function createProductTag($row, Product $Product, $data, $headerByKey) + protected function createProductTag($row, Product $Product, $data, $headerByKey): void { if (!isset($row[$headerByKey['product_tag']])) { return; @@ -1393,12 +1393,12 @@ protected function createProductTag($row, Product $Product, $data, $headerByKey) * @param Product $Product * @param CsvImportService $data * @param array $headerByKey - * @param null $ClassCategory1 - * @param null $ClassCategory2 + * @param ClassCategory|null $ClassCategory1 + * @param ClassCategory|null $ClassCategory2 * * @return ProductClass */ - protected function createProductClass($row, Product $Product, $data, $headerByKey, $ClassCategory1 = null, $ClassCategory2 = null) + protected function createProductClass($row, Product $Product, $data, $headerByKey, $ClassCategory1 = null, $ClassCategory2 = null): ProductClass { // 規格分類1、規格分類2がnullとなる商品を作成 $ProductClass = new ProductClass(); @@ -1554,7 +1554,7 @@ protected function createProductClass($row, Product $Product, $data, $headerByKe * * @return ProductClass */ - protected function updateProductClass($row, Product $Product, ProductClass $ProductClass, $data, $headerByKey) + protected function updateProductClass($row, Product $Product, ProductClass $ProductClass, $data, $headerByKey): ProductClass { $ProductClass->setProduct($Product); @@ -1731,7 +1731,7 @@ protected function updateProductClass($row, Product $Product, ProductClass $Prod * * @return void */ - protected function addErrors($message) + protected function addErrors($message): void { $this->errors[] = $message; } @@ -1739,7 +1739,7 @@ protected function addErrors($message) /** * @return string[] */ - protected function getErrors() + protected function getErrors(): array { return $this->errors; } @@ -1747,7 +1747,7 @@ protected function getErrors() /** * @return bool */ - protected function hasErrors() + protected function hasErrors(): bool { return count($this->getErrors()) > 0; } @@ -1757,7 +1757,7 @@ protected function hasErrors() * * @return array> */ - protected function getProductCsvHeader() + protected function getProductCsvHeader(): array { return [ trans('admin.product.product_csv.product_id_col') => [ @@ -1893,7 +1893,7 @@ protected function getProductCsvHeader() * * @return array> */ - protected function getCategoryCsvHeader() + protected function getCategoryCsvHeader(): array { return [ trans('admin.product.category_csv.category_id_col') => [ @@ -1924,7 +1924,7 @@ protected function getCategoryCsvHeader() * * @return array> */ - protected function getClassNameCsvHeader() + protected function getClassNameCsvHeader(): array { return [ trans('admin.product.class_name_csv.class_name_id_col') => [ @@ -1955,7 +1955,7 @@ protected function getClassNameCsvHeader() * * @return array> */ - protected function getClassCategoryCsvHeader() + protected function getClassCategoryCsvHeader(): array { return [ trans('admin.product.class_category_csv.class_name_id_col') => [ @@ -1995,7 +1995,7 @@ protected function getClassCategoryCsvHeader() * * @return ProductCategory */ - private function makeProductCategory($Product, $Category, $sortNo) + private function makeProductCategory($Product, $Category, $sortNo): ProductCategory { $ProductCategory = new ProductCategory(); $ProductCategory->setProduct($Product); @@ -2012,7 +2012,7 @@ private function makeProductCategory($Product, $Category, $sortNo) * @return JsonResponse */ #[Route('/%eccube_admin_route%/product/csv_split', name: 'admin_product_csv_split', methods: ['POST'])] - public function splitCsv(Request $request) + public function splitCsv(Request $request): JsonResponse { $this->isTokenValid(); @@ -2078,7 +2078,7 @@ public function splitCsv(Request $request) * @return \Symfony\Component\HttpFoundation\Response */ #[Route('/%eccube_admin_route%/product/csv_split_import', name: 'admin_product_csv_split_import', methods: ['POST'])] - public function importCsv(Request $request, CsrfTokenManagerInterface $tokenManager) + public function importCsv(Request $request, CsrfTokenManagerInterface $tokenManager): \Symfony\Component\HttpFoundation\Response { $this->isTokenValid(); @@ -2118,7 +2118,7 @@ public function importCsv(Request $request, CsrfTokenManagerInterface $tokenMana * @return JsonResponse */ #[Route('/%eccube_admin_route%/product/csv_split_cleanup', name: 'admin_product_csv_split_cleanup', methods: ['POST'])] - public function cleanupSplitCsv(Request $request) + public function cleanupSplitCsv(Request $request): JsonResponse { $this->isTokenValid(); @@ -2143,7 +2143,7 @@ public function cleanupSplitCsv(Request $request) /** * @return array */ - protected function getCsvTempFiles() + protected function getCsvTempFiles(): array { $files = Finder::create() ->in($this->eccubeConfig['eccube_csv_temp_realdir']) @@ -2163,7 +2163,7 @@ protected function getCsvTempFiles() * * @return float|int */ - protected function convertLineNo($currentLineNo) + protected function convertLineNo($currentLineNo): float|int { if ($this->isSplitCsv) { return $this->eccubeConfig['eccube_csv_split_lines'] * ($this->csvFileNo - 1) + $currentLineNo; diff --git a/src/Eccube/Controller/Admin/Product/ProductClassController.php b/src/Eccube/Controller/Admin/Product/ProductClassController.php index f0a242fc3e3..1417b870fc0 100644 --- a/src/Eccube/Controller/Admin/Product/ProductClassController.php +++ b/src/Eccube/Controller/Admin/Product/ProductClassController.php @@ -94,7 +94,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/product/product/class/{id}', name: 'admin_product_product_class', requirements: ['id' => '\d+'], methods: ['GET', 'POST'])] #[Template('@admin/Product/product_class.twig')] - public function index(Request $request, $id, CacheUtil $cacheUtil) + public function index(Request $request, $id, CacheUtil $cacheUtil): \Symfony\Component\HttpFoundation\RedirectResponse|array { $Product = $this->findProduct($id); if (!$Product) { @@ -209,7 +209,7 @@ public function index(Request $request, $id, CacheUtil $cacheUtil) * @throws ForeignKeyConstraintViolationException|\Exception */ #[Route('/%eccube_admin_route%/product/product/class/{id}/clear', requirements: ['id' => '\d+'], name: 'admin_product_product_class_clear', methods: ['POST'])] - public function clearProductClasses(Request $request, Product $Product, CacheUtil $cacheUtil) + public function clearProductClasses(Request $request, Product $Product, CacheUtil $cacheUtil): \Symfony\Component\HttpFoundation\RedirectResponse { if (!$Product->hasProductClass()) { return $this->redirectToRoute('admin_product_product_class', ['id' => $Product->getId()]); @@ -268,7 +268,7 @@ public function clearProductClasses(Request $request, Product $Product, CacheUti * * @return array|ProductClass[] */ - protected function createProductClasses(ClassName $ClassName1, ?ClassName $ClassName2 = null) + protected function createProductClasses(ClassName $ClassName1, ?ClassName $ClassName2 = null): array { $ProductClasses = []; $ClassCategories1 = $this->classCategoryRepository->findBy(['ClassName' => $ClassName1], ['sort_no' => 'DESC']); @@ -305,7 +305,7 @@ protected function createProductClasses(ClassName $ClassName1, ?ClassName $Class * * @return array|ProductClass[] */ - protected function mergeProductClasses($ProductClassesForMatrix, $ProductClasses) + protected function mergeProductClasses($ProductClassesForMatrix, $ProductClasses): array { $mergedProductClasses = []; foreach ($ProductClassesForMatrix as $pcfm) { @@ -342,7 +342,7 @@ protected function mergeProductClasses($ProductClassesForMatrix, $ProductClasses * * @throws NoResultException */ - protected function saveProductClasses(Product $Product, $ProductClasses = []) + protected function saveProductClasses(Product $Product, $ProductClasses = []): void { foreach ($ProductClasses as $pc) { // 新規登録時、チェックを入れていなければ更新しない @@ -464,7 +464,7 @@ protected function createMatrixForm( * * @throws \Doctrine\ORM\NonUniqueResultException */ - protected function findProduct($id) + protected function findProduct($id): ?Product { $qb = $this->productRepository->createQueryBuilder('p') ->addSelect(['pc', 'cc1', 'cc2']) diff --git a/src/Eccube/Controller/Admin/Product/ProductController.php b/src/Eccube/Controller/Admin/Product/ProductController.php index 4d0c49e106f..32bb6264264 100644 --- a/src/Eccube/Controller/Admin/Product/ProductController.php +++ b/src/Eccube/Controller/Admin/Product/ProductController.php @@ -157,7 +157,7 @@ public function __construct( #[Route('/%eccube_admin_route%/product', name: 'admin_product', methods: ['POST', 'GET'])] #[Route('/%eccube_admin_route%/product/page/{page_no}', name: 'admin_product_page', requirements: ['page_no' => '\d+'], methods: ['POST', 'GET'])] #[Template('@admin/Product/index.twig')] - public function index(Request $request, PaginatorInterface $paginator, $page_no = null) + public function index(Request $request, PaginatorInterface $paginator, $page_no = null): array { $builder = $this->formFactory ->createBuilder(SearchProductType::class); @@ -298,7 +298,7 @@ public function index(Request $request, PaginatorInterface $paginator, $page_no */ #[Route('/%eccube_admin_route%/product/classes/{id}/load', name: 'admin_product_classes_load', requirements: ['id' => '\d+'], methods: ['GET'])] #[Template('@admin/Product/product_class_popup.twig')] - public function loadProductClasses(Request $request, #[MapEntity(expr: 'repository.findWithSortedClassCategories(id)')] ?Product $Product) + public function loadProductClasses(Request $request, #[MapEntity(expr: 'repository.findWithSortedClassCategories(id)')] ?Product $Product): array { if (!$request->isXmlHttpRequest() && $this->isTokenValid()) { throw new BadRequestHttpException(); @@ -334,7 +334,7 @@ public function loadProductClasses(Request $request, #[MapEntity(expr: 'reposito * @throws BadRequestHttpException|UnsupportedMediaTypeHttpException */ #[Route('/%eccube_admin_route%/product/product/image/process', name: 'admin_product_image_process', methods: ['POST'])] - public function imageProcess(Request $request) + public function imageProcess(Request $request): Response { if (!$request->isXmlHttpRequest() && $this->isTokenValid()) { throw new BadRequestHttpException(); @@ -391,7 +391,7 @@ public function imageProcess(Request $request) * @throws BadRequestHttpException|NotFoundHttpException */ #[Route('/%eccube_admin_route%/product/product/image/load', name: 'admin_product_image_load', methods: ['GET'])] - public function imageLoad(Request $request) + public function imageLoad(Request $request): \Symfony\Component\HttpFoundation\BinaryFileResponse { if (!$request->isXmlHttpRequest()) { throw new BadRequestHttpException(); @@ -431,7 +431,7 @@ public function imageLoad(Request $request) * @throws BadRequestHttpException|NotFoundHttpException */ #[Route('/%eccube_admin_route%/product/product/image/revert', name: 'admin_product_image_revert', methods: ['DELETE'])] - public function imageRevert(Request $request) + public function imageRevert(Request $request): Response { if (!$request->isXmlHttpRequest() && $this->isTokenValid()) { throw new BadRequestHttpException(); @@ -461,7 +461,7 @@ public function imageRevert(Request $request) #[Route('/%eccube_admin_route%/product/product/new', name: 'admin_product_product_new', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/product/product/{id}/edit', requirements: ['id' => '\d+'], name: 'admin_product_product_edit', methods: ['GET', 'POST'])] #[Template('@admin/Product/product.twig')] - public function edit(Request $request, RouterInterface $router, CacheUtil $cacheUtil, $id = null) + public function edit(Request $request, RouterInterface $router, CacheUtil $cacheUtil, $id = null): RedirectResponse|array { $has_class = false; if (is_null($id)) { @@ -800,7 +800,7 @@ public function edit(Request $request, RouterInterface $router, CacheUtil $cache * @throws \Exception */ #[Route('/%eccube_admin_route%/product/product/{id}/delete', name: 'admin_product_product_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, CacheUtil $cacheUtil, $id = null) + public function delete(Request $request, CacheUtil $cacheUtil, $id = null): RedirectResponse|\Symfony\Component\HttpFoundation\JsonResponse { $this->isTokenValid(); $session = $request->getSession(); @@ -897,7 +897,7 @@ public function delete(Request $request, CacheUtil $cacheUtil, $id = null) * @throws \Exception */ #[Route('/%eccube_admin_route%/product/product/{id}/copy', requirements: ['id' => '\d+'], name: 'admin_product_product_copy', methods: ['POST'])] - public function copy(Request $request, $id = null) + public function copy(Request $request, $id = null): RedirectResponse { $this->isTokenValid(); @@ -1002,7 +1002,7 @@ public function copy(Request $request, $id = null) * @return StreamedResponse */ #[Route('/%eccube_admin_route%/product/export', name: 'admin_product_export', methods: ['GET'])] - public function export(Request $request) + public function export(Request $request): StreamedResponse { // タイムアウトを無効にする. set_time_limit(0); @@ -1110,7 +1110,7 @@ public function export(Request $request) * * @return ProductCategory */ - private function createProductCategory($Product, $Category, $count) + private function createProductCategory($Product, $Category, $count): ProductCategory { $ProductCategory = new ProductCategory(); $ProductCategory->setProduct($Product); @@ -1131,7 +1131,7 @@ private function createProductCategory($Product, $Category, $count) * @return RedirectResponse */ #[Route('/%eccube_admin_route%/product/bulk/product-status/{id}', requirements: ['id' => '\d+'], name: 'admin_product_bulk_product_status', methods: ['POST'])] - public function bulkProductStatus(Request $request, ProductStatus $ProductStatus, CacheUtil $cacheUtil) + public function bulkProductStatus(Request $request, ProductStatus $ProductStatus, CacheUtil $cacheUtil): RedirectResponse { $this->isTokenValid(); diff --git a/src/Eccube/Controller/Admin/Product/TagController.php b/src/Eccube/Controller/Admin/Product/TagController.php index 4d95478d25e..63010c2dd47 100644 --- a/src/Eccube/Controller/Admin/Product/TagController.php +++ b/src/Eccube/Controller/Admin/Product/TagController.php @@ -44,7 +44,7 @@ public function __construct(TagRepository $tagRepository) */ #[Route('/%eccube_admin_route%/product/tag', name: 'admin_product_tag', methods: ['GET', 'POST'])] #[Template('@admin/Product/tag.twig')] - public function index(Request $request) + public function index(Request $request): array|\Symfony\Component\HttpFoundation\RedirectResponse { $Tag = new Tag(); $Tags = $this->tagRepository->getList(); @@ -131,7 +131,7 @@ public function index(Request $request) * @throws \Exception */ #[Route('/%eccube_admin_route%/product/tag/{id}/delete', name: 'admin_product_tag_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, Tag $Tag) + public function delete(Request $request, Tag $Tag): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -166,7 +166,7 @@ public function delete(Request $request, Tag $Tag) * @return Response */ #[Route('/%eccube_admin_route%/product/tag/sort_no/move', name: 'admin_product_tag_sort_no_move', methods: ['POST'])] - public function moveSortNo(Request $request) + public function moveSortNo(Request $request): Response { if ($request->isXmlHttpRequest() && $this->isTokenValid()) { $sortNos = $request->request->all(); @@ -190,7 +190,7 @@ public function moveSortNo(Request $request) * * @return void */ - protected function dispatchComplete(Request $request, FormInterface $form, Tag $Tag) + protected function dispatchComplete(Request $request, FormInterface $form, Tag $Tag): void { $event = new EventArgs( [ diff --git a/src/Eccube/Controller/Admin/Setting/Shop/CalendarController.php b/src/Eccube/Controller/Admin/Setting/Shop/CalendarController.php index 9f8d50f7917..ae8193db06c 100644 --- a/src/Eccube/Controller/Admin/Setting/Shop/CalendarController.php +++ b/src/Eccube/Controller/Admin/Setting/Shop/CalendarController.php @@ -51,7 +51,7 @@ public function __construct(CalendarRepository $calendarRepository) #[Route('/%eccube_admin_route%/setting/shop/calendar', name: 'admin_setting_shop_calendar', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/setting/shop/calendar/new', name: 'admin_setting_shop_calendar_new', methods: ['GET', 'POST'])] #[Template('@admin/Setting/Shop/calendar.twig')] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array { $Calendar = new Calendar(); $builder = $this->formFactory @@ -127,7 +127,7 @@ public function index(Request $request) * @throws \Doctrine\ORM\NoResultException|\Doctrine\ORM\ORMException */ #[Route('/%eccube_admin_route%/setting/shop/calendar/{id}/delete', name: 'admin_setting_shop_calendar_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, Calendar $Calendar) + public function delete(Request $request, Calendar $Calendar): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); $this->calendarRepository->delete($Calendar); diff --git a/src/Eccube/Controller/Admin/Setting/Shop/CsvController.php b/src/Eccube/Controller/Admin/Setting/Shop/CsvController.php index c59de09472c..a4be9855a8b 100644 --- a/src/Eccube/Controller/Admin/Setting/Shop/CsvController.php +++ b/src/Eccube/Controller/Admin/Setting/Shop/CsvController.php @@ -60,7 +60,7 @@ public function __construct(CsvRepository $csvRepository, CsvTypeRepository $csv */ #[Route('/%eccube_admin_route%/setting/shop/csv/{id}', name: 'admin_setting_shop_csv', requirements: ['id' => '\d+'], defaults: ['id' => CsvType::CSV_TYPE_ORDER], methods: ['GET', 'POST'])] #[Template('@admin/Setting/Shop/csv.twig')] - public function index(Request $request, CsvType $CsvType) + public function index(Request $request, CsvType $CsvType): \Symfony\Component\HttpFoundation\RedirectResponse|array { $builder = $this->createFormBuilder(); diff --git a/src/Eccube/Controller/Admin/Setting/Shop/DeliveryController.php b/src/Eccube/Controller/Admin/Setting/Shop/DeliveryController.php index 40865f105cc..24c9ec8e648 100644 --- a/src/Eccube/Controller/Admin/Setting/Shop/DeliveryController.php +++ b/src/Eccube/Controller/Admin/Setting/Shop/DeliveryController.php @@ -97,7 +97,7 @@ public function __construct(PaymentOptionRepository $paymentOptionRepository, De */ #[Route('/%eccube_admin_route%/setting/shop/delivery', name: 'admin_setting_shop_delivery', methods: ['GET'])] #[Template('@admin/Setting/Shop/delivery.twig')] - public function index(Request $request) + public function index(Request $request): array { $Deliveries = $this->deliveryRepository ->findBy([], ['sort_no' => 'DESC']); @@ -127,7 +127,7 @@ public function index(Request $request) #[Route('/%eccube_admin_route%/setting/shop/delivery/new', name: 'admin_setting_shop_delivery_new', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/setting/shop/delivery/{id}/edit', requirements: ['id' => '\d+'], name: 'admin_setting_shop_delivery_edit', methods: ['GET', 'POST'])] #[Template('@admin/Setting/Shop/delivery_edit.twig')] - public function edit(Request $request, EccubeExtension $extension, $id = null) + public function edit(Request $request, EccubeExtension $extension, $id = null): \Symfony\Component\HttpFoundation\RedirectResponse|array { if (is_null($id)) { $SaleType = $this->saleTypeRepository->findOneBy([], ['sort_no' => 'ASC']); @@ -306,7 +306,7 @@ public function edit(Request $request, EccubeExtension $extension, $id = null) * @return \Symfony\Component\HttpFoundation\RedirectResponse */ #[Route('/%eccube_admin_route%/setting/shop/delivery/{id}/delete', name: 'admin_setting_shop_delivery_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, Delivery $Delivery) + public function delete(Request $request, Delivery $Delivery): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -353,7 +353,7 @@ public function delete(Request $request, Delivery $Delivery) * @return \Symfony\Component\HttpFoundation\RedirectResponse */ #[Route('/%eccube_admin_route%/setting/shop/delivery/{id}/visibility', name: 'admin_setting_shop_delivery_visibility', requirements: ['id' => '\d+'], methods: ['PUT'])] - public function visibility(Request $request, Delivery $Delivery) + public function visibility(Request $request, Delivery $Delivery): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -390,7 +390,7 @@ public function visibility(Request $request, Delivery $Delivery) * @throws BadRequestHttpException */ #[Route('/%eccube_admin_route%/setting/shop/delivery/sort_no/move', name: 'admin_setting_shop_delivery_sort_no_move', methods: ['POST'])] - public function moveSortNo(Request $request) + public function moveSortNo(Request $request): \Symfony\Component\HttpFoundation\JsonResponse { if (!$request->isXmlHttpRequest()) { throw new BadRequestHttpException(); @@ -416,7 +416,7 @@ public function moveSortNo(Request $request) * * @return array> */ - private function getMergeRules(array $PaymentsData) + private function getMergeRules(array $PaymentsData): array { // 手数料抜きの利用条件の一覧を作成 $rules = array_map(function (Payment $Payment) { diff --git a/src/Eccube/Controller/Admin/Setting/Shop/MailController.php b/src/Eccube/Controller/Admin/Setting/Shop/MailController.php index 6b19362ac25..93216d3f539 100644 --- a/src/Eccube/Controller/Admin/Setting/Shop/MailController.php +++ b/src/Eccube/Controller/Admin/Setting/Shop/MailController.php @@ -62,7 +62,7 @@ public function __construct(MailTemplateRepository $mailTemplateRepository) #[Route('/%eccube_admin_route%/setting/shop/mail', name: 'admin_setting_shop_mail', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/setting/shop/mail/{id}', requirements: ['id' => '\d+'], name: 'admin_setting_shop_mail_edit', methods: ['GET', 'POST'])] #[Template('@admin/Setting/Shop/mail.twig')] - public function index(Request $request, Environment $twig, CacheUtil $cacheUtil, ?MailTemplate $Mail = null) + public function index(Request $request, Environment $twig, CacheUtil $cacheUtil, ?MailTemplate $Mail = null): RedirectResponse|array { $Mail ??= new MailTemplate(); $builder = $this->formFactory @@ -168,7 +168,7 @@ public function index(Request $request, Environment $twig, CacheUtil $cacheUtil, */ #[Route('/%eccube_admin_route%/setting/shop/mail/preview', name: 'admin_setting_shop_mail_preview', methods: ['POST'])] #[Template('@admin/Setting/Shop/mail_view.twig')] - public function preview(Request $request) + public function preview(Request $request): array { if (!$request->isXmlHttpRequest() && $this->isTokenValid()) { throw new BadRequestHttpException(); @@ -196,7 +196,7 @@ public function preview(Request $request) * @return RedirectResponse */ #[Route('/%eccube_admin_route%/setting/shop/mail/{id}/delete', name: 'admin_setting_shop_mail_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, MailTemplate $Mail) + public function delete(Request $request, MailTemplate $Mail): RedirectResponse { $this->isTokenValid(); @@ -234,7 +234,7 @@ public function delete(Request $request, MailTemplate $Mail) * * @return string */ - protected function getHtmlFileName($fileName) + protected function getHtmlFileName($fileName): string { // HTMLテンプレートファイルの取得 $targetTemplate = pathinfo($fileName); @@ -250,7 +250,7 @@ protected function getHtmlFileName($fileName) * * @return bool */ - protected function validateFilePath($path) + protected function validateFilePath($path): bool { $templatePath = realpath($this->getParameter('eccube_theme_front_dir')); $path = realpath($path); diff --git a/src/Eccube/Controller/Admin/Setting/Shop/OrderStatusController.php b/src/Eccube/Controller/Admin/Setting/Shop/OrderStatusController.php index 55e88f12615..1dbe33d18b7 100644 --- a/src/Eccube/Controller/Admin/Setting/Shop/OrderStatusController.php +++ b/src/Eccube/Controller/Admin/Setting/Shop/OrderStatusController.php @@ -59,7 +59,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/setting/shop/order_status', name: 'admin_setting_shop_order_status', methods: ['GET', 'POST'])] #[Template('@admin/Setting/Shop/order_status.twig')] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array { $OrderStatuses = $this->orderStatusRepository->findBy([], ['sort_no' => 'ASC']); $builder = $this->formFactory->createBuilder(); diff --git a/src/Eccube/Controller/Admin/Setting/Shop/PaymentController.php b/src/Eccube/Controller/Admin/Setting/Shop/PaymentController.php index d636d6befeb..388f19489a5 100644 --- a/src/Eccube/Controller/Admin/Setting/Shop/PaymentController.php +++ b/src/Eccube/Controller/Admin/Setting/Shop/PaymentController.php @@ -57,7 +57,7 @@ public function __construct(PaymentRepository $paymentRepository) */ #[Route('/%eccube_admin_route%/setting/shop/payment', name: 'admin_setting_shop_payment', methods: ['GET'])] #[Template('@admin/Setting/Shop/payment.twig')] - public function index(Request $request) + public function index(Request $request): array { $Payments = $this->paymentRepository ->findBy( @@ -87,7 +87,7 @@ public function index(Request $request) #[Route('/%eccube_admin_route%/setting/shop/payment/new', name: 'admin_setting_shop_payment_new', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/setting/shop/payment/{id}/edit', requirements: ['id' => '\d+'], name: 'admin_setting_shop_payment_edit', methods: ['GET', 'POST'])] #[Template('@admin/Setting/Shop/payment_edit.twig')] - public function edit(Request $request, ?Payment $Payment = null) + public function edit(Request $request, ?Payment $Payment = null): \Symfony\Component\HttpFoundation\RedirectResponse|array { if (is_null($Payment)) { $Payment = $this->paymentRepository->findOneBy([], ['sort_no' => 'DESC']); @@ -178,7 +178,7 @@ public function edit(Request $request, ?Payment $Payment = null) * @throws BadRequestHttpException|UnsupportedMediaTypeHttpException */ #[Route('/%eccube_admin_route%/setting/shop/payment/image/process', name: 'admin_payment_image_process', methods: ['POST'])] - public function imageProcess(Request $request) + public function imageProcess(Request $request): Response { if (!$request->isXmlHttpRequest() && $this->isTokenValid()) { throw new BadRequestHttpException(); @@ -232,7 +232,7 @@ public function imageProcess(Request $request) * @throws BadRequestHttpException|NotFoundHttpException */ #[Route('/%eccube_admin_route%/setting/shop/payment/image/load', name: 'admin_payment_image_load', methods: ['GET'])] - public function imageLoad(Request $request) + public function imageLoad(Request $request): \Symfony\Component\HttpFoundation\BinaryFileResponse { if (!$request->isXmlHttpRequest()) { throw new BadRequestHttpException(); @@ -269,7 +269,7 @@ public function imageLoad(Request $request) * @throws BadRequestHttpException|NotFoundHttpException */ #[Route('/%eccube_admin_route%/setting/shop/payment/image/revert', name: 'admin_payment_image_revert', methods: ['DELETE'])] - public function imageRevert(Request $request) + public function imageRevert(Request $request): Response { if (!$request->isXmlHttpRequest() && $this->isTokenValid()) { throw new BadRequestHttpException(); @@ -293,7 +293,7 @@ public function imageRevert(Request $request) * @return \Symfony\Component\HttpFoundation\RedirectResponse */ #[Route('/%eccube_admin_route%/setting/shop/payment/{id}/delete', name: 'admin_setting_shop_payment_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, Payment $TargetPayment) + public function delete(Request $request, Payment $TargetPayment): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -332,7 +332,7 @@ public function delete(Request $request, Payment $TargetPayment) * @return \Symfony\Component\HttpFoundation\RedirectResponse */ #[Route('/%eccube_admin_route%/setting/shop/payment/{id}/visible', name: 'admin_setting_shop_payment_visible', requirements: ['id' => '\d+'], methods: ['PUT'])] - public function visible(Payment $Payment) + public function visible(Payment $Payment): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -357,7 +357,7 @@ public function visible(Payment $Payment) * @throws BadRequestHttpException */ #[Route('/%eccube_admin_route%/setting/shop/payment/sort_no/move', name: 'admin_setting_shop_payment_sort_no_move', methods: ['POST'])] - public function moveSortNo(Request $request) + public function moveSortNo(Request $request): Response { if (!$request->isXmlHttpRequest()) { throw new BadRequestHttpException(); diff --git a/src/Eccube/Controller/Admin/Setting/Shop/ShopController.php b/src/Eccube/Controller/Admin/Setting/Shop/ShopController.php index 1cfc0a85579..0bdb68d1098 100644 --- a/src/Eccube/Controller/Admin/Setting/Shop/ShopController.php +++ b/src/Eccube/Controller/Admin/Setting/Shop/ShopController.php @@ -61,7 +61,7 @@ public function __construct(Environment $twig, BaseInfoRepository $baseInfoRepos */ #[Route('/%eccube_admin_route%/setting/shop', name: 'admin_setting_shop', methods: ['GET', 'POST'])] #[Template('@admin/Setting/Shop/shop_master.twig')] - public function index(Request $request, CacheUtil $cacheUtil) + public function index(Request $request, CacheUtil $cacheUtil): array|\Symfony\Component\HttpFoundation\RedirectResponse { $BaseInfo = $this->baseInfoRepository->get(); $builder = $this->formFactory diff --git a/src/Eccube/Controller/Admin/Setting/Shop/TaxRuleController.php b/src/Eccube/Controller/Admin/Setting/Shop/TaxRuleController.php index d73a0e401b5..6d47d0ee081 100644 --- a/src/Eccube/Controller/Admin/Setting/Shop/TaxRuleController.php +++ b/src/Eccube/Controller/Admin/Setting/Shop/TaxRuleController.php @@ -62,7 +62,7 @@ public function __construct(BaseInfoRepository $baseInfoRepository, TaxRuleRepos #[Route('/%eccube_admin_route%/setting/shop/tax', name: 'admin_setting_shop_tax', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/setting/shop/tax/new', name: 'admin_setting_shop_tax_new', methods: ['GET', 'POST'])] #[Template('@admin/Setting/Shop/tax_rule.twig')] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array { $TargetTaxRule = $this->taxRuleRepository->newTaxRule(); $builder = $this->formFactory @@ -161,7 +161,7 @@ public function index(Request $request) * @throws \Doctrine\ORM\NoResultException */ #[Route('/%eccube_admin_route%/setting/shop/tax/{id}/delete', name: 'admin_setting_shop_tax_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, TaxRule $TaxRule) + public function delete(Request $request, TaxRule $TaxRule): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); diff --git a/src/Eccube/Controller/Admin/Setting/Shop/TradeLawController.php b/src/Eccube/Controller/Admin/Setting/Shop/TradeLawController.php index 7ef4cbdc7e5..d3d665c68e6 100644 --- a/src/Eccube/Controller/Admin/Setting/Shop/TradeLawController.php +++ b/src/Eccube/Controller/Admin/Setting/Shop/TradeLawController.php @@ -45,7 +45,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/setting/shop/tradelaw', name: 'admin_setting_shop_tradelaw', methods: ['GET', 'POST'])] #[Template('@admin/Setting/Shop/tradelaw.twig')] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array { $tradeLawDetails = $this->tradeLawRepository->findBy([], ['sortNo' => 'ASC']); $builder = $this->formFactory->createBuilder(); diff --git a/src/Eccube/Controller/Admin/Setting/System/AuthorityController.php b/src/Eccube/Controller/Admin/Setting/System/AuthorityController.php index 5fa94e48fd4..0e31b4c3c09 100644 --- a/src/Eccube/Controller/Admin/Setting/System/AuthorityController.php +++ b/src/Eccube/Controller/Admin/Setting/System/AuthorityController.php @@ -47,7 +47,7 @@ public function __construct(AuthorityRoleRepository $authorityRoleRepository) */ #[Route('/%eccube_admin_route%/setting/system/authority', name: 'admin_setting_system_authority', methods: ['GET', 'POST'])] #[Template('@admin/Setting/System/authority.twig')] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array { $AuthorityRoles = $this->authorityRoleRepository->findAllSort(); diff --git a/src/Eccube/Controller/Admin/Setting/System/LogController.php b/src/Eccube/Controller/Admin/Setting/System/LogController.php index ae2262485f5..c17c47c3b0b 100644 --- a/src/Eccube/Controller/Admin/Setting/System/LogController.php +++ b/src/Eccube/Controller/Admin/Setting/System/LogController.php @@ -30,7 +30,7 @@ class LogController extends AbstractController */ #[Route('/%eccube_admin_route%/setting/system/log', name: 'admin_setting_system_log', methods: ['GET', 'POST'])] #[Template('@admin/Setting/System/log.twig')] - public function index(Request $request) + public function index(Request $request): array|StreamedResponse { $formData = []; // default @@ -104,7 +104,7 @@ public function index(Request $request) * * @return array */ - private function parseLogFile($logFile, $formData) + private function parseLogFile($logFile, $formData): array { $log = []; diff --git a/src/Eccube/Controller/Admin/Setting/System/LoginHistoryController.php b/src/Eccube/Controller/Admin/Setting/System/LoginHistoryController.php index 0dca7b32945..f411eccfc38 100644 --- a/src/Eccube/Controller/Admin/Setting/System/LoginHistoryController.php +++ b/src/Eccube/Controller/Admin/Setting/System/LoginHistoryController.php @@ -62,7 +62,7 @@ public function __construct( #[Route('/%eccube_admin_route%/setting/system/login_history', name: 'admin_setting_system_login_history', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/setting/system/login_history/{page_no}', name: 'admin_setting_system_login_history_page', requirements: ['page_no' => '\d+'], methods: ['GET', 'POST'])] #[Template('@admin/Setting/System/login_history.twig')] - public function index(Request $request, PaginatorInterface $paginator, $page_no = null) + public function index(Request $request, PaginatorInterface $paginator, $page_no = null): \Symfony\Component\HttpFoundation\Response|array { $session = $request->getSession(); $pageNo = $page_no; diff --git a/src/Eccube/Controller/Admin/Setting/System/MasterdataController.php b/src/Eccube/Controller/Admin/Setting/System/MasterdataController.php index 51ed0e8a9c0..15ea607f47c 100644 --- a/src/Eccube/Controller/Admin/Setting/System/MasterdataController.php +++ b/src/Eccube/Controller/Admin/Setting/System/MasterdataController.php @@ -34,7 +34,7 @@ class MasterdataController extends AbstractController #[Route('/%eccube_admin_route%/setting/system/masterdata', name: 'admin_setting_system_masterdata', methods: ['GET', 'POST'])] #[Route('/%eccube_admin_route%/setting/system/masterdata/{entity}/edit', name: 'admin_setting_system_masterdata_view', methods: ['GET', 'POST'])] #[Template('@admin/Setting/System/masterdata.twig')] - public function index(Request $request, $entity = null) + public function index(Request $request, $entity = null): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response|array { $data = []; @@ -119,7 +119,7 @@ public function index(Request $request, $entity = null) */ #[Route('/%eccube_admin_route%/setting/system/masterdata/edit', name: 'admin_setting_system_masterdata_edit', methods: ['GET', 'POST'])] #[Template('@admin/Setting/System/masterdata.twig')] - public function edit(Request $request) + public function edit(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array { $builder2 = $this->formFactory->createBuilder(MasterdataEditType::class); diff --git a/src/Eccube/Controller/Admin/Setting/System/MemberController.php b/src/Eccube/Controller/Admin/Setting/System/MemberController.php index 92cc6f89611..90b739a9f78 100644 --- a/src/Eccube/Controller/Admin/Setting/System/MemberController.php +++ b/src/Eccube/Controller/Admin/Setting/System/MemberController.php @@ -67,7 +67,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/setting/system/member', name: 'admin_setting_system_member', methods: ['GET', 'PUT'])] #[Template('@admin/Setting/System/member.twig')] - public function index(Request $request) + public function index(Request $request): array { $Members = $this->memberRepository->findBy([], ['sort_no' => 'DESC']); @@ -97,7 +97,7 @@ public function index(Request $request) */ #[Route('/%eccube_admin_route%/setting/system/member/new', name: 'admin_setting_system_member_new', methods: ['GET', 'POST'])] #[Template('@admin/Setting/System/member_edit.twig')] - public function create(Request $request) + public function create(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array { $Member = new Member(); $builder = $this->formFactory @@ -147,7 +147,7 @@ public function create(Request $request) */ #[Route('/%eccube_admin_route%/setting/system/member/{id}/edit', name: 'admin_setting_system_member_edit', requirements: ['id' => '\d+'], methods: ['GET', 'POST'])] #[Template('@admin/Setting/System/member_edit.twig')] - public function edit(Request $request, Member $Member) + public function edit(Request $request, Member $Member): \Symfony\Component\HttpFoundation\RedirectResponse|array { $Member->setPlainPassword($this->eccubeConfig['eccube_default_password']); @@ -204,7 +204,7 @@ public function edit(Request $request, Member $Member) * @throws \Exception */ #[Route('/%eccube_admin_route%/setting/system/member/{id}/up', name: 'admin_setting_system_member_up', requirements: ['id' => '\d+'], methods: ['PUT'])] - public function up(Request $request, Member $Member) + public function up(Request $request, Member $Member): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -230,7 +230,7 @@ public function up(Request $request, Member $Member) * @throws \Exception */ #[Route('/%eccube_admin_route%/setting/system/member/{id}/down', name: 'admin_setting_system_member_down', requirements: ['id' => '\d+'], methods: ['PUT'])] - public function down(Request $request, Member $Member) + public function down(Request $request, Member $Member): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -256,7 +256,7 @@ public function down(Request $request, Member $Member) * @throws ForeignKeyConstraintViolationException|\Exception */ #[Route('/%eccube_admin_route%/setting/system/member/{id}/delete', name: 'admin_setting_system_member_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, Member $Member) + public function delete(Request $request, Member $Member): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); diff --git a/src/Eccube/Controller/Admin/Setting/System/SecurityController.php b/src/Eccube/Controller/Admin/Setting/System/SecurityController.php index 97db00d4807..7b3575c9e6f 100644 --- a/src/Eccube/Controller/Admin/Setting/System/SecurityController.php +++ b/src/Eccube/Controller/Admin/Setting/System/SecurityController.php @@ -47,7 +47,7 @@ public function __construct(TokenStorageInterface $tokenStorage) */ #[Route('/%eccube_admin_route%/setting/system/security', name: 'admin_setting_system_security', methods: ['GET', 'POST'])] #[Template('@admin/Setting/System/security.twig')] - public function index(Request $request, CacheUtil $cacheUtil) + public function index(Request $request, CacheUtil $cacheUtil): \Symfony\Component\HttpFoundation\RedirectResponse|array { $builder = $this->formFactory->createBuilder(SecurityType::class); $form = $builder->getForm(); diff --git a/src/Eccube/Controller/Admin/Setting/System/SystemController.php b/src/Eccube/Controller/Admin/Setting/System/SystemController.php index 5c72b3ad2f3..d4cb5c77ad5 100644 --- a/src/Eccube/Controller/Admin/Setting/System/SystemController.php +++ b/src/Eccube/Controller/Admin/Setting/System/SystemController.php @@ -54,7 +54,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/setting/system/system', name: 'admin_setting_system_system', methods: ['GET'])] #[Template('@admin/Setting/System/system.twig')] - public function index(Request $request) + public function index(Request $request): array { $info = []; $info[] = ['title' => trans('admin.setting.system.system.eccube'), 'value' => Constant::VERSION]; @@ -78,7 +78,7 @@ public function index(Request $request) * @return Response */ #[Route('/%eccube_admin_route%/setting/system/system/phpinfo', name: 'admin_setting_system_system_phpinfo', methods: ['GET'])] - public function phpinfo(Request $request) + public function phpinfo(Request $request): Response { ob_start(); phpinfo(); diff --git a/src/Eccube/Controller/Admin/Setting/System/TwoFactorAuthController.php b/src/Eccube/Controller/Admin/Setting/System/TwoFactorAuthController.php index f008d10fab3..5ce9feba452 100755 --- a/src/Eccube/Controller/Admin/Setting/System/TwoFactorAuthController.php +++ b/src/Eccube/Controller/Admin/Setting/System/TwoFactorAuthController.php @@ -63,7 +63,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/two_factor_auth', name: 'admin_two_factor_auth', methods: ['GET', 'POST'])] #[Template('@admin/two_factor_auth.twig')] - public function auth(Request $request) + public function auth(Request $request): RedirectResponse|array { /** @var \Eccube\Entity\Member $Member */ $Member = $this->getUser(); @@ -110,7 +110,7 @@ public function auth(Request $request) */ #[Route('/%eccube_admin_route%/two_factor_auth/set', name: 'admin_two_factor_auth_set', methods: ['GET', 'POST'])] #[Template('@admin/two_factor_auth_set.twig')] - public function set(Request $request) + public function set(Request $request): RedirectResponse { /** @var \Eccube\Entity\Member $Member */ $Member = $this->getUser(); @@ -129,7 +129,7 @@ public function set(Request $request) */ #[Route('/%eccube_admin_route%/setting/system/two_factor_auth/edit', name: 'admin_setting_system_two_factor_auth_edit', methods: ['GET', 'POST'])] #[Template('@admin/Setting/System/two_factor_auth_edit.twig')] - public function edit(Request $request) + public function edit(Request $request): RedirectResponse { /** @var \Eccube\Entity\Member $Member */ $Member = $this->getUser(); @@ -149,7 +149,7 @@ public function edit(Request $request) * * @return array|RedirectResponse */ - private function createResponse(Request $request) + private function createResponse(Request $request): array|RedirectResponse { $error = null; /** @var \Eccube\Entity\Member $Member */ diff --git a/src/Eccube/Controller/Admin/Store/OwnerStoreController.php b/src/Eccube/Controller/Admin/Store/OwnerStoreController.php index b17198dfce4..26c779fa3f4 100755 --- a/src/Eccube/Controller/Admin/Store/OwnerStoreController.php +++ b/src/Eccube/Controller/Admin/Store/OwnerStoreController.php @@ -131,7 +131,7 @@ public function __construct( #[Route('/search', name: 'admin_store_plugin_owners_search', methods: ['GET', 'POST'])] #[Route('/search/page/{page_no}', name: 'admin_store_plugin_owners_search_page', requirements: ['page_no' => '\d+'], methods: ['GET', 'POST'])] #[Template('@admin/Store/plugin_search.twig')] - public function search(Request $request, PaginatorInterface $paginator, $page_no = null) + public function search(Request $request, PaginatorInterface $paginator, $page_no = null): array|RedirectResponse { if (empty($this->BaseInfo->getAuthenticationKey())) { $this->addWarning('admin.store.plugin.search.not_auth', 'admin'); @@ -236,7 +236,7 @@ public function search(Request $request, PaginatorInterface $paginator, $page_no * @throws PluginException */ #[Route('/install/{id}/confirm', name: 'admin_store_plugin_install_confirm', requirements: ['id' => '\d+'], methods: ['GET'])] - public function doConfirm(Request $request, $id): Response + public function doConfirm(Request $request, $id): RedirectResponse|Response { try { $item = $this->pluginApiService->getPlugin($id); @@ -263,7 +263,7 @@ public function doConfirm(Request $request, $id): Response * @return JsonResponse */ #[Route('/install', name: 'admin_store_plugin_api_install', methods: ['POST'])] - public function apiInstall(Request $request) + public function apiInstall(Request $request): JsonResponse { $this->isTokenValid(); @@ -313,7 +313,7 @@ public function apiInstall(Request $request) * @return JsonResponse */ #[Route('/delete/{id}/uninstall', requirements: ['id' => '\d+'], name: 'admin_store_plugin_api_uninstall', methods: ['DELETE'])] - public function apiUninstall(Plugin $Plugin) + public function apiUninstall(Plugin $Plugin): JsonResponse { $this->isTokenValid(); @@ -362,7 +362,7 @@ public function apiUninstall(Plugin $Plugin) * @return JsonResponse */ #[Route('/upgrade', name: 'admin_store_plugin_api_upgrade', methods: ['POST'])] - public function apiUpgrade(Request $request) + public function apiUpgrade(Request $request): JsonResponse { $this->isTokenValid(); @@ -431,7 +431,7 @@ public function apiUpgrade(Request $request) * @return JsonResponse */ #[Route('/schema_update', name: 'admin_store_plugin_api_schema_update', methods: ['POST'])] - public function apiSchemaUpdate(Request $request) + public function apiSchemaUpdate(Request $request): JsonResponse { $this->isTokenValid(); @@ -481,7 +481,7 @@ public function apiSchemaUpdate(Request $request) * @return JsonResponse */ #[Route('/update', name: 'admin_store_plugin_api_update', methods: ['POST'])] - public function apiUpdate(Request $request) + public function apiUpdate(Request $request): JsonResponse { $this->isTokenValid(); @@ -521,7 +521,7 @@ public function apiUpdate(Request $request) */ #[Route('/upgrade/{id}/confirm', name: 'admin_store_plugin_update_confirm', requirements: ['id' => '\d+'], methods: ['GET'])] #[Template('@admin/Store/plugin_confirm.twig')] - public function doUpdateConfirm(Plugin $Plugin) + public function doUpdateConfirm(Plugin $Plugin): array|RedirectResponse { try { $item = $this->pluginApiService->getPlugin($Plugin->getSource()); diff --git a/src/Eccube/Controller/Admin/Store/PluginController.php b/src/Eccube/Controller/Admin/Store/PluginController.php index 797aeed1b69..2e0ddf22d72 100644 --- a/src/Eccube/Controller/Admin/Store/PluginController.php +++ b/src/Eccube/Controller/Admin/Store/PluginController.php @@ -111,7 +111,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/store/plugin', name: 'admin_store_plugin', methods: ['GET'])] #[Template('@admin/Store/plugin.twig')] - public function index() + public function index(): array { $pluginForms = []; $configPages = []; @@ -201,7 +201,7 @@ public function index() * @return RedirectResponse */ #[Route('/%eccube_admin_route%/store/plugin/{id}/update', name: 'admin_store_plugin_update', requirements: ['id' => '\d+'], methods: ['POST'])] - public function update(Request $request, Plugin $Plugin, CacheUtil $cacheUtil) + public function update(Request $request, Plugin $Plugin, CacheUtil $cacheUtil): RedirectResponse { $form = $this->formFactory ->createNamedBuilder( @@ -267,7 +267,7 @@ public function update(Request $request, Plugin $Plugin, CacheUtil $cacheUtil) * @throws PluginException */ #[Route('/%eccube_admin_route%/store/plugin/{id}/enable', name: 'admin_store_plugin_enable', requirements: ['id' => '\d+'], methods: ['POST'])] - public function enable(Plugin $Plugin, CacheUtil $cacheUtil, Request $request) + public function enable(Plugin $Plugin, CacheUtil $cacheUtil, Request $request): RedirectResponse|JsonResponse { $this->isTokenValid(); // QueryString maintenance_modeがない場合 @@ -352,7 +352,7 @@ public function enable(Plugin $Plugin, CacheUtil $cacheUtil, Request $request) * @return JsonResponse|RedirectResponse */ #[Route('/%eccube_admin_route%/store/plugin/{id}/disable', name: 'admin_store_plugin_disable', requirements: ['id' => '\d+'], methods: ['POST'])] - public function disable(Request $request, Plugin $Plugin, CacheUtil $cacheUtil) + public function disable(Request $request, Plugin $Plugin, CacheUtil $cacheUtil): JsonResponse|RedirectResponse { $this->isTokenValid(); @@ -432,7 +432,7 @@ public function disable(Request $request, Plugin $Plugin, CacheUtil $cacheUtil) * @throws \Exception */ #[Route('/%eccube_admin_route%/store/plugin/{id}/uninstall', name: 'admin_store_plugin_uninstall', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function uninstall(Plugin $Plugin, CacheUtil $cacheUtil) + public function uninstall(Plugin $Plugin, CacheUtil $cacheUtil): RedirectResponse { $this->isTokenValid(); @@ -475,7 +475,7 @@ public function uninstall(Plugin $Plugin, CacheUtil $cacheUtil) */ #[Route('/%eccube_admin_route%/store/plugin/install', name: 'admin_store_plugin_install', methods: ['GET', 'POST'])] #[Template('@admin/Store/plugin_install.twig')] - public function install(Request $request, CacheUtil $cacheUtil) + public function install(Request $request, CacheUtil $cacheUtil): array|RedirectResponse { $this->addInfoOnce('admin.common.restrict_file_upload_info', 'admin'); @@ -541,7 +541,7 @@ public function install(Request $request, CacheUtil $cacheUtil) */ #[Route('/%eccube_admin_route%/store/plugin/authentication_setting', name: 'admin_store_authentication_setting', methods: ['GET', 'POST'])] #[Template('@admin/Store/authentication_setting.twig')] - public function authenticationSetting(Request $request, CacheUtil $cacheUtil) + public function authenticationSetting(Request $request, CacheUtil $cacheUtil): array|RedirectResponse { $builder = $this->formFactory ->createBuilder(AuthenticationType::class, $this->BaseInfo); @@ -579,7 +579,7 @@ public function authenticationSetting(Request $request, CacheUtil $cacheUtil) * * @throws PluginException */ - protected function getUnregisteredPlugins(array $plugins) + protected function getUnregisteredPlugins(array $plugins): array { $finder = new Finder(); $pluginCodes = []; diff --git a/src/Eccube/Controller/Admin/Store/TemplateController.php b/src/Eccube/Controller/Admin/Store/TemplateController.php index cc099249374..ce01f594c5e 100644 --- a/src/Eccube/Controller/Admin/Store/TemplateController.php +++ b/src/Eccube/Controller/Admin/Store/TemplateController.php @@ -66,7 +66,7 @@ public function __construct( */ #[Route('/%eccube_admin_route%/store/template', name: 'admin_store_template', methods: ['GET', 'POST'])] #[Template('@admin/Store/template.twig')] - public function index(Request $request, CacheUtil $cacheUtil) + public function index(Request $request, CacheUtil $cacheUtil): array|\Symfony\Component\HttpFoundation\RedirectResponse { $DeviceType = $this->deviceTypeRepository->find(DeviceType::DEVICE_TYPE_PC); @@ -111,7 +111,7 @@ public function index(Request $request, CacheUtil $cacheUtil) * @return BinaryFileResponse */ #[Route('/%eccube_admin_route%/store/template/{id}/download', name: 'admin_store_template_download', requirements: ['id' => '\d+'], methods: ['GET'])] - public function download(Request $request, \Eccube\Entity\Template $Template) + public function download(Request $request, \Eccube\Entity\Template $Template): BinaryFileResponse { // 該当テンプレートのディレクトリ $templateCode = $Template->getCode(); @@ -174,7 +174,7 @@ public function download(Request $request, \Eccube\Entity\Template $Template) * @return \Symfony\Component\HttpFoundation\RedirectResponse */ #[Route('/%eccube_admin_route%/store/template/{id}/delete', name: 'admin_store_template_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, \Eccube\Entity\Template $Template) + public function delete(Request $request, \Eccube\Entity\Template $Template): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); @@ -219,7 +219,7 @@ public function delete(Request $request, \Eccube\Entity\Template $Template) */ #[Route('/%eccube_admin_route%/store/template/install', name: 'admin_store_template_install', methods: ['GET', 'POST'])] #[Template('@admin/Store/template_add.twig')] - public function install(Request $request) + public function install(Request $request): array|\Symfony\Component\HttpFoundation\RedirectResponse { $this->addInfoOnce('admin.common.restrict_file_upload_info', 'admin'); diff --git a/src/Eccube/Controller/Block/AutoNewItemController.php b/src/Eccube/Controller/Block/AutoNewItemController.php index 137e0cf24ed..ab165eac0f8 100644 --- a/src/Eccube/Controller/Block/AutoNewItemController.php +++ b/src/Eccube/Controller/Block/AutoNewItemController.php @@ -47,7 +47,7 @@ public function __construct( */ #[Route('/block/auto_new_item', name: 'block_auto_new_item', methods: ['GET'])] #[Template('Block/auto_new_item.twig')] - public function index(Request $request) + public function index(Request $request): array { $qb = $this->productRepository->getQueryBuilderBySearchData([ 'orderby' => $this->productListOrderByRepository->find($this->eccubeConfig['eccube_product_order_newer']), diff --git a/src/Eccube/Controller/Block/CalendarController.php b/src/Eccube/Controller/Block/CalendarController.php index 163fa1e131a..aac7a55f1e9 100644 --- a/src/Eccube/Controller/Block/CalendarController.php +++ b/src/Eccube/Controller/Block/CalendarController.php @@ -42,7 +42,7 @@ public function __construct(CalendarRepository $calendarRepository) */ #[Route('/block/calendar', name: 'block_calendar', methods: ['GET'])] #[Template('Block/calendar.twig')] - public function index(Request $request) + public function index(Request $request): array { $today = Carbon::now(); $firstDateOfThisMonth = $today->copy()->startOfMonth(); @@ -92,7 +92,7 @@ public function index(Request $request) * * @return array> カレンダーの配列 */ - private function setHolidayAndTodayFlag($targetMonthCalendar, $holidayListOfTwoMonths, Carbon $targetDate) + private function setHolidayAndTodayFlag($targetMonthCalendar, $holidayListOfTwoMonths, Carbon $targetDate): array { for ($i = 0; $i < count($targetMonthCalendar); $i++) { // カレンダー配列の日が空の場合は処理をスキップ @@ -131,7 +131,7 @@ private function setHolidayAndTodayFlag($targetMonthCalendar, $holidayListOfTwoM * * @return array> カレンダーの配列 */ - private function createCalendar(Carbon $firstDateOfTargetMonth) + private function createCalendar(Carbon $firstDateOfTargetMonth): array { // 週のうちの何日目か 0 (日曜)から 6 (土曜)を取得 $firstDayOfWeek = $firstDateOfTargetMonth->dayOfWeek; @@ -188,7 +188,7 @@ private function createCalendar(Carbon $firstDateOfTargetMonth) * * @return string 曜日の文字 : Sun(日曜)からSat(土曜) */ - private function getDayOfWeekString($dayOfWeekNumber) + private function getDayOfWeekString($dayOfWeekNumber): string { $weekday = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; diff --git a/src/Eccube/Controller/Block/CartController.php b/src/Eccube/Controller/Block/CartController.php index e13a4688f8f..c67bc0f8447 100644 --- a/src/Eccube/Controller/Block/CartController.php +++ b/src/Eccube/Controller/Block/CartController.php @@ -39,7 +39,7 @@ public function __construct( */ #[Route('/block/cart', name: 'block_cart', methods: ['GET'])] #[Route('/block/cart_sp', name: 'block_cart_sp', methods: ['GET'])] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\Response { $Carts = $this->cartService->getCarts(); diff --git a/src/Eccube/Controller/Block/SearchProductController.php b/src/Eccube/Controller/Block/SearchProductController.php index 17e22702d92..ee1d7e53c3e 100644 --- a/src/Eccube/Controller/Block/SearchProductController.php +++ b/src/Eccube/Controller/Block/SearchProductController.php @@ -42,7 +42,7 @@ public function __construct(RequestStack $requestStack, #[Route('/block/search_product', name: 'block_search_product', methods: ['GET'])] #[Route('/block/search_product_sp', name: 'block_search_product_sp', methods: ['GET'])] #[Template('Block/search_product.twig')] - public function index(Request $request) + public function index(Request $request): array { $builder = $this->formFactory ->createNamedBuilder('', SearchProductBlockType::class) diff --git a/src/Eccube/Controller/CartController.php b/src/Eccube/Controller/CartController.php index 9b6a19a9e6f..ce3c85fffec 100644 --- a/src/Eccube/Controller/CartController.php +++ b/src/Eccube/Controller/CartController.php @@ -79,7 +79,7 @@ public function __construct( */ #[Route('/cart', name: 'cart', methods: ['GET'])] #[Template('Cart/index.twig')] - public function index(Request $request) + public function index(Request $request): array { // カートを取得して明細の正規化を実行 $Carts = $this->cartService->getCarts(); @@ -135,7 +135,7 @@ public function index(Request $request) * * @return \Symfony\Component\HttpFoundation\RedirectResponse|null */ - protected function execPurchaseFlow($Carts) + protected function execPurchaseFlow($Carts): ?\Symfony\Component\HttpFoundation\RedirectResponse { /** @var PurchaseFlowResult[] $flowResults */ $flowResults = array_map(function ($Cart) { @@ -194,7 +194,7 @@ protected function execPurchaseFlow($Carts) * @return \Symfony\Component\HttpFoundation\RedirectResponse */ #[Route('/cart/{operation}/{productClassId}', name: 'cart_handle_item', requirements: ['operation' => 'up|down|remove', 'productClassId' => '\d+'], methods: ['PUT'])] - public function handleCartItem($operation, $productClassId) + public function handleCartItem($operation, $productClassId): \Symfony\Component\HttpFoundation\RedirectResponse { log_info('カート明細操作開始', ['operation' => $operation, 'product_class_id' => $productClassId]); @@ -240,7 +240,7 @@ public function handleCartItem($operation, $productClassId) * @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response|null */ #[Route('/cart/buystep/{cart_key}', name: 'cart_buystep', requirements: ['cart_key' => '[a-zA-Z0-9]+[_][\x20-\x7E]+'], methods: ['GET'])] - public function buystep(Request $request, $cart_key) + public function buystep(Request $request, $cart_key): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response|null { $Carts = $this->cartService->getCart(); if (!is_object($Carts)) { diff --git a/src/Eccube/Controller/ContactController.php b/src/Eccube/Controller/ContactController.php index 07895208e20..c6794f72079 100644 --- a/src/Eccube/Controller/ContactController.php +++ b/src/Eccube/Controller/ContactController.php @@ -59,7 +59,7 @@ public function __construct( #[Route('/contact', name: 'contact', methods: ['GET', 'POST'])] #[Route('/contact', name: 'contact_confirm', methods: ['GET', 'POST'])] #[Template('Contact/index.twig')] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse|array { $builder = $this->formFactory->createBuilder(ContactType::class); @@ -135,7 +135,7 @@ public function index(Request $request) */ #[Route('/contact/complete', name: 'contact_complete', methods: ['GET'])] #[Template('Contact/complete.twig')] - public function complete() + public function complete(): array { return []; } diff --git a/src/Eccube/Controller/EntryController.php b/src/Eccube/Controller/EntryController.php index 9813342f44a..f453c1d33eb 100644 --- a/src/Eccube/Controller/EntryController.php +++ b/src/Eccube/Controller/EntryController.php @@ -125,7 +125,7 @@ public function __construct( #[Route('/entry', name: 'entry', methods: ['GET', 'POST'])] #[Route('/entry', name: 'entry_complete', methods: ['GET', 'POST'])] #[Template('Entry/index.twig')] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse|array { if ($this->isGranted('ROLE_USER')) { log_info('認証済のためログイン処理をスキップ'); @@ -228,7 +228,7 @@ public function index(Request $request) */ #[Route('/entry/complete', name: 'entry_complete', methods: ['GET'])] #[Template('Entry/complete.twig')] - public function complete() + public function complete(): array { return []; } @@ -246,7 +246,7 @@ public function complete() */ #[Route('/entry/activate/{secret_key}/{qtyInCart}', name: 'entry_activate', methods: ['GET'])] #[Template('Entry/activate.twig')] - public function activate(Request $request, $secret_key, $qtyInCart = null) + public function activate(Request $request, $secret_key, $qtyInCart = null): array { $errors = $this->recursiveValidator->validate( $secret_key, @@ -286,9 +286,9 @@ public function activate(Request $request, $secret_key, $qtyInCart = null) * @param Request $request * @param string $secret_key * - * @return \Eccube\Entity\Cart|mixed + * @return int */ - private function entryActivate(Request $request, $secret_key) + private function entryActivate(Request $request, $secret_key): int { log_info('本会員登録開始'); $Customer = $this->customerRepository->getProvisionalCustomerBySecretKey($secret_key); diff --git a/src/Eccube/Controller/ForgotController.php b/src/Eccube/Controller/ForgotController.php index 8462f6e4b55..ded69a8c4f6 100644 --- a/src/Eccube/Controller/ForgotController.php +++ b/src/Eccube/Controller/ForgotController.php @@ -79,7 +79,7 @@ public function __construct( */ #[Route('/forgot', name: 'forgot', methods: ['GET', 'POST'])] #[Template('Forgot/index.twig')] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array { if ($this->isGranted('IS_AUTHENTICATED_FULLY')) { throw new HttpException\NotFoundHttpException(); @@ -156,7 +156,7 @@ public function index(Request $request) */ #[Route('/forgot/complete', name: 'forgot_complete', methods: ['GET'])] #[Template('Forgot/complete.twig')] - public function complete(Request $request) + public function complete(Request $request): array { if ($this->isGranted('IS_AUTHENTICATED_FULLY')) { throw new HttpException\NotFoundHttpException(); @@ -177,7 +177,7 @@ public function complete(Request $request) */ #[Route('/forgot/reset/{reset_key}', name: 'forgot_reset', methods: ['GET', 'POST'])] #[Template('Forgot/reset.twig')] - public function reset(Request $request, $reset_key) + public function reset(Request $request, $reset_key): \Symfony\Component\HttpFoundation\RedirectResponse|array { if ($this->isGranted('IS_AUTHENTICATED_FULLY')) { throw new HttpException\NotFoundHttpException(); diff --git a/src/Eccube/Controller/HelpController.php b/src/Eccube/Controller/HelpController.php index 4d5dd1ee583..4e431e15f9b 100644 --- a/src/Eccube/Controller/HelpController.php +++ b/src/Eccube/Controller/HelpController.php @@ -32,7 +32,7 @@ public function __construct() */ #[Route('/help/guide', name: 'help_guide', methods: ['GET'])] #[Template('Help/guide.twig')] - public function guide() + public function guide(): array { return []; } @@ -44,7 +44,7 @@ public function guide() */ #[Route('/help/about', name: 'help_about', methods: ['GET'])] #[Template('Help/about.twig')] - public function about() + public function about(): array { return []; } @@ -56,7 +56,7 @@ public function about() */ #[Route('/help/privacy', name: 'help_privacy', methods: ['GET'])] #[Template('Help/privacy.twig')] - public function privacy() + public function privacy(): array { return []; } @@ -68,7 +68,7 @@ public function privacy() */ #[Route('/help/agreement', name: 'help_agreement', methods: ['GET'])] #[Template('Help/agreement.twig')] - public function agreement() + public function agreement(): array { return []; } diff --git a/src/Eccube/Controller/Install/InstallController.php b/src/Eccube/Controller/Install/InstallController.php index 846169dc7f6..bb3b091983b 100644 --- a/src/Eccube/Controller/Install/InstallController.php +++ b/src/Eccube/Controller/Install/InstallController.php @@ -123,7 +123,7 @@ public function __construct(UserPasswordHasherInterface $passwordHasher, CacheUt #[Route('/', name: 'homepage', methods: ['GET'])] #[Route('/install', name: 'install', methods: ['GET'])] #[Template('index.twig')] - public function index() + public function index(): \Symfony\Component\HttpFoundation\RedirectResponse { if (!$this->isInstallEnv()) { throw new NotFoundHttpException(); @@ -145,7 +145,7 @@ public function index() */ #[Route('/install/step1', name: 'install_step1', methods: ['GET', 'POST'])] #[Template('step1.twig')] - public function step1(Request $request) + public function step1(Request $request): array|\Symfony\Component\HttpFoundation\RedirectResponse { if (!$this->isInstallEnv()) { throw new NotFoundHttpException(); @@ -186,7 +186,7 @@ public function step1(Request $request) */ #[Route('/install/step2', name: 'install_step2', methods: ['GET'])] #[Template('step2.twig')] - public function step2() + public function step2(): array { if (!$this->isInstallEnv()) { throw new NotFoundHttpException(); @@ -265,7 +265,7 @@ public function step2() */ #[Route('/install/step3', name: 'install_step3', methods: ['GET', 'POST'])] #[Template('step3.twig')] - public function step3(Request $request, EntityManagerInterface $entityManager) + public function step3(Request $request, EntityManagerInterface $entityManager): array|\Symfony\Component\HttpFoundation\RedirectResponse { if (!$this->isInstallEnv()) { throw new NotFoundHttpException(); @@ -337,7 +337,7 @@ public function step3(Request $request, EntityManagerInterface $entityManager) */ #[Route('/install/step4', name: 'install_step4', methods: ['GET', 'POST'])] #[Template('step4.twig')] - public function step4(Request $request) + public function step4(Request $request): array|\Symfony\Component\HttpFoundation\RedirectResponse { if (!$this->isInstallEnv()) { throw new NotFoundHttpException(); @@ -387,7 +387,7 @@ public function step4(Request $request) */ #[Route('/install/step5', name: 'install_step5', methods: ['GET', 'POST'])] #[Template('step5.twig')] - public function step5(Request $request) + public function step5(Request $request): array|\Symfony\Component\HttpFoundation\RedirectResponse { if (!$this->isInstallEnv()) { throw new NotFoundHttpException(); @@ -470,7 +470,7 @@ public function step5(Request $request) */ #[Route('/install/complete', name: 'install_complete', methods: ['GET'])] #[Template('complete.twig')] - public function complete(Request $request) + public function complete(Request $request): array { if (!$this->isInstallEnv()) { throw new NotFoundHttpException(); @@ -532,7 +532,7 @@ public function complete(Request $request) * * @return mixed */ - protected function getSessionData(SessionInterface $session) + protected function getSessionData(SessionInterface $session): mixed { return $session->get('eccube.session.install', []); } @@ -542,7 +542,7 @@ protected function getSessionData(SessionInterface $session) * * @return void */ - protected function removeSessionData(SessionInterface $session) + protected function removeSessionData(SessionInterface $session): void { $session->clear(); } @@ -553,7 +553,7 @@ protected function removeSessionData(SessionInterface $session) * * @return void */ - protected function setSessionData(SessionInterface $session, $data = []) + protected function setSessionData(SessionInterface $session, $data = []): void { $data = array_replace_recursive($this->getSessionData($session), $data); $session->set('eccube.session.install', $data); @@ -562,7 +562,7 @@ protected function setSessionData(SessionInterface $session, $data = []) /** * @return void */ - protected function checkModules() + protected function checkModules(): void { foreach ($this->requiredModules as $module) { if (!extension_loaded($module)) { @@ -606,7 +606,7 @@ protected function checkModules() * * @throws \Doctrine\DBAL\Exception */ - protected function createConnection(array $params) + protected function createConnection(array $params): Connection { if (str_contains((string) $params['url'], 'mysql')) { $params['charset'] = 'utf8mb4'; @@ -636,7 +636,7 @@ protected function createConnection(array $params) * * @throws \Doctrine\ORM\Exception\ORMException */ - protected function createEntityManager(Connection $conn) + protected function createEntityManager(Connection $conn): EntityManager { $paths = [ $this->getParameter('kernel.project_dir').'/src/Eccube/Entity', @@ -657,7 +657,7 @@ protected function createEntityManager(Connection $conn) * * @return string|null */ - public function createDatabaseUrl(array $params) + public function createDatabaseUrl(array $params): ?string { if (!isset($params['database'])) { return null; @@ -701,7 +701,7 @@ public function createDatabaseUrl(array $params) * * @throws \Exception */ - public function extractDatabaseUrl($url) + public function extractDatabaseUrl($url): array { if (preg_match('|^sqlite://(.*)$|', $url, $matches)) { return [ @@ -733,7 +733,7 @@ public function extractDatabaseUrl($url) * * @see https://github.com/symfony/swiftmailer-bundle/blob/9728097df87e76e2db71fc41fd7d211c06daea3e/DependencyInjection/SwiftmailerTransportFactory.php#L80-L142 */ - public function createMailerUrl(array $params) + public function createMailerUrl(array $params): string { if (isset($params['transport'])) { $url = $params['transport'].'://'; @@ -791,7 +791,7 @@ public function createMailerUrl(array $params) * * @return array */ - public function extractMailerUrl($url) + public function extractMailerUrl($url): array { $options = [ 'transport' => null, @@ -855,7 +855,7 @@ public function extractMailerUrl($url) * * @throws \Doctrine\DBAL\Exception */ - protected function dropTables(EntityManager $em) + protected function dropTables(EntityManager $em): void { $metadatas = $em->getMetadataFactory()->getAllMetadata(); $schemaTool = new SchemaTool($em); @@ -870,7 +870,7 @@ protected function dropTables(EntityManager $em) * * @throws \Doctrine\ORM\Tools\ToolsException */ - protected function createTables(EntityManager $em) + protected function createTables(EntityManager $em): void { $metadatas = $em->getMetadataFactory()->getAllMetadata(); $schemaTool = new SchemaTool($em); @@ -882,7 +882,7 @@ protected function createTables(EntityManager $em) * * @return void */ - protected function importCsv(EntityManager $em) + protected function importCsv(EntityManager $em): void { // for full locale code cases $locale = env('ECCUBE_LOCALE', 'ja_JP'); @@ -905,7 +905,7 @@ protected function importCsv(EntityManager $em) * * @throws \Doctrine\DBAL\Exception */ - protected function insert(Connection $conn, array $data) + protected function insert(Connection $conn, array $data): void { $conn->beginTransaction(); try { @@ -965,7 +965,7 @@ protected function insert(Connection $conn, array $data) * * @throws \Doctrine\DBAL\Exception */ - protected function update(Connection $conn, array $data) + protected function update(Connection $conn, array $data): void { $conn->beginTransaction(); try { @@ -1014,7 +1014,7 @@ protected function update(Connection $conn, array $data) * * @return array */ - public function createAppData($params, EntityManager $em) + public function createAppData($params, EntityManager $em): array { $platform = $em->getConnection()->getDatabasePlatform()->getName(); $version = $this->getDatabaseVersion($em); @@ -1035,7 +1035,7 @@ public function createAppData($params, EntityManager $em) * * @return $this */ - protected function sendAppData($params, EntityManager $em) + protected function sendAppData($params, EntityManager $em): static { try { $query = http_build_query($this->createAppData($params, $em)); @@ -1068,7 +1068,7 @@ protected function sendAppData($params, EntityManager $em) * * @throws \Exception */ - public function getDatabaseVersion(EntityManager $em) + public function getDatabaseVersion(EntityManager $em): string { $rsm = new \Doctrine\ORM\Query\ResultSetMapping(); $rsm->addScalarResult('server_version', 'server_version'); @@ -1097,7 +1097,7 @@ public function getDatabaseVersion(EntityManager $em) * * @return string */ - public function convertAdminAllowHosts($adminAllowHosts) + public function convertAdminAllowHosts($adminAllowHosts): string { if (empty($adminAllowHosts)) { return '[]'; @@ -1113,7 +1113,7 @@ public function convertAdminAllowHosts($adminAllowHosts) /** * @return bool */ - protected function isInstalled() + protected function isInstalled(): bool { return self::DEFAULT_AUTH_MAGIC !== $this->getParameter('eccube_auth_magic'); } @@ -1121,7 +1121,7 @@ protected function isInstalled() /** * @return bool */ - protected function isInstallEnv() + protected function isInstallEnv(): bool { $env = $this->getParameter('kernel.environment'); diff --git a/src/Eccube/Controller/InstallPluginController.php b/src/Eccube/Controller/InstallPluginController.php index 75c17984d96..581b0c49352 100644 --- a/src/Eccube/Controller/InstallPluginController.php +++ b/src/Eccube/Controller/InstallPluginController.php @@ -57,7 +57,7 @@ public function __construct(CacheUtil $cacheUtil, PluginRepository $pluginRespos * @return JsonResponse */ #[Route('/install/plugins', name: 'install_plugins', methods: ['GET'])] - public function plugins(Request $request) + public function plugins(Request $request): JsonResponse { if (!$request->isXmlHttpRequest()) { throw new BadRequestHttpException(); @@ -90,7 +90,7 @@ public function plugins(Request $request) * @throws PluginException */ #[Route('/install/plugin/{code}/enable', name: 'install_plugin_enable', requirements: ['code' => '\w+'], methods: ['PUT'])] - public function pluginEnable(Request $request, SystemService $systemService, PluginService $pluginService, $code, EventDispatcherInterface $dispatcher) + public function pluginEnable(Request $request, SystemService $systemService, PluginService $pluginService, $code, EventDispatcherInterface $dispatcher): JsonResponse { if (!$request->isXmlHttpRequest()) { throw new BadRequestHttpException(); @@ -142,7 +142,7 @@ public function pluginEnable(Request $request, SystemService $systemService, Plu * @return RedirectResponse */ #[Route('/install/plugin/redirect', name: 'install_plugin_redirect', methods: ['GET'])] - public function redirectAdmin(Request $request) + public function redirectAdmin(Request $request): RedirectResponse { if (!$request->isXmlHttpRequest()) { throw new BadRequestHttpException(); @@ -172,7 +172,7 @@ public function redirectAdmin(Request $request) * * @return bool */ - public function isValidTransaction($token) + public function isValidTransaction($token): bool { $projectDir = $this->getParameter('kernel.project_dir'); if (!file_exists($projectDir.parent::TRANSACTION_CHECK_FILE)) { @@ -201,7 +201,7 @@ public function isValidTransaction($token) * @throws BadRequestHttpException|NotFoundHttpException */ #[Route('/install/plugin/check_api', name: 'install_plugin_check_api', methods: ['PUT'])] - public function checkWebApiRequirements(Request $request, ComposerApiService $composerApiService, EventDispatcherInterface $dispatcher) + public function checkWebApiRequirements(Request $request, ComposerApiService $composerApiService, EventDispatcherInterface $dispatcher): JsonResponse { if (!$request->isXmlHttpRequest()) { throw new BadRequestHttpException(); @@ -235,7 +235,7 @@ public function checkWebApiRequirements(Request $request, ComposerApiService $co /** * @return void */ - private function clearCacheOnTerminate() + private function clearCacheOnTerminate(): void { // KernelEvents::TERMINATE で強制的にキャッシュを削除する // see https://github.com/EC-CUBE/ec-cube/issues/5498#issuecomment-1205904083 diff --git a/src/Eccube/Controller/Mypage/ChangeController.php b/src/Eccube/Controller/Mypage/ChangeController.php index 5ac004f9b08..c77a5358e37 100644 --- a/src/Eccube/Controller/Mypage/ChangeController.php +++ b/src/Eccube/Controller/Mypage/ChangeController.php @@ -82,7 +82,7 @@ public function __construct( */ #[Route('/mypage/change', name: 'mypage_change', methods: ['GET', 'POST'])] #[Template('Mypage/change.twig')] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array { /** @var Customer $Customer */ $Customer = $this->getUser(); @@ -162,7 +162,7 @@ public function index(Request $request) */ #[Route('/mypage/change_complete', name: 'mypage_change_complete', methods: ['GET'])] #[Template('Mypage/change_complete.twig')] - public function complete(Request $request) + public function complete(Request $request): array { return []; } diff --git a/src/Eccube/Controller/Mypage/DeliveryController.php b/src/Eccube/Controller/Mypage/DeliveryController.php index d6e2666b57d..2dac42de4ed 100644 --- a/src/Eccube/Controller/Mypage/DeliveryController.php +++ b/src/Eccube/Controller/Mypage/DeliveryController.php @@ -65,7 +65,7 @@ public function __construct( */ #[Route('/mypage/delivery', name: 'mypage_delivery', methods: ['GET'])] #[Template('Mypage/delivery.twig')] - public function index(Request $request) + public function index(Request $request): array { $Customer = $this->getUser(); @@ -87,7 +87,7 @@ public function index(Request $request) #[Route('/mypage/delivery/new', name: 'mypage_delivery_new', methods: ['GET', 'POST'])] #[Route('/mypage/delivery/{id}/edit', name: 'mypage_delivery_edit', requirements: ['id' => '\d+'], methods: ['GET', 'POST'])] #[Template('Mypage/delivery_edit.twig')] - public function edit(Request $request, $id = null) + public function edit(Request $request, $id = null): \Symfony\Component\HttpFoundation\RedirectResponse|array { /** @var Customer $Customer */ $Customer = $this->getUser(); @@ -192,7 +192,7 @@ public function edit(Request $request, $id = null) * @throws \Exception */ #[Route('/mypage/delivery/{id}/delete', name: 'mypage_delivery_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, CustomerAddress $CustomerAddress) + public function delete(Request $request, CustomerAddress $CustomerAddress): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); diff --git a/src/Eccube/Controller/Mypage/MypageController.php b/src/Eccube/Controller/Mypage/MypageController.php index 4b037b4f9a1..a08ead3e199 100644 --- a/src/Eccube/Controller/Mypage/MypageController.php +++ b/src/Eccube/Controller/Mypage/MypageController.php @@ -102,7 +102,7 @@ public function __construct( */ #[Route('/mypage/login', name: 'mypage_login', methods: ['GET', 'POST'])] #[Template('Mypage/login.twig')] - public function login(Request $request, AuthenticationUtils $utils) + public function login(Request $request, AuthenticationUtils $utils): \Symfony\Component\HttpFoundation\RedirectResponse|array { if ($this->isGranted('IS_AUTHENTICATED_FULLY')) { log_info('認証済のためログイン処理をスキップ'); @@ -149,7 +149,7 @@ public function login(Request $request, AuthenticationUtils $utils) */ #[Route('/mypage/', name: 'mypage', methods: ['GET'])] #[Template('Mypage/index.twig')] - public function index(Request $request, PaginatorInterface $paginator) + public function index(Request $request, PaginatorInterface $paginator): array { /** @var Customer $Customer */ $Customer = $this->getUser(); @@ -192,7 +192,7 @@ public function index(Request $request, PaginatorInterface $paginator) */ #[Route('/mypage/history/{order_no}', name: 'mypage_history', methods: ['GET'])] #[Template('Mypage/history.twig')] - public function history(Request $request, $order_no) + public function history(Request $request, $order_no): array { $this->entityManager->getFilters() ->enable('incomplete_order_status_hidden'); @@ -243,7 +243,7 @@ public function history(Request $request, $order_no) * @throws NotFoundHttpException */ #[Route('/mypage/order/{order_no}', name: 'mypage_order', methods: ['PUT'])] - public function order(Request $request, $order_no) + public function order(Request $request, $order_no): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $this->isTokenValid(); @@ -339,7 +339,7 @@ public function order(Request $request, $order_no) */ #[Route('/mypage/favorite', name: 'mypage_favorite', methods: ['GET'])] #[Template('Mypage/favorite.twig')] - public function favorite(Request $request, PaginatorInterface $paginator) + public function favorite(Request $request, PaginatorInterface $paginator): array { if (!$this->BaseInfo->isOptionFavoriteProduct()) { throw new NotFoundHttpException(); @@ -382,7 +382,7 @@ public function favorite(Request $request, PaginatorInterface $paginator) * @throws BadRequestHttpException */ #[Route('/mypage/favorite/{id}/delete', name: 'mypage_favorite_delete', requirements: ['id' => '\d+'], methods: ['DELETE'])] - public function delete(Request $request, Product $Product) + public function delete(Request $request, Product $Product): \Symfony\Component\HttpFoundation\RedirectResponse { $this->isTokenValid(); /** @var Customer $Customer */ diff --git a/src/Eccube/Controller/Mypage/WithdrawController.php b/src/Eccube/Controller/Mypage/WithdrawController.php index 380e5f627c9..1cebca860e2 100644 --- a/src/Eccube/Controller/Mypage/WithdrawController.php +++ b/src/Eccube/Controller/Mypage/WithdrawController.php @@ -96,7 +96,7 @@ public function __construct( #[Route('/mypage/withdraw', name: 'mypage_withdraw', methods: ['GET', 'POST'])] #[Route('/mypage/withdraw', name: 'mypage_withdraw_confirm', methods: ['GET', 'POST'])] #[Template('Mypage/withdraw.twig')] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse|array { $builder = $this->formFactory->createBuilder(); @@ -179,7 +179,7 @@ public function index(Request $request) */ #[Route('/mypage/withdraw_complete', name: 'mypage_withdraw_complete', methods: ['GET'])] #[Template('Mypage/withdraw_complete.twig')] - public function complete(Request $request) + public function complete(Request $request): array { return []; } diff --git a/src/Eccube/Controller/NonMemberShoppingController.php b/src/Eccube/Controller/NonMemberShoppingController.php index b6b36133259..965206fface 100644 --- a/src/Eccube/Controller/NonMemberShoppingController.php +++ b/src/Eccube/Controller/NonMemberShoppingController.php @@ -77,7 +77,7 @@ public function __construct( */ #[Route('/shopping/nonmember', name: 'shopping_nonmember', methods: ['GET', 'POST'])] #[Template('Shopping/nonmember.twig')] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response|array { // ログイン済みの場合は, 購入画面へリダイレクト. if ($this->isGranted('ROLE_USER')) { @@ -145,7 +145,7 @@ public function index(Request $request) * @throws \Exception */ #[Route('/shopping/customer', name: 'shopping_customer', methods: ['POST'])] - public function customer(Request $request) + public function customer(Request $request): \Symfony\Component\HttpFoundation\JsonResponse|\Symfony\Component\HttpFoundation\RedirectResponse { if (!$request->isXmlHttpRequest()) { return $this->json(['status' => 'NG'], 400); @@ -234,7 +234,7 @@ public function customer(Request $request) * * @return \Symfony\Component\Validator\ConstraintViolationListInterface[] */ - protected function customerValidation(array &$data) + protected function customerValidation(array &$data): array { // 入力チェック $errors = []; diff --git a/src/Eccube/Controller/ProductController.php b/src/Eccube/Controller/ProductController.php index b72a7f1ea4e..be95c21bbd5 100644 --- a/src/Eccube/Controller/ProductController.php +++ b/src/Eccube/Controller/ProductController.php @@ -117,7 +117,7 @@ public function __construct( */ #[Route('/products/list', name: 'product_list', methods: ['GET'])] #[Template('Product/list.twig')] - public function index(Request $request, PaginatorInterface $paginator) + public function index(Request $request, PaginatorInterface $paginator): array { // Doctrine SQLFilter if ($this->BaseInfo->isOptionNostockHidden()) { @@ -221,7 +221,7 @@ public function index(Request $request, PaginatorInterface $paginator) */ #[Route('/products/detail/{id}', name: 'product_detail', requirements: ['id' => '\d+'], methods: ['GET'])] #[Template('Product/detail.twig')] - public function detail(Request $request, #[MapEntity(expr: 'repository.findWithSortedClassCategories(id)')] Product $Product) + public function detail(Request $request, #[MapEntity(expr: 'repository.findWithSortedClassCategories(id)')] Product $Product): array { if (!$this->checkVisibility($Product)) { throw new NotFoundHttpException(); @@ -271,7 +271,7 @@ public function detail(Request $request, #[MapEntity(expr: 'repository.findWithS * @return \Symfony\Component\HttpFoundation\RedirectResponse */ #[Route('/products/add_favorite/{id}', name: 'product_add_favorite', requirements: ['id' => '\d+'], methods: ['GET', 'POST'])] - public function addFavorite(Request $request, Product $Product) + public function addFavorite(Request $request, Product $Product): \Symfony\Component\HttpFoundation\RedirectResponse { $this->checkVisibility($Product); @@ -325,7 +325,7 @@ public function addFavorite(Request $request, Product $Product) * @throws NotFoundHttpException */ #[Route('/products/add_cart/{id}', name: 'product_add_cart', requirements: ['id' => '\d+'], methods: ['POST'])] - public function addCart(Request $request, Product $Product) + public function addCart(Request $request, Product $Product): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse { // エラーメッセージの配列 $errorMessages = []; @@ -448,7 +448,7 @@ public function addCart(Request $request, Product $Product) * * @return string */ - protected function getPageTitle($searchData) + protected function getPageTitle($searchData): string { if (isset($searchData['name']) && !empty($searchData['name'])) { return trans('front.product.search_result'); @@ -466,7 +466,7 @@ protected function getPageTitle($searchData) * * @return bool 閲覧可能な場合はtrue */ - protected function checkVisibility(Product $Product) + protected function checkVisibility(Product $Product): bool { $is_admin = $this->session->has('_security_admin'); diff --git a/src/Eccube/Controller/ShippingMultipleController.php b/src/Eccube/Controller/ShippingMultipleController.php index 0f2fd99a716..0be1b591928 100644 --- a/src/Eccube/Controller/ShippingMultipleController.php +++ b/src/Eccube/Controller/ShippingMultipleController.php @@ -117,7 +117,7 @@ public function __construct( */ #[Route('/shopping/shipping_multiple', name: 'shopping_shipping_multiple', methods: ['GET', 'POST'])] #[Template('Shopping/shipping_multiple.twig')] - public function index(Request $request) + public function index(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array { // ログイン状態のチェック. if ($this->orderHelper->isLoginRequired()) { @@ -393,7 +393,7 @@ public function index(Request $request) */ #[Route('/shopping/shipping_multiple_edit', name: 'shopping_shipping_multiple_edit', methods: ['GET', 'POST'])] #[Template('Shopping/shipping_multiple_edit.twig')] - public function shippingMultipleEdit(Request $request) + public function shippingMultipleEdit(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array { // ログイン状態のチェック. if ($this->orderHelper->isLoginRequired()) { diff --git a/src/Eccube/Controller/ShoppingController.php b/src/Eccube/Controller/ShoppingController.php index 047ff61bf63..ba6b6c4c0a4 100644 --- a/src/Eccube/Controller/ShoppingController.php +++ b/src/Eccube/Controller/ShoppingController.php @@ -136,7 +136,7 @@ public function __construct( */ #[Route('/shopping', name: 'shopping', methods: ['GET'])] #[Template('Shopping/index.twig')] - public function index(PurchaseFlow $cartPurchaseFlow) + public function index(PurchaseFlow $cartPurchaseFlow): \Symfony\Component\HttpFoundation\RedirectResponse|array { // ログイン状態のチェック. if ($this->orderHelper->isLoginRequired()) { @@ -221,7 +221,7 @@ public function index(PurchaseFlow $cartPurchaseFlow) */ #[Route('/shopping/redirect_to', name: 'shopping_redirect_to', methods: ['POST'])] #[Template('Shopping/index.twig')] - public function redirectTo(Request $request, RouterInterface $router) + public function redirectTo(Request $request, RouterInterface $router): \Symfony\Component\HttpFoundation\RedirectResponse|array { // ログイン状態のチェック. if ($this->orderHelper->isLoginRequired()) { @@ -305,7 +305,7 @@ public function redirectTo(Request $request, RouterInterface $router) */ #[Route('/shopping/confirm', name: 'shopping_confirm', methods: ['POST'])] #[Template('Shopping/confirm.twig')] - public function confirm(Request $request) + public function confirm(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|Response|array { // ログイン状態のチェック. if ($this->orderHelper->isLoginRequired()) { @@ -370,7 +370,7 @@ public function confirm(Request $request) } $response = $PaymentResult->getResponse(); - if ($response instanceof Response && ($response->isRedirection() || $response->isSuccessful())) { + if ($response->isRedirection() || $response->isSuccessful()) { $this->entityManager->flush(); log_info('[注文確認] PaymentMethod::verifyが指定したレスポンスを表示します.'); @@ -419,7 +419,7 @@ public function confirm(Request $request) */ #[Route('/shopping/checkout', name: 'shopping_checkout', methods: ['POST'])] #[Template('Shopping/confirm.twig')] - public function checkout(Request $request) + public function checkout(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|array|Response { // ログイン状態のチェック. if ($this->orderHelper->isLoginRequired()) { @@ -549,7 +549,7 @@ public function checkout(Request $request) */ #[Route('/shopping/complete', name: 'shopping_complete', methods: ['GET'])] #[Template('Shopping/complete.twig')] - public function complete(Request $request) + public function complete(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|Response|array { log_info('[注文完了] 注文完了画面を表示します.'); @@ -602,7 +602,7 @@ public function complete(Request $request) */ #[Route('/shopping/shipping/{id}', name: 'shopping_shipping', requirements: ['id' => '\d+'], methods: ['GET', 'POST'])] #[Template('Shopping/shipping.twig')] - public function shipping(Request $request, Shipping $Shipping) + public function shipping(Request $request, Shipping $Shipping): \Symfony\Component\HttpFoundation\RedirectResponse|array { // ログイン状態のチェック. if ($this->orderHelper->isLoginRequired()) { @@ -680,7 +680,7 @@ public function shipping(Request $request, Shipping $Shipping) */ #[Route('/shopping/shipping_edit/{id}', name: 'shopping_shipping_edit', requirements: ['id' => '\d+'], methods: ['GET', 'POST'])] #[Template('Shopping/shipping_edit.twig')] - public function shippingEdit(Request $request, Shipping $Shipping) + public function shippingEdit(Request $request, Shipping $Shipping): \Symfony\Component\HttpFoundation\RedirectResponse|array { // ログイン状態のチェック. if ($this->orderHelper->isLoginRequired()) { @@ -793,7 +793,7 @@ public function shippingEdit(Request $request, Shipping $Shipping) */ #[Route('/shopping/login', name: 'shopping_login', methods: ['GET'])] #[Template('Shopping/login.twig')] - public function login(Request $request, AuthenticationUtils $authenticationUtils) + public function login(Request $request, AuthenticationUtils $authenticationUtils): \Symfony\Component\HttpFoundation\RedirectResponse|array { if ($this->isGranted('IS_AUTHENTICATED_FULLY')) { return $this->redirectToRoute('shopping'); @@ -836,7 +836,7 @@ public function login(Request $request, AuthenticationUtils $authenticationUtils */ #[Route('/shopping/error', name: 'shopping_error', methods: ['GET'])] #[Template('Shopping/shopping_error.twig')] - public function error(Request $request, PurchaseFlow $cartPurchaseFlow) + public function error(Request $request, PurchaseFlow $cartPurchaseFlow): Response|array { // 受注とカートのずれを合わせるため, カートのPurchaseFlowをコールする. $Cart = $this->cartService->getCart(); @@ -875,7 +875,7 @@ public function error(Request $request, PurchaseFlow $cartPurchaseFlow) * * @return PaymentMethodInterface */ - private function createPaymentMethod(Order $Order, FormInterface $form) + private function createPaymentMethod(Order $Order, FormInterface $form): PaymentMethodInterface { $PaymentMethod = $this->serviceContainer->get($Order->getPayment()->getMethodClass()); $PaymentMethod->setOrder($Order); @@ -891,7 +891,7 @@ private function createPaymentMethod(Order $Order, FormInterface $form) * * @return \Symfony\Component\HttpFoundation\RedirectResponse|Response|null */ - protected function executeApply(PaymentMethodInterface $paymentMethod) + protected function executeApply(PaymentMethodInterface $paymentMethod): \Symfony\Component\HttpFoundation\RedirectResponse|Response|null { $dispatcher = $paymentMethod->apply(); // 決済処理中. @@ -901,7 +901,7 @@ protected function executeApply(PaymentMethodInterface $paymentMethod) $this->entityManager->flush(); // dispatcherがresponseを保持している場合はresponseを返す - if ($response instanceof Response && ($response->isRedirection() || $response->isSuccessful())) { + if ($response->isRedirection() || $response->isSuccessful()) { log_info('[注文処理] PaymentMethod::applyが指定したレスポンスを表示します.'); return $response; @@ -933,12 +933,12 @@ protected function executeApply(PaymentMethodInterface $paymentMethod) * * @return \Symfony\Component\HttpFoundation\RedirectResponse|Response|null */ - protected function executeCheckout(PaymentMethodInterface $paymentMethod) + protected function executeCheckout(PaymentMethodInterface $paymentMethod): \Symfony\Component\HttpFoundation\RedirectResponse|Response|null { $PaymentResult = $paymentMethod->checkout(); $response = $PaymentResult->getResponse(); // PaymentResultがresponseを保持している場合はresponseを返す - if ($response instanceof Response && ($response->isRedirection() || $response->isSuccessful())) { + if ($response && ($response->isRedirection() || $response->isSuccessful())) { $this->entityManager->flush(); log_info('[注文処理] PaymentMethod::checkoutが指定したレスポンスを表示します.'); diff --git a/src/Eccube/Controller/SitemapController.php b/src/Eccube/Controller/SitemapController.php index d52f862bfed..a59fb6728b7 100644 --- a/src/Eccube/Controller/SitemapController.php +++ b/src/Eccube/Controller/SitemapController.php @@ -80,7 +80,7 @@ public function __construct( * @return Response */ #[Route('/sitemap.xml', name: 'sitemap_xml', methods: ['GET'])] - public function index(PaginatorInterface $paginator) + public function index(PaginatorInterface $paginator): Response { $pageQueryBuilder = $this->pageRepository->createQueryBuilder('p'); $Page = $pageQueryBuilder->select('p') @@ -124,7 +124,7 @@ public function index(PaginatorInterface $paginator) * @return Response */ #[Route('/sitemap_category.xml', name: 'sitemap_category_xml', methods: ['GET'])] - public function category() + public function category(): Response { $Categories = $this->categoryRepository->getList(null, true); @@ -139,7 +139,7 @@ public function category() * @return Response */ #[Route('/sitemap_product_{page}.xml', name: 'sitemap_product_xml', requirements: ['page' => '\d+'], methods: ['GET'])] - public function product(Request $request, PaginatorInterface $paginator) + public function product(Request $request, PaginatorInterface $paginator): Response { // Doctrine SQLFilter if ($this->BaseInfo->isOptionNostockHidden()) { @@ -171,7 +171,7 @@ public function product(Request $request, PaginatorInterface $paginator) * @return Response */ #[Route('/sitemap_page.xml', name: 'sitemap_page_xml', methods: ['GET'])] - public function page() + public function page(): Response { $Pages = $this->pageRepository->getPageList("((p.meta_robots not like '%noindex%' and p.meta_robots not like '%none%') or p.meta_robots IS NULL)"); @@ -209,7 +209,7 @@ public function page() * * @return Response */ - private function outputXml(array $data, $template_name = 'sitemap.xml.twig') + private function outputXml(array $data, $template_name = 'sitemap.xml.twig'): Response { $response = new Response(); $response->headers->set('Content-Type', 'application/xml'); // Content-Typeを設定 diff --git a/src/Eccube/Controller/TopController.php b/src/Eccube/Controller/TopController.php index d8c818b7841..8d4c1bc545f 100644 --- a/src/Eccube/Controller/TopController.php +++ b/src/Eccube/Controller/TopController.php @@ -23,7 +23,7 @@ class TopController extends AbstractController */ #[Route('/', name: 'homepage', methods: ['GET'])] #[Template('index.twig')] - public function index() + public function index(): array { return []; } diff --git a/src/Eccube/Controller/TradeLawController.php b/src/Eccube/Controller/TradeLawController.php index d0ed98d15ef..85c7acb4794 100644 --- a/src/Eccube/Controller/TradeLawController.php +++ b/src/Eccube/Controller/TradeLawController.php @@ -36,7 +36,7 @@ public function __construct( */ #[Route('/help/tradelaw', name: 'help_tradelaw', methods: ['GET'])] #[Template('Help/tradelaw.twig')] - public function index() + public function index(): array { $tradelaws = $this->tradeLawRepository->findBy([], ['sortNo' => 'ASC']); diff --git a/src/Eccube/Controller/UserDataController.php b/src/Eccube/Controller/UserDataController.php index ff2844763dd..9a73fbf7421 100644 --- a/src/Eccube/Controller/UserDataController.php +++ b/src/Eccube/Controller/UserDataController.php @@ -57,7 +57,7 @@ public function __construct( * @throws NotFoundHttpException */ #[Route('/%eccube_user_data_route%/{route}', name: 'user_data', requirements: ['route' => '([0-9a-zA-Z_\-]+\/?)+(?pageRepository->findOneBy( [ diff --git a/src/Eccube/DataCollector/EccubeDataCollector.php b/src/Eccube/DataCollector/EccubeDataCollector.php index e8ba540588b..5ca2c590324 100644 --- a/src/Eccube/DataCollector/EccubeDataCollector.php +++ b/src/Eccube/DataCollector/EccubeDataCollector.php @@ -58,7 +58,7 @@ public function __construct(EccubeConfig $eccubeConfig, PluginRepository $plugin /** * @return string */ - public function getVersion() + public function getVersion(): string { return $this->data['version']; } @@ -66,7 +66,7 @@ public function getVersion() /** * @return array> */ - public function getPlugins() + public function getPlugins(): array { return $this->data['plugins']; } @@ -74,7 +74,7 @@ public function getPlugins() /** * @return string */ - public function getCurrencyCode() + public function getCurrencyCode(): string { return $this->data['currency_code']; } @@ -82,7 +82,7 @@ public function getCurrencyCode() /** * @return string */ - public function getLocaleCode() + public function getLocaleCode(): string { return $this->data['locale_code']; } @@ -90,7 +90,7 @@ public function getLocaleCode() /** * @return string */ - public function getDefaultCurrencyCode() + public function getDefaultCurrencyCode(): string { return $this->data['base_currency_code']; } @@ -98,7 +98,7 @@ public function getDefaultCurrencyCode() /** * @return string */ - public function getDefaultLocaleCode() + public function getDefaultLocaleCode(): string { return $this->data['default_locale_code']; } @@ -109,7 +109,7 @@ public function getDefaultLocaleCode() * @return void */ #[\Override] - public function collect(Request $request, Response $response, ?\Throwable $exception = null) + public function collect(Request $request, Response $response, ?\Throwable $exception = null): void { $this->data['base_currency_code'] = $this->eccubeConfig->get('currency'); $this->data['currency_code'] = $this->eccubeConfig->get('currency'); @@ -151,7 +151,7 @@ public function collect(Request $request, Response $response, ?\Throwable $excep * @return void */ #[\Override] - public function reset() + public function reset(): void { $this->data = []; } @@ -160,7 +160,7 @@ public function reset() * {@inheritdoc} */ #[\Override] - public function getName() + public function getName(): string { return 'eccube_core'; } diff --git a/src/Eccube/DependencyInjection/Compiler/AutoConfigurationTagPass.php b/src/Eccube/DependencyInjection/Compiler/AutoConfigurationTagPass.php index f72e792c893..f372e60622a 100644 --- a/src/Eccube/DependencyInjection/Compiler/AutoConfigurationTagPass.php +++ b/src/Eccube/DependencyInjection/Compiler/AutoConfigurationTagPass.php @@ -37,7 +37,7 @@ class AutoConfigurationTagPass implements CompilerPassInterface * @return void */ #[\Override] - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { foreach ($container->getDefinitions() as $id => $definition) { $this->configureDoctrineEventSubscriberTag($definition); @@ -51,7 +51,7 @@ public function process(ContainerBuilder $container) * * @return void */ - protected function configureDoctrineEventSubscriberTag(Definition $definition) + protected function configureDoctrineEventSubscriberTag(Definition $definition): void { $class = $definition->getClass(); if (!is_subclass_of($class, EventSubscriber::class)) { @@ -71,7 +71,7 @@ protected function configureDoctrineEventSubscriberTag(Definition $definition) * * @return void */ - protected function configureRateLimiterTag($id, Definition $definition) + protected function configureRateLimiterTag($id, Definition $definition): void { if (\str_starts_with((string) $id, 'limiter') && $definition instanceof ChildDefinition @@ -87,7 +87,7 @@ protected function configureRateLimiterTag($id, Definition $definition) * * @return void */ - protected function configurePaymentMethodTag($id, Definition $definition) + protected function configurePaymentMethodTag($id, Definition $definition): void { $class = $definition->getClass(); if (is_subclass_of((string) $class, PaymentMethodInterface::class) && !$definition->isAbstract()) { diff --git a/src/Eccube/DependencyInjection/Compiler/NavCompilerPass.php b/src/Eccube/DependencyInjection/Compiler/NavCompilerPass.php index fbc8e7b0000..f9670f7b35c 100644 --- a/src/Eccube/DependencyInjection/Compiler/NavCompilerPass.php +++ b/src/Eccube/DependencyInjection/Compiler/NavCompilerPass.php @@ -29,7 +29,7 @@ class NavCompilerPass implements CompilerPassInterface * @throws \InvalidArgumentException */ #[\Override] - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { $ids = $container->findTaggedServiceIds(self::NAV_TAG); $nav = $container->getParameter('eccube_nav'); diff --git a/src/Eccube/DependencyInjection/Compiler/PaymentMethodPass.php b/src/Eccube/DependencyInjection/Compiler/PaymentMethodPass.php index ae12ccfc22f..2869c0e5d68 100644 --- a/src/Eccube/DependencyInjection/Compiler/PaymentMethodPass.php +++ b/src/Eccube/DependencyInjection/Compiler/PaymentMethodPass.php @@ -29,7 +29,7 @@ class PaymentMethodPass implements CompilerPassInterface * @throws \InvalidArgumentException */ #[\Override] - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { $ids = $container->findTaggedServiceIds(self::PAYMENT_METHOD_TAG); diff --git a/src/Eccube/DependencyInjection/Compiler/PluginPass.php b/src/Eccube/DependencyInjection/Compiler/PluginPass.php index 97702f0c10f..442b83b5889 100644 --- a/src/Eccube/DependencyInjection/Compiler/PluginPass.php +++ b/src/Eccube/DependencyInjection/Compiler/PluginPass.php @@ -34,7 +34,7 @@ class PluginPass implements CompilerPassInterface * @return void */ #[\Override] - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { // 無効状態のプラグインコード一覧を取得. // 無効なプラグインの一覧はEccubeExtensionで定義している. diff --git a/src/Eccube/DependencyInjection/Compiler/PurchaseFlowPass.php b/src/Eccube/DependencyInjection/Compiler/PurchaseFlowPass.php index 5236300e28b..566d81c0ada 100644 --- a/src/Eccube/DependencyInjection/Compiler/PurchaseFlowPass.php +++ b/src/Eccube/DependencyInjection/Compiler/PurchaseFlowPass.php @@ -43,7 +43,7 @@ class PurchaseFlowPass implements CompilerPassInterface * @throws \ReflectionException */ #[\Override] - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { $flowTypes = [ PurchaseContext::CART_FLOW => $container->findDefinition('eccube.purchase.flow.cart'), diff --git a/src/Eccube/DependencyInjection/Compiler/QueryCustomizerPass.php b/src/Eccube/DependencyInjection/Compiler/QueryCustomizerPass.php index 485f4332de5..03167624db2 100644 --- a/src/Eccube/DependencyInjection/Compiler/QueryCustomizerPass.php +++ b/src/Eccube/DependencyInjection/Compiler/QueryCustomizerPass.php @@ -29,7 +29,7 @@ class QueryCustomizerPass implements CompilerPassInterface * @return void */ #[\Override] - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { $queries = $container->getDefinition(Queries::class); $ids = $container->findTaggedServiceIds(self::QUERY_CUSTOMIZER_TAG); diff --git a/src/Eccube/DependencyInjection/Compiler/TwigBlockPass.php b/src/Eccube/DependencyInjection/Compiler/TwigBlockPass.php index 6e90e95c52c..1bbbaae4ac0 100644 --- a/src/Eccube/DependencyInjection/Compiler/TwigBlockPass.php +++ b/src/Eccube/DependencyInjection/Compiler/TwigBlockPass.php @@ -29,7 +29,7 @@ class TwigBlockPass implements CompilerPassInterface * @throws \InvalidArgumentException */ #[\Override] - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { $ids = $container->findTaggedServiceIds(self::TWIG_BLOCK_TAG); $templates = $container->getParameter('eccube_twig_block_templates'); diff --git a/src/Eccube/DependencyInjection/Compiler/TwigExtensionPass.php b/src/Eccube/DependencyInjection/Compiler/TwigExtensionPass.php index 1db1e71558f..76660e99b90 100644 --- a/src/Eccube/DependencyInjection/Compiler/TwigExtensionPass.php +++ b/src/Eccube/DependencyInjection/Compiler/TwigExtensionPass.php @@ -26,7 +26,7 @@ class TwigExtensionPass implements CompilerPassInterface * @return void */ #[\Override] - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { // 本番時はtwigのurl(), path()を差し替える. if (!$container->getParameter('kernel.debug')) { diff --git a/src/Eccube/DependencyInjection/Compiler/WebServerDocumentRootPass.php b/src/Eccube/DependencyInjection/Compiler/WebServerDocumentRootPass.php index 1e9f8e4be74..c932d3a5c74 100644 --- a/src/Eccube/DependencyInjection/Compiler/WebServerDocumentRootPass.php +++ b/src/Eccube/DependencyInjection/Compiler/WebServerDocumentRootPass.php @@ -37,7 +37,7 @@ public function __construct($docroot = '%kernel.project_dir%/') * @return void */ #[\Override] - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (!$container->hasDefinition('web_server.command.server_run')) { return; diff --git a/src/Eccube/DependencyInjection/EccubeExtension.php b/src/Eccube/DependencyInjection/EccubeExtension.php index 2ccd31b4423..7f615088bb1 100644 --- a/src/Eccube/DependencyInjection/EccubeExtension.php +++ b/src/Eccube/DependencyInjection/EccubeExtension.php @@ -35,7 +35,7 @@ class EccubeExtension extends Extension implements PrependExtensionInterface * @throws \InvalidArgumentException When provided tag is not defined in this extension */ #[\Override] - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { $configuration = new Configuration(); $this->processConfiguration($configuration, $configs); @@ -54,7 +54,7 @@ public function getAlias(): string * @return \Symfony\Component\Config\Definition\ConfigurationInterface|null */ #[\Override] - public function getConfiguration(array $config, ContainerBuilder $container) + public function getConfiguration(array $config, ContainerBuilder $container): ?\Symfony\Component\Config\Definition\ConfigurationInterface { return parent::getConfiguration($config, $container); } @@ -67,7 +67,7 @@ public function getConfiguration(array $config, ContainerBuilder $container) * @return void */ #[\Override] - public function prepend(ContainerBuilder $container) + public function prepend(ContainerBuilder $container): void { // FrameworkBundleの設定を動的に変更する. $this->configureFramework($container); @@ -81,7 +81,7 @@ public function prepend(ContainerBuilder $container) * * @return void */ - protected function configureFramework(ContainerBuilder $container) + protected function configureFramework(ContainerBuilder $container): void { $forceSSL = $container->resolveEnvPlaceholders('%env(ECCUBE_FORCE_SSL)%', true); // envから取得した内容が文字列のため, booleanに変換 @@ -150,7 +150,7 @@ protected function configureFramework(ContainerBuilder $container) * * @throws \Doctrine\DBAL\Exception */ - protected function configurePlugins(ContainerBuilder $container) + protected function configurePlugins(ContainerBuilder $container): void { $pluginDir = $container->getParameter('kernel.project_dir').'/app/Plugin'; $pluginDirs = $this->getPluginDirectories($pluginDir); @@ -216,7 +216,7 @@ protected function configurePlugins(ContainerBuilder $container) * * @return void */ - protected function configureTwigPaths(ContainerBuilder $container, $enabled, $pluginDir) + protected function configureTwigPaths(ContainerBuilder $container, $enabled, $pluginDir): void { $paths = []; $projectDir = $container->getParameter('kernel.project_dir'); @@ -248,7 +248,7 @@ protected function configureTwigPaths(ContainerBuilder $container, $enabled, $pl * * @return void */ - protected function configureTranslations(ContainerBuilder $container, $enabled, $pluginDir) + protected function configureTranslations(ContainerBuilder $container, $enabled, $pluginDir): void { $paths = []; @@ -275,7 +275,7 @@ protected function configureTranslations(ContainerBuilder $container, $enabled, * * @throws \Doctrine\DBAL\Exception */ - protected function isConnected(Connection $conn) + protected function isConnected(Connection $conn): bool { try { if (!is_object($conn->executeQuery('select 1'))) { @@ -295,7 +295,7 @@ protected function isConnected(Connection $conn) * * @return array */ - protected function getPluginDirectories($pluginDir) + protected function getPluginDirectories($pluginDir): array { $finder = (new Finder()) ->in($pluginDir) diff --git a/src/Eccube/DependencyInjection/Facade/AnnotationReaderFacade.php b/src/Eccube/DependencyInjection/Facade/AnnotationReaderFacade.php index bbefd753bee..140d4451bae 100644 --- a/src/Eccube/DependencyInjection/Facade/AnnotationReaderFacade.php +++ b/src/Eccube/DependencyInjection/Facade/AnnotationReaderFacade.php @@ -36,7 +36,7 @@ public function __construct(Reader $Reader) * * @return AnnotationReaderFacade|null */ - public static function init(Reader $Reader) + public static function init(Reader $Reader): ?AnnotationReaderFacade { if (null === self::$instance) { self::$instance = new self($Reader); @@ -50,7 +50,7 @@ public static function init(Reader $Reader) * * @throws \Exception */ - public static function create() + public static function create(): Reader { if (null === self::$instance) { throw new \Exception('Facade is not instantiated'); @@ -62,7 +62,7 @@ public static function create() /** * @return Reader|null */ - public function getAnnotationReader() + public function getAnnotationReader(): ?Reader { return self::$Reader; } diff --git a/src/Eccube/DependencyInjection/Facade/LoggerFacade.php b/src/Eccube/DependencyInjection/Facade/LoggerFacade.php index 77f1a479aa0..8c461ef593e 100644 --- a/src/Eccube/DependencyInjection/Facade/LoggerFacade.php +++ b/src/Eccube/DependencyInjection/Facade/LoggerFacade.php @@ -41,7 +41,7 @@ private function __construct(ContainerInterface $container, Logger $Logger) * * @return LoggerFacade|null */ - public static function init(ContainerInterface $container, Logger $Logger) + public static function init(ContainerInterface $container, Logger $Logger): ?LoggerFacade { if (null === self::$instance) { self::$instance = new self($container, $Logger); @@ -55,7 +55,7 @@ public static function init(ContainerInterface $container, Logger $Logger) * * @throws \Exception */ - public static function create() + public static function create(): Logger { if (null === self::$instance) { throw new \Exception('Facade is not instantiated'); @@ -69,7 +69,7 @@ public static function create() * * @return \Symfony\Bridge\Monolog\Logger */ - public static function getLoggerBy($channel) + public static function getLoggerBy($channel): \Symfony\Bridge\Monolog\Logger { return self::$Container->get('monolog.logger.'.$channel); } diff --git a/src/Eccube/DependencyInjection/Facade/TranslatorFacade.php b/src/Eccube/DependencyInjection/Facade/TranslatorFacade.php index 043af7d9a05..d742a3b1463 100644 --- a/src/Eccube/DependencyInjection/Facade/TranslatorFacade.php +++ b/src/Eccube/DependencyInjection/Facade/TranslatorFacade.php @@ -36,7 +36,7 @@ private function __construct(TranslatorInterface $Translator) * * @return TranslatorFacade|null */ - public static function init(TranslatorInterface $Translator) + public static function init(TranslatorInterface $Translator): ?TranslatorFacade { if (null === self::$instance) { self::$instance = new self($Translator); @@ -50,7 +50,7 @@ public static function init(TranslatorInterface $Translator) * * @throws \Exception */ - public static function create() + public static function create(): TranslatorInterface { if (null === self::$instance) { throw new \Exception('Facade is not instantiated'); diff --git a/src/Eccube/Doctrine/Common/CsvDataFixtures/CsvFixture.php b/src/Eccube/Doctrine/Common/CsvDataFixtures/CsvFixture.php index 97cd6353738..8a395f64a89 100644 --- a/src/Eccube/Doctrine/Common/CsvDataFixtures/CsvFixture.php +++ b/src/Eccube/Doctrine/Common/CsvDataFixtures/CsvFixture.php @@ -46,7 +46,7 @@ public function __construct(?\SplFileObject $file = null) * @return void */ #[\Override] - public function load(ObjectManager $manager) + public function load(ObjectManager $manager): void { if ($manager instanceof EntityManagerInterface === false) { return; @@ -145,7 +145,7 @@ public function load(ObjectManager $manager) * * @return string INSERT 文 */ - public function getSql($table_name, array $headers) + public function getSql($table_name, array $headers): string { return 'INSERT INTO '.$table_name.' ('.implode(', ', $headers).') VALUES ('.implode(', ', array_fill(0, count($headers), '?')).')'; } @@ -155,7 +155,7 @@ public function getSql($table_name, array $headers) * * @return \SplFileObject */ - public function getFile() + public function getFile(): \SplFileObject { return $this->file; } diff --git a/src/Eccube/Doctrine/Common/CsvDataFixtures/Executor/DbalExecutor.php b/src/Eccube/Doctrine/Common/CsvDataFixtures/Executor/DbalExecutor.php index 1f8d8df36da..7c55768f46c 100644 --- a/src/Eccube/Doctrine/Common/CsvDataFixtures/Executor/DbalExecutor.php +++ b/src/Eccube/Doctrine/Common/CsvDataFixtures/Executor/DbalExecutor.php @@ -43,7 +43,7 @@ public function __construct(EntityManagerInterface $entityManager) * {@inheritdoc} */ #[\Override] - public function execute(array $fixtures, $append = false) + public function execute(array $fixtures, $append = false): void { if ($append) { trigger_error('$append parameter is not supported.', E_USER_WARNING); diff --git a/src/Eccube/Doctrine/Common/CsvDataFixtures/Loader.php b/src/Eccube/Doctrine/Common/CsvDataFixtures/Loader.php index 0ff6c67bfda..706be47478d 100644 --- a/src/Eccube/Doctrine/Common/CsvDataFixtures/Loader.php +++ b/src/Eccube/Doctrine/Common/CsvDataFixtures/Loader.php @@ -40,7 +40,7 @@ class Loader * * @throws \InvalidArgumentException|\Exception */ - public function loadFromDirectory($dir) + public function loadFromDirectory($dir): array { if (!dir($dir)) { throw new \InvalidArgumentException(sprintf('"%s" does not exist', $dir)); @@ -94,7 +94,7 @@ function (\SplFileInfo $a, \SplFileInfo $b) use ($definition) { * * @return array fixtures. */ - public function loadFromIterator(\Iterator $Iterator) + public function loadFromIterator(\Iterator $Iterator): array { $fixtures = []; foreach ($Iterator as $fixture) { @@ -110,7 +110,7 @@ public function loadFromIterator(\Iterator $Iterator) /** * @return FixtureInterface[]|CsvFixture[] */ - public function getFixtures() + public function getFixtures(): array { return $this->fixtures; } @@ -120,7 +120,7 @@ public function getFixtures() * * @return void */ - public function addFixture(FixtureInterface $fixture) + public function addFixture(FixtureInterface $fixture): void { $this->fixtures[] = $fixture; } diff --git a/src/Eccube/Doctrine/DBAL/Types/UTCDateTimeType.php b/src/Eccube/Doctrine/DBAL/Types/UTCDateTimeType.php index bb99285daf5..39ea580cc6b 100644 --- a/src/Eccube/Doctrine/DBAL/Types/UTCDateTimeType.php +++ b/src/Eccube/Doctrine/DBAL/Types/UTCDateTimeType.php @@ -37,7 +37,7 @@ class UTCDateTimeType extends DateTimeType * {@inheritdoc} */ #[\Override] - public function convertToDatabaseValue($value, AbstractPlatform $platform) + public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string { if ($value instanceof \DateTime) { $value->setTimezone(self::getUtcTimeZone()); @@ -50,7 +50,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) * {@inheritdoc} */ #[\Override] - public function convertToPHPValue($value, AbstractPlatform $platform) + public function convertToPHPValue($value, AbstractPlatform $platform): ?\DateTimeInterface { if ($value === null || $value instanceof \DateTime) { return $value; @@ -74,7 +74,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) /** * @return \DateTimeZone */ - protected static function getUtcTimeZone() + protected static function getUtcTimeZone(): \DateTimeZone { if (is_null(self::$utc)) { self::$utc = new \DateTimeZone('UTC'); @@ -86,7 +86,7 @@ protected static function getUtcTimeZone() /** * @return \DateTimeZone */ - public static function getTimezone() + public static function getTimezone(): \DateTimeZone { if (is_null(self::$timezone)) { throw new \LogicException(sprintf('%s::$timezone is undefined.', self::class)); @@ -100,7 +100,7 @@ public static function getTimezone() * * @return void */ - public static function setTimeZone($timezone = 'Asia/Tokyo') + public static function setTimeZone($timezone = 'Asia/Tokyo'): void { self::$timezone = new \DateTimeZone($timezone); } @@ -111,7 +111,7 @@ public static function setTimeZone($timezone = 'Asia/Tokyo') * @return true */ #[\Override] - public function requiresSQLCommentHint(AbstractPlatform $platform) + public function requiresSQLCommentHint(AbstractPlatform $platform): true { return true; } diff --git a/src/Eccube/Doctrine/DBAL/Types/UTCDateTimeTzType.php b/src/Eccube/Doctrine/DBAL/Types/UTCDateTimeTzType.php index ac6854b501c..451fd9e5312 100644 --- a/src/Eccube/Doctrine/DBAL/Types/UTCDateTimeTzType.php +++ b/src/Eccube/Doctrine/DBAL/Types/UTCDateTimeTzType.php @@ -37,7 +37,7 @@ class UTCDateTimeTzType extends DateTimeTzType * {@inheritdoc} */ #[\Override] - public function convertToDatabaseValue($value, AbstractPlatform $platform) + public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string { if ($value instanceof \DateTime) { $value->setTimezone(self::getUtcTimeZone()); @@ -50,7 +50,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform) * {@inheritdoc} */ #[\Override] - public function convertToPHPValue($value, AbstractPlatform $platform) + public function convertToPHPValue($value, AbstractPlatform $platform): ?\DateTimeInterface { if ($value === null || $value instanceof \DateTime) { return $value; @@ -74,7 +74,7 @@ public function convertToPHPValue($value, AbstractPlatform $platform) /** * @return \DateTimeZone */ - protected static function getUtcTimeZone() + protected static function getUtcTimeZone(): \DateTimeZone { if (is_null(self::$utc)) { self::$utc = new \DateTimeZone('UTC'); @@ -86,7 +86,7 @@ protected static function getUtcTimeZone() /** * @return \DateTimeZone */ - public static function getTimezone() + public static function getTimezone(): \DateTimeZone { if (is_null(self::$timezone)) { throw new \LogicException(sprintf('%s::$timezone is undefined.', self::class)); @@ -100,7 +100,7 @@ public static function getTimezone() * * @return void */ - public static function setTimeZone($timezone = 'Asia/Tokyo') + public static function setTimeZone($timezone = 'Asia/Tokyo'): void { self::$timezone = new \DateTimeZone($timezone); } @@ -111,7 +111,7 @@ public static function setTimeZone($timezone = 'Asia/Tokyo') * @return true */ #[\Override] - public function requiresSQLCommentHint(AbstractPlatform $platform) + public function requiresSQLCommentHint(AbstractPlatform $platform): true { return true; } diff --git a/src/Eccube/Doctrine/EventSubscriber/InitSubscriber.php b/src/Eccube/Doctrine/EventSubscriber/InitSubscriber.php index 70682eced0e..1e27c616b65 100644 --- a/src/Eccube/Doctrine/EventSubscriber/InitSubscriber.php +++ b/src/Eccube/Doctrine/EventSubscriber/InitSubscriber.php @@ -23,7 +23,7 @@ class InitSubscriber implements EventSubscriber * {@inheritdoc} */ #[\Override] - public function getSubscribedEvents() + public function getSubscribedEvents(): array { return [Events::postConnect]; } @@ -33,7 +33,7 @@ public function getSubscribedEvents() * * @return void */ - public function postConnect(ConnectionEventArgs $args) + public function postConnect(ConnectionEventArgs $args): void { $db = $args->getConnection(); $platform = $args->getConnection()->getDatabasePlatform()->getName(); diff --git a/src/Eccube/Doctrine/EventSubscriber/SaveEventSubscriber.php b/src/Eccube/Doctrine/EventSubscriber/SaveEventSubscriber.php index 395e21cad1a..2f8cdf8e9a3 100644 --- a/src/Eccube/Doctrine/EventSubscriber/SaveEventSubscriber.php +++ b/src/Eccube/Doctrine/EventSubscriber/SaveEventSubscriber.php @@ -45,7 +45,7 @@ public function __construct(Context $requestContext, EccubeConfig $eccubeConfig) * @return array */ #[\Override] - public function getSubscribedEvents() + public function getSubscribedEvents(): array { return [ Events::prePersist, @@ -58,7 +58,7 @@ public function getSubscribedEvents() * * @return void */ - public function prePersist(LifecycleEventArgs $args) + public function prePersist(LifecycleEventArgs $args): void { $entity = $args->getObject(); @@ -85,7 +85,7 @@ public function prePersist(LifecycleEventArgs $args) * * @return void */ - public function preUpdate(LifecycleEventArgs $args) + public function preUpdate(LifecycleEventArgs $args): void { $entity = $args->getObject(); diff --git a/src/Eccube/Doctrine/EventSubscriber/TaxRuleEventSubscriber.php b/src/Eccube/Doctrine/EventSubscriber/TaxRuleEventSubscriber.php index 45fa7aa682d..691e4756190 100644 --- a/src/Eccube/Doctrine/EventSubscriber/TaxRuleEventSubscriber.php +++ b/src/Eccube/Doctrine/EventSubscriber/TaxRuleEventSubscriber.php @@ -37,7 +37,7 @@ public function __construct(TaxRuleService $taxRuleService) /** * @return object|null */ - public function getTaxRuleService() + public function getTaxRuleService(): ?object { return $this->taxRuleService; } @@ -46,7 +46,7 @@ public function getTaxRuleService() * @return array|string[] */ #[\Override] - public function getSubscribedEvents() + public function getSubscribedEvents(): array { return [ Events::prePersist, @@ -61,12 +61,12 @@ public function getSubscribedEvents() * * @return void */ - public function prePersist(LifecycleEventArgs $args) + public function prePersist(LifecycleEventArgs $args): void { $entity = $args->getObject(); if ($entity instanceof ProductClass) { - $entity->setPrice01IncTax($this->getTaxRuleService()->getPriceIncTax($entity->getPrice01() === null ? '0' : $entity->getPrice01(), + $entity->setPrice01IncTax($this->getTaxRuleService()->getPriceIncTax($entity->getPrice01() ?? '0', $entity->getProduct(), $entity)); $entity->setPrice02IncTax($this->getTaxRuleService()->getPriceIncTax($entity->getPrice02(), $entity->getProduct(), $entity)); @@ -78,12 +78,12 @@ public function prePersist(LifecycleEventArgs $args) * * @return void */ - public function postLoad(LifecycleEventArgs $args) + public function postLoad(LifecycleEventArgs $args): void { $entity = $args->getObject(); if ($entity instanceof ProductClass) { - $entity->setPrice01IncTax($this->getTaxRuleService()->getPriceIncTax($entity->getPrice01() === null ? '0' : $entity->getPrice01(), + $entity->setPrice01IncTax($this->getTaxRuleService()->getPriceIncTax($entity->getPrice01() ?? '0', $entity->getProduct(), $entity)); $entity->setPrice02IncTax($this->getTaxRuleService()->getPriceIncTax($entity->getPrice02(), $entity->getProduct(), $entity)); @@ -95,12 +95,12 @@ public function postLoad(LifecycleEventArgs $args) * * @return void */ - public function postPersist(LifecycleEventArgs $args) + public function postPersist(LifecycleEventArgs $args): void { $entity = $args->getObject(); if ($entity instanceof ProductClass) { - $entity->setPrice01IncTax($this->getTaxRuleService()->getPriceIncTax($entity->getPrice01() === null ? '0' : $entity->getPrice01(), + $entity->setPrice01IncTax($this->getTaxRuleService()->getPriceIncTax($entity->getPrice01() ?? '0', $entity->getProduct(), $entity)); $entity->setPrice02IncTax($this->getTaxRuleService()->getPriceIncTax($entity->getPrice02(), $entity->getProduct(), $entity)); @@ -112,12 +112,12 @@ public function postPersist(LifecycleEventArgs $args) * * @return void */ - public function postUpdate(LifecycleEventArgs $args) + public function postUpdate(LifecycleEventArgs $args): void { $entity = $args->getObject(); if ($entity instanceof ProductClass) { - $entity->setPrice01IncTax($this->getTaxRuleService()->getPriceIncTax($entity->getPrice01() === null ? '0' : $entity->getPrice01(), + $entity->setPrice01IncTax($this->getTaxRuleService()->getPriceIncTax($entity->getPrice01() ?? '0', $entity->getProduct(), $entity)); $entity->setPrice02IncTax($this->getTaxRuleService()->getPriceIncTax($entity->getPrice02(), $entity->getProduct(), $entity)); diff --git a/src/Eccube/Doctrine/Filter/NoStockHiddenFilter.php b/src/Eccube/Doctrine/Filter/NoStockHiddenFilter.php index 6ea729d2046..2fdfa94aa10 100644 --- a/src/Eccube/Doctrine/Filter/NoStockHiddenFilter.php +++ b/src/Eccube/Doctrine/Filter/NoStockHiddenFilter.php @@ -19,7 +19,7 @@ class NoStockHiddenFilter extends SQLFilter { #[\Override] - public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) + public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias): string { if ($targetEntity->reflClass->getName() === \Eccube\Entity\ProductClass::class) { return $targetTableAlias.'.stock >= 1 OR '.$targetTableAlias.'.stock_unlimited = true'; diff --git a/src/Eccube/Doctrine/Filter/OrderStatusFilter.php b/src/Eccube/Doctrine/Filter/OrderStatusFilter.php index 709a94b38bc..e297e83e3ac 100644 --- a/src/Eccube/Doctrine/Filter/OrderStatusFilter.php +++ b/src/Eccube/Doctrine/Filter/OrderStatusFilter.php @@ -20,7 +20,7 @@ class OrderStatusFilter extends SQLFilter { #[\Override] - public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) + public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias): string { // 決済処理中/購入処理中を除く. if ($targetEntity->reflClass->getName() === \Eccube\Entity\Order::class) { diff --git a/src/Eccube/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/src/Eccube/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index 2b8ebb72380..b7f3cd3b469 100644 --- a/src/Eccube/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/src/Eccube/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -27,7 +27,7 @@ class AnnotationDriver extends \Doctrine\ORM\Mapping\Driver\AnnotationDriver * * @return void */ - public function setTraitProxiesDirectory($dir) + public function setTraitProxiesDirectory($dir): void { $this->trait_proxies_directory = $dir; } @@ -36,7 +36,7 @@ public function setTraitProxiesDirectory($dir) * {@inheritdoc} */ #[\Override] - public function getAllClassNames() + public function getAllClassNames(): array { if ($this->classNames !== null) { return $this->classNames; diff --git a/src/Eccube/Doctrine/ORM/Mapping/Driver/NopAnnotationDriver.php b/src/Eccube/Doctrine/ORM/Mapping/Driver/NopAnnotationDriver.php index 1fd283050ba..9d7e81d32a4 100644 --- a/src/Eccube/Doctrine/ORM/Mapping/Driver/NopAnnotationDriver.php +++ b/src/Eccube/Doctrine/ORM/Mapping/Driver/NopAnnotationDriver.php @@ -16,7 +16,7 @@ class NopAnnotationDriver extends \Doctrine\ORM\Mapping\Driver\AnnotationDriver { #[\Override] - public function getAllClassNames() + public function getAllClassNames(): array { return []; } diff --git a/src/Eccube/Doctrine/ORM/Mapping/Driver/ReloadSafeAnnotationDriver.php b/src/Eccube/Doctrine/ORM/Mapping/Driver/ReloadSafeAnnotationDriver.php index b638f67a3d8..1b9c122f2d6 100644 --- a/src/Eccube/Doctrine/ORM/Mapping/Driver/ReloadSafeAnnotationDriver.php +++ b/src/Eccube/Doctrine/ORM/Mapping/Driver/ReloadSafeAnnotationDriver.php @@ -40,7 +40,7 @@ class ReloadSafeAnnotationDriver extends AnnotationDriver * * @return void */ - public function setNewProxyFiles($newProxyFiles) + public function setNewProxyFiles($newProxyFiles): void { $this->newProxyFiles = array_map(function ($file) { return realpath($file); @@ -52,7 +52,7 @@ public function setNewProxyFiles($newProxyFiles) * * @return void */ - public function setOutputDir($outputDir) + public function setOutputDir($outputDir): void { $this->outputDir = $outputDir; } @@ -61,7 +61,7 @@ public function setOutputDir($outputDir) * {@inheritdoc} */ #[\Override] - public function getAllClassNames() + public function getAllClassNames(): array { if ($this->classNames !== null) { return $this->classNames; @@ -130,7 +130,7 @@ public function getAllClassNames() * * @return array ソースファイルに含まれるクラス名のリスト */ - private function getClassNamesFromTokens($sourceFile) + private function getClassNamesFromTokens($sourceFile): array { $tokens = Tokens::fromCode(file_get_contents($sourceFile)); $results = []; diff --git a/src/Eccube/Doctrine/ORM/Query/Extract.php b/src/Eccube/Doctrine/ORM/Query/Extract.php index d92fd055eb9..4988bf6cf4c 100644 --- a/src/Eccube/Doctrine/ORM/Query/Extract.php +++ b/src/Eccube/Doctrine/ORM/Query/Extract.php @@ -76,7 +76,7 @@ class Extract extends FunctionNode ]; #[\Override] - public function parse(Parser $parser) + public function parse(Parser $parser): void { $lexer = $parser->getLexer(); $parser->match(Lexer::T_IDENTIFIER); @@ -106,7 +106,7 @@ public function parse(Parser $parser) } #[\Override] - public function getSql(SqlWalker $sqlWalker) + public function getSql(SqlWalker $sqlWalker): string { $driver = $sqlWalker->getConnection()->getDriver()->getDatabasePlatform()->getName(); // UTCとの時差(秒数) diff --git a/src/Eccube/Doctrine/ORM/Query/Normalize.php b/src/Eccube/Doctrine/ORM/Query/Normalize.php index f732a03fc54..3963c75f2d1 100644 --- a/src/Eccube/Doctrine/ORM/Query/Normalize.php +++ b/src/Eccube/Doctrine/ORM/Query/Normalize.php @@ -28,7 +28,7 @@ class Normalize extends FunctionNode public const TO = 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポァィゥェォッャュョヮヰヱー'; #[\Override] - public function parse(Parser $parser) + public function parse(Parser $parser): void { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); @@ -37,7 +37,7 @@ public function parse(Parser $parser) } #[\Override] - public function getSql(SqlWalker $sqlWalker) + public function getSql(SqlWalker $sqlWalker): string { $sql = match ($sqlWalker->getConnection()->getDriver()->getDatabasePlatform()->getName()) { 'postgresql' => sprintf("LOWER(TRANSLATE(%s, '%s', '%s'))", $this->string->dispatch($sqlWalker), self::FROM, self::TO), diff --git a/src/Eccube/Doctrine/Query/JoinClause.php b/src/Eccube/Doctrine/Query/JoinClause.php index 3129cdd391c..61642fa6c20 100644 --- a/src/Eccube/Doctrine/Query/JoinClause.php +++ b/src/Eccube/Doctrine/Query/JoinClause.php @@ -122,7 +122,7 @@ public static function leftJoin($join, $alias, $conditionType = null, $condition * * @return $this */ - public function addWhere(WhereClause $whereClause): self + public function addWhere(WhereClause $whereClause): static { $this->whereCustomizer->add($whereClause); @@ -136,7 +136,7 @@ public function addWhere(WhereClause $whereClause): self * * @return $this */ - public function addOrderBy(OrderByClause $orderByClause): self + public function addOrderBy(OrderByClause $orderByClause): static { $this->orderByCustomizer->add($orderByClause); @@ -148,7 +148,7 @@ public function addOrderBy(OrderByClause $orderByClause): self * * @return void */ - public function build(QueryBuilder $builder) + public function build(QueryBuilder $builder): void { if ($this->leftJoin) { $builder->leftJoin($this->join, $this->alias, $this->conditionType, $this->condition, $this->indexBy); @@ -208,7 +208,7 @@ class JoinClauseOrderByCustomizer extends OrderByCustomizer * * @return void */ - public function add(OrderByClause $orderByClause) + public function add(OrderByClause $orderByClause): void { $this->orderByClauses[] = $orderByClause; } diff --git a/src/Eccube/Doctrine/Query/JoinCustomizer.php b/src/Eccube/Doctrine/Query/JoinCustomizer.php index 5e8da520c3c..551f61d1751 100644 --- a/src/Eccube/Doctrine/Query/JoinCustomizer.php +++ b/src/Eccube/Doctrine/Query/JoinCustomizer.php @@ -28,7 +28,7 @@ abstract class JoinCustomizer implements QueryCustomizer * @return void */ #[\Override] - final public function customize(QueryBuilder $builder, $params, $queryKey) + final public function customize(QueryBuilder $builder, $params, $queryKey): void { foreach ($this->createStatements($params, $queryKey) as $joinClause) { $joinClause->build($builder); @@ -44,5 +44,5 @@ final public function customize(QueryBuilder $builder, $params, $queryKey) * * @return JoinClause[] */ - abstract public function createStatements($params, $queryKey); + abstract public function createStatements($params, $queryKey): array; } diff --git a/src/Eccube/Doctrine/Query/OrderByClause.php b/src/Eccube/Doctrine/Query/OrderByClause.php index 4f00f88e01c..96efdc128a9 100644 --- a/src/Eccube/Doctrine/Query/OrderByClause.php +++ b/src/Eccube/Doctrine/Query/OrderByClause.php @@ -43,7 +43,7 @@ public function __construct($sort, $order = 'asc') /** * @return string */ - public function getSort() + public function getSort(): string { return $this->sort; } @@ -51,7 +51,7 @@ public function getSort() /** * @return string */ - public function getOrder() + public function getOrder(): string { return $this->order; } diff --git a/src/Eccube/Doctrine/Query/OrderByCustomizer.php b/src/Eccube/Doctrine/Query/OrderByCustomizer.php index 968be00b1ff..d9704e3ce6d 100644 --- a/src/Eccube/Doctrine/Query/OrderByCustomizer.php +++ b/src/Eccube/Doctrine/Query/OrderByCustomizer.php @@ -28,7 +28,7 @@ abstract class OrderByCustomizer implements QueryCustomizer * @return void */ #[\Override] - final public function customize(QueryBuilder $builder, $params, $queryKey) + final public function customize(QueryBuilder $builder, $params, $queryKey): void { foreach ($this->createStatements($params, $queryKey) as $index => $orderByClause) { if ($index === 0) { @@ -48,5 +48,5 @@ final public function customize(QueryBuilder $builder, $params, $queryKey) * * @return OrderByClause[] */ - abstract protected function createStatements($params, $queryKey); + abstract protected function createStatements($params, $queryKey): array; } diff --git a/src/Eccube/Doctrine/Query/Queries.php b/src/Eccube/Doctrine/Query/Queries.php index 6eee394e7be..1b1a379533d 100644 --- a/src/Eccube/Doctrine/Query/Queries.php +++ b/src/Eccube/Doctrine/Query/Queries.php @@ -27,7 +27,7 @@ class Queries * * @return void */ - public function addCustomizer(QueryCustomizer $customizer) + public function addCustomizer(QueryCustomizer $customizer): void { $queryKey = $customizer->getQueryKey(); $this->customizers[$queryKey][] = $customizer; @@ -40,7 +40,7 @@ public function addCustomizer(QueryCustomizer $customizer) * * @return QueryBuilder */ - public function customize($queryKey, QueryBuilder $builder, $params) + public function customize($queryKey, QueryBuilder $builder, $params): QueryBuilder { if (isset($this->customizers[$queryKey])) { /* @var QueryCustomizer $customizer */ diff --git a/src/Eccube/Doctrine/Query/QueryCustomizer.php b/src/Eccube/Doctrine/Query/QueryCustomizer.php index 0bf7079b40f..7bdbdf395b4 100644 --- a/src/Eccube/Doctrine/Query/QueryCustomizer.php +++ b/src/Eccube/Doctrine/Query/QueryCustomizer.php @@ -29,12 +29,12 @@ interface QueryCustomizer * * @return void */ - public function customize(QueryBuilder $builder, $params, $queryKey); + public function customize(QueryBuilder $builder, $params, $queryKey): void; /** * カスタマイズ対象のキーを返します。 * * @return string */ - public function getQueryKey(); + public function getQueryKey(): string; } diff --git a/src/Eccube/Doctrine/Query/WhereClause.php b/src/Eccube/Doctrine/Query/WhereClause.php index 72ab8cf4851..3c8dc67fd0c 100644 --- a/src/Eccube/Doctrine/Query/WhereClause.php +++ b/src/Eccube/Doctrine/Query/WhereClause.php @@ -48,7 +48,7 @@ private function __construct($expr, $params = null) * * @return self */ - private static function newWhereClause($expr, $x, $y) + private static function newWhereClause($expr, $x, $y): WhereClause { if (is_array($y)) { return new WhereClause($expr, $y); @@ -70,7 +70,7 @@ private static function newWhereClause($expr, $x, $y) * * @return WhereClause */ - public static function eq($x, $y, $param) + public static function eq($x, $y, $param): WhereClause { return self::newWhereClause(self::expr()->eq($x, $y), $y, $param); } @@ -88,7 +88,7 @@ public static function eq($x, $y, $param) * * @return WhereClause */ - public static function neq($x, $y, $param) + public static function neq($x, $y, $param): WhereClause { return self::newWhereClause(self::expr()->neq($x, $y), $y, $param); } @@ -103,7 +103,7 @@ public static function neq($x, $y, $param) * * @return WhereClause */ - public static function isNull($x) + public static function isNull($x): WhereClause { return new WhereClause(self::expr()->isNull($x)); } @@ -118,7 +118,7 @@ public static function isNull($x) * * @return WhereClause */ - public static function isNotNull($x) + public static function isNotNull($x): WhereClause { return new WhereClause(self::expr()->isNotNull($x)); } @@ -136,7 +136,7 @@ public static function isNotNull($x) * * @return WhereClause */ - public static function like($x, $y, $param) + public static function like($x, $y, $param): WhereClause { return self::newWhereClause(self::expr()->like($x, $y), $y, $param); } @@ -154,7 +154,7 @@ public static function like($x, $y, $param) * * @return WhereClause */ - public static function notLike($x, $y, $param) + public static function notLike($x, $y, $param): WhereClause { return self::newWhereClause(self::expr()->notLike($x, $y), $y, $param); } @@ -172,7 +172,7 @@ public static function notLike($x, $y, $param) * * @return WhereClause */ - public static function in($x, $y, $param) + public static function in($x, $y, $param): WhereClause { return new WhereClause(self::expr()->in($x, $y), self::isMap($param) ? $param : [$y => $param]); } @@ -182,7 +182,7 @@ public static function in($x, $y, $param) * * @return bool */ - private static function isMap($arrayOrMap) + private static function isMap($arrayOrMap): bool { return array_values($arrayOrMap) !== $arrayOrMap; } @@ -200,7 +200,7 @@ private static function isMap($arrayOrMap) * * @return WhereClause */ - public static function notIn($x, $y, $param) + public static function notIn($x, $y, $param): WhereClause { return new WhereClause(self::expr()->notIn($x, $y), self::isMap($param) ? $param : [$y => $param]); } @@ -219,7 +219,7 @@ public static function notIn($x, $y, $param) * * @return WhereClause */ - public static function between($var, $x, $y, $params) + public static function between($var, $x, $y, $params): WhereClause { return new WhereClause(self::expr()->between($var, $x, $y), self::isMap($params) ? $params : [$x => $params[0], $y => $params[1]]); } @@ -237,7 +237,7 @@ public static function between($var, $x, $y, $params) * * @return WhereClause */ - public static function gt($x, $y, $param) + public static function gt($x, $y, $param): WhereClause { return self::newWhereClause(self::expr()->gt($x, $y), $y, $param); } @@ -255,7 +255,7 @@ public static function gt($x, $y, $param) * * @return WhereClause */ - public static function gte($x, $y, $param) + public static function gte($x, $y, $param): WhereClause { return self::newWhereClause(self::expr()->gte($x, $y), $y, $param); } @@ -273,7 +273,7 @@ public static function gte($x, $y, $param) * * @return WhereClause */ - public static function lt($x, $y, $param) + public static function lt($x, $y, $param): WhereClause { return self::newWhereClause(self::expr()->lt($x, $y), $y, $param); } @@ -291,7 +291,7 @@ public static function lt($x, $y, $param) * * @return WhereClause */ - public static function lte($x, $y, $param) + public static function lte($x, $y, $param): WhereClause { return self::newWhereClause(self::expr()->lte($x, $y), $y, $param); } @@ -299,7 +299,7 @@ public static function lte($x, $y, $param) /** * @return Expr */ - private static function expr() + private static function expr(): Expr { return new Expr(); } @@ -311,7 +311,7 @@ private static function expr() * * @return void */ - public function build(QueryBuilder $builder) + public function build(QueryBuilder $builder): void { $builder->andWhere($this->expr); if ($this->params) { diff --git a/src/Eccube/Doctrine/Query/WhereCustomizer.php b/src/Eccube/Doctrine/Query/WhereCustomizer.php index 2ffa9581281..326f0af1ffc 100644 --- a/src/Eccube/Doctrine/Query/WhereCustomizer.php +++ b/src/Eccube/Doctrine/Query/WhereCustomizer.php @@ -25,7 +25,7 @@ abstract class WhereCustomizer implements QueryCustomizer * @return void */ #[\Override] - final public function customize(QueryBuilder $builder, $params, $queryKey) + final public function customize(QueryBuilder $builder, $params, $queryKey): void { foreach ($this->createStatements($params, $queryKey) as $whereClause) { $whereClause->build($builder); @@ -38,5 +38,5 @@ final public function customize(QueryBuilder $builder, $params, $queryKey) * * @return WhereClause[] */ - abstract protected function createStatements($params, $queryKey); + abstract protected function createStatements($params, $queryKey): array; } diff --git a/src/Eccube/Entity/AbstractEntity.php b/src/Eccube/Entity/AbstractEntity.php index 82be9e09114..89702b8a77f 100644 --- a/src/Eccube/Entity/AbstractEntity.php +++ b/src/Eccube/Entity/AbstractEntity.php @@ -34,7 +34,7 @@ abstract class AbstractEntity implements \ArrayAccess { #[\ReturnTypeWillChange] #[\Override] - public function offsetExists($offset) + public function offsetExists($offset): bool { $inflector = new Inflector(new NoopWordInflector(), new NoopWordInflector()); $method = $inflector->classify($offset); @@ -47,13 +47,13 @@ public function offsetExists($offset) #[\ReturnTypeWillChange] #[\Override] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { } #[\ReturnTypeWillChange] #[\Override] - public function offsetGet($offset) + public function offsetGet($offset): mixed { $inflector = new Inflector(new NoopWordInflector(), new NoopWordInflector()); $method = $inflector->classify($offset); @@ -67,11 +67,13 @@ public function offsetGet($offset) } elseif (method_exists($this, "has$method")) { return $this->{"has$method"}(); } + + return null; } #[\ReturnTypeWillChange] #[\Override] - public function offsetUnset($offset) + public function offsetUnset($offset): void { } @@ -85,7 +87,7 @@ public function offsetUnset($offset) * * @return void */ - public function setPropertiesFromArray(array $arrProps, array $excludeAttribute = [], ?\ReflectionClass $parentClass = null) + public function setPropertiesFromArray(array $arrProps, array $excludeAttribute = [], ?\ReflectionClass $parentClass = null): void { if (is_object($parentClass)) { $objReflect = $parentClass; @@ -120,7 +122,7 @@ public function setPropertiesFromArray(array $arrProps, array $excludeAttribute * * @return array */ - public function toArray(array $excludeAttribute = ['__initializer__', '__cloner__', '__isInitialized__'], ?\ReflectionClass $parentClass = null) + public function toArray(array $excludeAttribute = ['__initializer__', '__cloner__', '__isInitialized__'], ?\ReflectionClass $parentClass = null): array { if (is_object($parentClass)) { $objReflect = $parentClass; @@ -165,7 +167,7 @@ public function toArray(array $excludeAttribute = ['__initializer__', '__cloner_ * * @return array */ - public function toNormalizedArray(array $excludeAttribute = ['__initializer__', '__cloner__', '__isInitialized__']) + public function toNormalizedArray(array $excludeAttribute = ['__initializer__', '__cloner__', '__isInitialized__']): array { $arrResult = $this->toArray($excludeAttribute); foreach ($arrResult as &$value) { @@ -196,7 +198,7 @@ public function toNormalizedArray(array $excludeAttribute = ['__initializer__', * * @return string */ - public function toJSON(array $excludeAttribute = ['__initializer__', '__cloner__', '__isInitialized__']) + public function toJSON(array $excludeAttribute = ['__initializer__', '__cloner__', '__isInitialized__']): string { return json_encode($this->toNormalizedArray($excludeAttribute)); } @@ -208,7 +210,7 @@ public function toJSON(array $excludeAttribute = ['__initializer__', '__cloner__ * * @return string */ - public function toXML(array $excludeAttribute = ['__initializer__', '__cloner__', '__isInitialized__']) + public function toXML(array $excludeAttribute = ['__initializer__', '__cloner__', '__isInitialized__']): string { $ReflectionClass = new \ReflectionClass($this); $serializer = new Serializer([new PropertyNormalizer()], [new XmlEncoder([XmlEncoder::ROOT_NODE_NAME => $ReflectionClass->getShortName()])]); @@ -230,7 +232,7 @@ public function toXML(array $excludeAttribute = ['__initializer__', '__cloner__' * * @return AbstractEntity */ - public function copyProperties($srcObject, array $excludeAttribute = []) + public function copyProperties($srcObject, array $excludeAttribute = []): AbstractEntity { $this->setPropertiesFromArray($srcObject->toArray($excludeAttribute), $excludeAttribute); @@ -244,7 +246,7 @@ public function copyProperties($srcObject, array $excludeAttribute = []) * * @return array associative array of [[id => value], [id => value], ...] */ - public function getEntityIdentifierAsArray(AbstractEntity $Entity) + public function getEntityIdentifierAsArray(AbstractEntity $Entity): array { $Result = []; $PropReflect = new \ReflectionClass($Entity); diff --git a/src/Eccube/Entity/AuthorityRole.php b/src/Eccube/Entity/AuthorityRole.php index ddbe401ca31..81049e8faf0 100644 --- a/src/Eccube/Entity/AuthorityRole.php +++ b/src/Eccube/Entity/AuthorityRole.php @@ -92,9 +92,9 @@ class AuthorityRole extends AbstractEntity /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -106,7 +106,7 @@ public function getId() * * @return AuthorityRole */ - public function setDenyUrl($denyUrl) + public function setDenyUrl($denyUrl): AuthorityRole { $this->deny_url = $denyUrl; @@ -116,9 +116,9 @@ public function setDenyUrl($denyUrl) /** * Get denyUrl. * - * @return string + * @return string|null */ - public function getDenyUrl() + public function getDenyUrl(): ?string { return $this->deny_url; } @@ -130,7 +130,7 @@ public function getDenyUrl() * * @return AuthorityRole */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): AuthorityRole { $this->create_date = $createDate; @@ -140,9 +140,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -154,7 +154,7 @@ public function getCreateDate() * * @return AuthorityRole */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): AuthorityRole { $this->update_date = $updateDate; @@ -164,9 +164,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -178,7 +178,7 @@ public function getUpdateDate() * * @return AuthorityRole */ - public function setAuthority(?Master\Authority $authority = null) + public function setAuthority(?Master\Authority $authority = null): AuthorityRole { $this->Authority = $authority; @@ -190,7 +190,7 @@ public function setAuthority(?Master\Authority $authority = null) * * @return Master\Authority|null */ - public function getAuthority() + public function getAuthority(): ?Master\Authority { return $this->Authority; } @@ -202,7 +202,7 @@ public function getAuthority() * * @return AuthorityRole */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): AuthorityRole { $this->Creator = $creator; @@ -214,7 +214,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } diff --git a/src/Eccube/Entity/BaseInfo.php b/src/Eccube/Entity/BaseInfo.php index 699562df456..ba364983c15 100644 --- a/src/Eccube/Entity/BaseInfo.php +++ b/src/Eccube/Entity/BaseInfo.php @@ -319,7 +319,7 @@ class BaseInfo extends AbstractEntity * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -331,7 +331,7 @@ public function getId() * * @return BaseInfo */ - public function setCompanyName($companyName = null) + public function setCompanyName($companyName = null): BaseInfo { $this->company_name = $companyName; @@ -343,7 +343,7 @@ public function setCompanyName($companyName = null) * * @return string|null */ - public function getCompanyName() + public function getCompanyName(): ?string { return $this->company_name; } @@ -355,7 +355,7 @@ public function getCompanyName() * * @return BaseInfo */ - public function setCompanyKana($companyKana = null) + public function setCompanyKana($companyKana = null): BaseInfo { $this->company_kana = $companyKana; @@ -367,7 +367,7 @@ public function setCompanyKana($companyKana = null) * * @return string|null */ - public function getCompanyKana() + public function getCompanyKana(): ?string { return $this->company_kana; } @@ -379,7 +379,7 @@ public function getCompanyKana() * * @return BaseInfo */ - public function setPostalCode($postal_code = null) + public function setPostalCode($postal_code = null): BaseInfo { $this->postal_code = $postal_code; @@ -391,7 +391,7 @@ public function setPostalCode($postal_code = null) * * @return string|null */ - public function getPostalCode() + public function getPostalCode(): ?string { return $this->postal_code; } @@ -403,7 +403,7 @@ public function getPostalCode() * * @return BaseInfo */ - public function setAddr01($addr01 = null) + public function setAddr01($addr01 = null): BaseInfo { $this->addr01 = $addr01; @@ -415,7 +415,7 @@ public function setAddr01($addr01 = null) * * @return string|null */ - public function getAddr01() + public function getAddr01(): ?string { return $this->addr01; } @@ -427,7 +427,7 @@ public function getAddr01() * * @return BaseInfo */ - public function setAddr02($addr02 = null) + public function setAddr02($addr02 = null): BaseInfo { $this->addr02 = $addr02; @@ -439,7 +439,7 @@ public function setAddr02($addr02 = null) * * @return string|null */ - public function getAddr02() + public function getAddr02(): ?string { return $this->addr02; } @@ -451,7 +451,7 @@ public function getAddr02() * * @return BaseInfo */ - public function setPhoneNumber($phone_number = null) + public function setPhoneNumber($phone_number = null): BaseInfo { $this->phone_number = $phone_number; @@ -463,7 +463,7 @@ public function setPhoneNumber($phone_number = null) * * @return string|null */ - public function getPhoneNumber() + public function getPhoneNumber(): ?string { return $this->phone_number; } @@ -475,7 +475,7 @@ public function getPhoneNumber() * * @return BaseInfo */ - public function setBusinessHour($businessHour = null) + public function setBusinessHour($businessHour = null): BaseInfo { $this->business_hour = $businessHour; @@ -487,7 +487,7 @@ public function setBusinessHour($businessHour = null) * * @return string|null */ - public function getBusinessHour() + public function getBusinessHour(): ?string { return $this->business_hour; } @@ -499,7 +499,7 @@ public function getBusinessHour() * * @return BaseInfo */ - public function setEmail01($email01 = null) + public function setEmail01($email01 = null): BaseInfo { $this->email01 = $email01; @@ -511,7 +511,7 @@ public function setEmail01($email01 = null) * * @return string|null */ - public function getEmail01() + public function getEmail01(): ?string { return $this->email01; } @@ -523,7 +523,7 @@ public function getEmail01() * * @return BaseInfo */ - public function setEmail02($email02 = null) + public function setEmail02($email02 = null): BaseInfo { $this->email02 = $email02; @@ -535,7 +535,7 @@ public function setEmail02($email02 = null) * * @return string|null */ - public function getEmail02() + public function getEmail02(): ?string { return $this->email02; } @@ -547,7 +547,7 @@ public function getEmail02() * * @return BaseInfo */ - public function setEmail03($email03 = null) + public function setEmail03($email03 = null): BaseInfo { $this->email03 = $email03; @@ -559,7 +559,7 @@ public function setEmail03($email03 = null) * * @return string|null */ - public function getEmail03() + public function getEmail03(): ?string { return $this->email03; } @@ -571,7 +571,7 @@ public function getEmail03() * * @return BaseInfo */ - public function setEmail04($email04 = null) + public function setEmail04($email04 = null): BaseInfo { $this->email04 = $email04; @@ -583,7 +583,7 @@ public function setEmail04($email04 = null) * * @return string|null */ - public function getEmail04() + public function getEmail04(): ?string { return $this->email04; } @@ -595,7 +595,7 @@ public function getEmail04() * * @return BaseInfo */ - public function setShopName($shopName = null) + public function setShopName($shopName = null): BaseInfo { $this->shop_name = $shopName; @@ -607,7 +607,7 @@ public function setShopName($shopName = null) * * @return string|null */ - public function getShopName() + public function getShopName(): ?string { return $this->shop_name; } @@ -619,7 +619,7 @@ public function getShopName() * * @return BaseInfo */ - public function setShopKana($shopKana = null) + public function setShopKana($shopKana = null): BaseInfo { $this->shop_kana = $shopKana; @@ -631,7 +631,7 @@ public function setShopKana($shopKana = null) * * @return string|null */ - public function getShopKana() + public function getShopKana(): ?string { return $this->shop_kana; } @@ -643,7 +643,7 @@ public function getShopKana() * * @return BaseInfo */ - public function setShopNameEng($shopNameEng = null) + public function setShopNameEng($shopNameEng = null): BaseInfo { $this->shop_name_eng = $shopNameEng; @@ -655,7 +655,7 @@ public function setShopNameEng($shopNameEng = null) * * @return string|null */ - public function getShopNameEng() + public function getShopNameEng(): ?string { return $this->shop_name_eng; } @@ -667,7 +667,7 @@ public function getShopNameEng() * * @return BaseInfo */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): BaseInfo { $this->update_date = $updateDate; @@ -677,9 +677,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -691,7 +691,7 @@ public function getUpdateDate() * * @return BaseInfo */ - public function setGoodTraded($goodTraded = null) + public function setGoodTraded($goodTraded = null): BaseInfo { $this->good_traded = $goodTraded; @@ -703,7 +703,7 @@ public function setGoodTraded($goodTraded = null) * * @return string|null */ - public function getGoodTraded() + public function getGoodTraded(): ?string { return $this->good_traded; } @@ -715,7 +715,7 @@ public function getGoodTraded() * * @return BaseInfo */ - public function setMessage($message = null) + public function setMessage($message = null): BaseInfo { $this->message = $message; @@ -727,7 +727,7 @@ public function setMessage($message = null) * * @return string|null */ - public function getMessage() + public function getMessage(): ?string { return $this->message; } @@ -739,7 +739,7 @@ public function getMessage() * * @return BaseInfo */ - public function setDeliveryFreeAmount($deliveryFreeAmount = null) + public function setDeliveryFreeAmount($deliveryFreeAmount = null): BaseInfo { $this->delivery_free_amount = $deliveryFreeAmount; @@ -751,7 +751,7 @@ public function setDeliveryFreeAmount($deliveryFreeAmount = null) * * @return string|null */ - public function getDeliveryFreeAmount() + public function getDeliveryFreeAmount(): ?string { return $this->delivery_free_amount; } @@ -763,7 +763,7 @@ public function getDeliveryFreeAmount() * * @return BaseInfo */ - public function setDeliveryFreeQuantity($deliveryFreeQuantity = null) + public function setDeliveryFreeQuantity($deliveryFreeQuantity = null): BaseInfo { $this->delivery_free_quantity = $deliveryFreeQuantity; @@ -775,7 +775,7 @@ public function setDeliveryFreeQuantity($deliveryFreeQuantity = null) * * @return int|null */ - public function getDeliveryFreeQuantity() + public function getDeliveryFreeQuantity(): ?int { return $this->delivery_free_quantity; } @@ -787,7 +787,7 @@ public function getDeliveryFreeQuantity() * * @return BaseInfo */ - public function setOptionMypageOrderStatusDisplay($optionMypageOrderStatusDisplay) + public function setOptionMypageOrderStatusDisplay($optionMypageOrderStatusDisplay): BaseInfo { $this->option_mypage_order_status_display = $optionMypageOrderStatusDisplay; @@ -799,7 +799,7 @@ public function setOptionMypageOrderStatusDisplay($optionMypageOrderStatusDispla * * @return bool */ - public function isOptionMypageOrderStatusDisplay() + public function isOptionMypageOrderStatusDisplay(): bool { return $this->option_mypage_order_status_display; } @@ -811,7 +811,7 @@ public function isOptionMypageOrderStatusDisplay() * * @return BaseInfo */ - public function setOptionNostockHidden($optionNostockHidden) + public function setOptionNostockHidden($optionNostockHidden): BaseInfo { $this->option_nostock_hidden = $optionNostockHidden; @@ -823,7 +823,7 @@ public function setOptionNostockHidden($optionNostockHidden) * * @return bool */ - public function isOptionNostockHidden() + public function isOptionNostockHidden(): bool { return $this->option_nostock_hidden; } @@ -835,7 +835,7 @@ public function isOptionNostockHidden() * * @return BaseInfo */ - public function setOptionFavoriteProduct($optionFavoriteProduct) + public function setOptionFavoriteProduct($optionFavoriteProduct): BaseInfo { $this->option_favorite_product = $optionFavoriteProduct; @@ -847,7 +847,7 @@ public function setOptionFavoriteProduct($optionFavoriteProduct) * * @return bool */ - public function isOptionFavoriteProduct() + public function isOptionFavoriteProduct(): bool { return $this->option_favorite_product; } @@ -859,7 +859,7 @@ public function isOptionFavoriteProduct() * * @return BaseInfo */ - public function setOptionProductDeliveryFee($optionProductDeliveryFee) + public function setOptionProductDeliveryFee($optionProductDeliveryFee): BaseInfo { $this->option_product_delivery_fee = $optionProductDeliveryFee; @@ -871,7 +871,7 @@ public function setOptionProductDeliveryFee($optionProductDeliveryFee) * * @return bool */ - public function isOptionProductDeliveryFee() + public function isOptionProductDeliveryFee(): bool { return $this->option_product_delivery_fee; } @@ -883,7 +883,7 @@ public function isOptionProductDeliveryFee() * * @return BaseInfo */ - public function setInvoiceRegistrationNumber($invoiceRegistrationNumber) + public function setInvoiceRegistrationNumber($invoiceRegistrationNumber): BaseInfo { $this->invoice_registration_number = $invoiceRegistrationNumber; @@ -895,7 +895,7 @@ public function setInvoiceRegistrationNumber($invoiceRegistrationNumber) * * @return string|null */ - public function getInvoiceRegistrationNumber() + public function getInvoiceRegistrationNumber(): ?string { return $this->invoice_registration_number; } @@ -907,7 +907,7 @@ public function getInvoiceRegistrationNumber() * * @return BaseInfo */ - public function setOptionProductTaxRule($optionProductTaxRule) + public function setOptionProductTaxRule($optionProductTaxRule): BaseInfo { $this->option_product_tax_rule = $optionProductTaxRule; @@ -919,7 +919,7 @@ public function setOptionProductTaxRule($optionProductTaxRule) * * @return bool */ - public function isOptionProductTaxRule() + public function isOptionProductTaxRule(): bool { return $this->option_product_tax_rule; } @@ -931,7 +931,7 @@ public function isOptionProductTaxRule() * * @return BaseInfo */ - public function setOptionCustomerActivate($optionCustomerActivate) + public function setOptionCustomerActivate($optionCustomerActivate): BaseInfo { $this->option_customer_activate = $optionCustomerActivate; @@ -943,7 +943,7 @@ public function setOptionCustomerActivate($optionCustomerActivate) * * @return bool */ - public function isOptionCustomerActivate() + public function isOptionCustomerActivate(): bool { return $this->option_customer_activate; } @@ -955,7 +955,7 @@ public function isOptionCustomerActivate() * * @return BaseInfo */ - public function setOptionRememberMe($optionRememberMe) + public function setOptionRememberMe($optionRememberMe): BaseInfo { $this->option_remember_me = $optionRememberMe; @@ -967,7 +967,7 @@ public function setOptionRememberMe($optionRememberMe) * * @return bool */ - public function isOptionRememberMe() + public function isOptionRememberMe(): bool { return $this->option_remember_me; } @@ -979,7 +979,7 @@ public function isOptionRememberMe() * * @return BaseInfo */ - public function setOptionMailNotifier($optionRememberMe) + public function setOptionMailNotifier($optionRememberMe): BaseInfo { $this->option_mail_notifier = $optionRememberMe; @@ -991,7 +991,7 @@ public function setOptionMailNotifier($optionRememberMe) * * @return bool */ - public function isOptionMailNotifier() + public function isOptionMailNotifier(): bool { return $this->option_mail_notifier; } @@ -1003,7 +1003,7 @@ public function isOptionMailNotifier() * * @return BaseInfo */ - public function setAuthenticationKey($authenticationKey = null) + public function setAuthenticationKey($authenticationKey = null): BaseInfo { $this->authentication_key = $authenticationKey; @@ -1015,7 +1015,7 @@ public function setAuthenticationKey($authenticationKey = null) * * @return string|null */ - public function getAuthenticationKey() + public function getAuthenticationKey(): ?string { return $this->authentication_key; } @@ -1027,7 +1027,7 @@ public function getAuthenticationKey() * * @return BaseInfo */ - public function setCountry(?Master\Country $country = null) + public function setCountry(?Master\Country $country = null): BaseInfo { $this->Country = $country; @@ -1039,7 +1039,7 @@ public function setCountry(?Master\Country $country = null) * * @return Master\Country|null */ - public function getCountry() + public function getCountry(): ?Master\Country { return $this->Country; } @@ -1051,7 +1051,7 @@ public function getCountry() * * @return BaseInfo */ - public function setPref(?Master\Pref $pref = null) + public function setPref(?Master\Pref $pref = null): BaseInfo { $this->Pref = $pref; @@ -1063,7 +1063,7 @@ public function setPref(?Master\Pref $pref = null) * * @return Master\Pref|null */ - public function getPref() + public function getPref(): ?Master\Pref { return $this->Pref; } @@ -1075,7 +1075,7 @@ public function getPref() * * @return BaseInfo */ - public function setOptionPoint($optionPoint) + public function setOptionPoint($optionPoint): BaseInfo { $this->option_point = $optionPoint; @@ -1087,7 +1087,7 @@ public function setOptionPoint($optionPoint) * * @return bool */ - public function isOptionPoint() + public function isOptionPoint(): bool { return $this->option_point; } @@ -1099,7 +1099,7 @@ public function isOptionPoint() * * @return BaseInfo */ - public function setPointConversionRate($pointConversionRate) + public function setPointConversionRate($pointConversionRate): BaseInfo { $this->point_conversion_rate = $pointConversionRate; @@ -1111,7 +1111,7 @@ public function setPointConversionRate($pointConversionRate) * * @return string|null */ - public function getPointConversionRate() + public function getPointConversionRate(): ?string { return $this->point_conversion_rate; } @@ -1123,7 +1123,7 @@ public function getPointConversionRate() * * @return BaseInfo */ - public function setBasicPointRate($basicPointRate) + public function setBasicPointRate($basicPointRate): BaseInfo { $this->basic_point_rate = $basicPointRate; @@ -1135,7 +1135,7 @@ public function setBasicPointRate($basicPointRate) * * @return string */ - public function getBasicPointRate() + public function getBasicPointRate(): string { return $this->basic_point_rate; } @@ -1145,7 +1145,7 @@ public function getBasicPointRate() * * @deprecated 使用していないため、削除予定 */ - public function getPhpPath() + public function getPhpPath(): ?string { return $this->php_path; } @@ -1157,7 +1157,7 @@ public function getPhpPath() * * @return $this */ - public function setPhpPath($php_path) + public function setPhpPath($php_path): static { $this->php_path = $php_path; @@ -1171,7 +1171,7 @@ public function setPhpPath($php_path) * * @return BaseInfo */ - public function setGaId($gaId = null) + public function setGaId($gaId = null): BaseInfo { $this->gaId = $gaId; @@ -1183,7 +1183,7 @@ public function setGaId($gaId = null) * * @return string|null */ - public function getGaId() + public function getGaId(): ?string { return $this->gaId; } diff --git a/src/Eccube/Entity/Block.php b/src/Eccube/Entity/Block.php index 5ce0dbc9863..f83bac34ad4 100644 --- a/src/Eccube/Entity/Block.php +++ b/src/Eccube/Entity/Block.php @@ -123,7 +123,7 @@ public function __construct() * * @return Block */ - public function setId($id) + public function setId($id): Block { $this->id = $id; @@ -135,7 +135,7 @@ public function setId($id) * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -147,7 +147,7 @@ public function getId() * * @return Block */ - public function setName($name) + public function setName($name): Block { $this->name = $name; @@ -159,7 +159,7 @@ public function setName($name) * * @return string */ - public function getName() + public function getName(): string { return $this->name; } @@ -171,7 +171,7 @@ public function getName() * * @return Block */ - public function setFileName($fileName) + public function setFileName($fileName): Block { $this->file_name = $fileName; @@ -183,7 +183,7 @@ public function setFileName($fileName) * * @return string */ - public function getFileName() + public function getFileName(): string { return $this->file_name; } @@ -195,7 +195,7 @@ public function getFileName() * * @return Block */ - public function setUseController($useController) + public function setUseController($useController): Block { $this->use_controller = $useController; @@ -207,7 +207,7 @@ public function setUseController($useController) * * @return bool */ - public function isUseController() + public function isUseController(): bool { return $this->use_controller; } @@ -219,7 +219,7 @@ public function isUseController() * * @return Block */ - public function setDeletable($deletable) + public function setDeletable($deletable): Block { $this->deletable = $deletable; @@ -231,7 +231,7 @@ public function setDeletable($deletable) * * @return bool */ - public function isDeletable() + public function isDeletable(): bool { return $this->deletable; } @@ -243,7 +243,7 @@ public function isDeletable() * * @return Block */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Block { $this->create_date = $createDate; @@ -255,7 +255,7 @@ public function setCreateDate($createDate) * * @return \DateTime */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -267,7 +267,7 @@ public function getCreateDate() * * @return Block */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Block { $this->update_date = $updateDate; @@ -279,7 +279,7 @@ public function setUpdateDate($updateDate) * * @return \DateTime */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -291,7 +291,7 @@ public function getUpdateDate() * * @return Block */ - public function addBlockPosition(BlockPosition $blockPosition) + public function addBlockPosition(BlockPosition $blockPosition): Block { $this->BlockPositions[] = $blockPosition; @@ -305,7 +305,7 @@ public function addBlockPosition(BlockPosition $blockPosition) * * @return void */ - public function removeBlockPosition(BlockPosition $blockPosition) + public function removeBlockPosition(BlockPosition $blockPosition): void { $this->BlockPositions->removeElement($blockPosition); } @@ -315,7 +315,7 @@ public function removeBlockPosition(BlockPosition $blockPosition) * * @return \Doctrine\Common\Collections\Collection */ - public function getBlockPositions() + public function getBlockPositions(): \Doctrine\Common\Collections\Collection { return $this->BlockPositions; } @@ -327,7 +327,7 @@ public function getBlockPositions() * * @return Block */ - public function setDeviceType(?Master\DeviceType $deviceType = null) + public function setDeviceType(?Master\DeviceType $deviceType = null): Block { $this->DeviceType = $deviceType; @@ -337,9 +337,9 @@ public function setDeviceType(?Master\DeviceType $deviceType = null) /** * Get deviceType * - * @return Master\DeviceType + * @return Master\DeviceType|null */ - public function getDeviceType() + public function getDeviceType(): ?Master\DeviceType { return $this->DeviceType; } diff --git a/src/Eccube/Entity/BlockPosition.php b/src/Eccube/Entity/BlockPosition.php index f7c93863453..07aa85a43a0 100644 --- a/src/Eccube/Entity/BlockPosition.php +++ b/src/Eccube/Entity/BlockPosition.php @@ -102,7 +102,7 @@ class BlockPosition extends AbstractEntity * * @return BlockPosition */ - public function setSection($section) + public function setSection($section): BlockPosition { $this->section = $section; @@ -114,7 +114,7 @@ public function setSection($section) * * @return int */ - public function getSection() + public function getSection(): int { return $this->section; } @@ -126,7 +126,7 @@ public function getSection() * * @return BlockPosition */ - public function setBlockId($blockId) + public function setBlockId($blockId): BlockPosition { $this->block_id = $blockId; @@ -138,7 +138,7 @@ public function setBlockId($blockId) * * @return int */ - public function getBlockId() + public function getBlockId(): int { return $this->block_id; } @@ -150,7 +150,7 @@ public function getBlockId() * * @return BlockPosition */ - public function setLayoutId($layoutId) + public function setLayoutId($layoutId): BlockPosition { $this->layout_id = $layoutId; @@ -162,7 +162,7 @@ public function setLayoutId($layoutId) * * @return int */ - public function getLayoutId() + public function getLayoutId(): int { return $this->layout_id; } @@ -174,7 +174,7 @@ public function getLayoutId() * * @return BlockPosition */ - public function setBlockRow($blockRow = null) + public function setBlockRow($blockRow = null): BlockPosition { $this->block_row = $blockRow; @@ -186,7 +186,7 @@ public function setBlockRow($blockRow = null) * * @return int|null */ - public function getBlockRow() + public function getBlockRow(): ?int { return $this->block_row; } @@ -198,7 +198,7 @@ public function getBlockRow() * * @return BlockPosition */ - public function setBlock(?Block $block = null) + public function setBlock(?Block $block = null): BlockPosition { $this->Block = $block; @@ -210,7 +210,7 @@ public function setBlock(?Block $block = null) * * @return Block|null */ - public function getBlock() + public function getBlock(): ?Block { return $this->Block; } @@ -222,7 +222,7 @@ public function getBlock() * * @return BlockPosition */ - public function setLayout(?Layout $Layout = null) + public function setLayout(?Layout $Layout = null): BlockPosition { $this->Layout = $Layout; @@ -234,7 +234,7 @@ public function setLayout(?Layout $Layout = null) * * @return Layout|null */ - public function getLayout() + public function getLayout(): ?Layout { return $this->Layout; } diff --git a/src/Eccube/Entity/Calendar.php b/src/Eccube/Entity/Calendar.php index 2d3dccebcbe..7639f20397a 100644 --- a/src/Eccube/Entity/Calendar.php +++ b/src/Eccube/Entity/Calendar.php @@ -41,7 +41,7 @@ class Calendar extends AbstractEntity * * @return bool */ - public function isDefaultCalendar() + public function isDefaultCalendar(): bool { return self::DEFAULT_CALENDAR_ID === $this->getId(); } @@ -90,9 +90,9 @@ public function isDefaultCalendar() /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -104,7 +104,7 @@ public function getId() * * @return Calendar */ - public function setTitle($title) + public function setTitle($title): Calendar { $this->title = $title; @@ -116,7 +116,7 @@ public function setTitle($title) * * @return string */ - public function getTitle() + public function getTitle(): string { return $this->title; } @@ -128,7 +128,7 @@ public function getTitle() * * @return Calendar */ - public function setHoliday($holiday) + public function setHoliday($holiday): Calendar { $this->holiday = $holiday; @@ -138,9 +138,9 @@ public function setHoliday($holiday) /** * Get holiday. * - * @return \DateTime + * @return \DateTime|null */ - public function getHoliday() + public function getHoliday(): ?\DateTime { return $this->holiday; } @@ -152,7 +152,7 @@ public function getHoliday() * * @return Calendar */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Calendar { $this->create_date = $createDate; @@ -162,9 +162,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -176,7 +176,7 @@ public function getCreateDate() * * @return Calendar */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Calendar { $this->update_date = $updateDate; @@ -186,9 +186,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } diff --git a/src/Eccube/Entity/Cart.php b/src/Eccube/Entity/Cart.php index f94ac2786cd..31b51f86ce8 100644 --- a/src/Eccube/Entity/Cart.php +++ b/src/Eccube/Entity/Cart.php @@ -138,7 +138,7 @@ public function __construct() /** * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -146,7 +146,7 @@ public function getId() /** * @return string */ - public function getCartKey() + public function getCartKey(): string { return $this->cart_key; } @@ -156,7 +156,7 @@ public function getCartKey() * * @return Cart */ - public function setCartKey(string $cartKey) + public function setCartKey(string $cartKey): Cart { $this->cart_key = $cartKey; @@ -168,7 +168,7 @@ public function setCartKey(string $cartKey) * * @deprecated 使用しないので削除予定 */ - public function getLock() + public function getLock(): bool { return $this->lock; } @@ -180,7 +180,7 @@ public function getLock() * * @deprecated 使用しないので削除予定 */ - public function setLock($lock) + public function setLock($lock): Cart { $this->lock = $lock; @@ -190,7 +190,7 @@ public function setLock($lock) /** * @return string|null */ - public function getPreOrderId() + public function getPreOrderId(): ?string { return $this->pre_order_id; } @@ -200,7 +200,7 @@ public function getPreOrderId() * * @return Cart */ - public function setPreOrderId($pre_order_id) + public function setPreOrderId($pre_order_id): Cart { $this->pre_order_id = $pre_order_id; @@ -212,7 +212,7 @@ public function setPreOrderId($pre_order_id) * * @return Cart */ - public function addCartItem(CartItem $CartItem) + public function addCartItem(CartItem $CartItem): Cart { $this->CartItems[] = $CartItem; @@ -224,7 +224,7 @@ public function addCartItem(CartItem $CartItem) * * @return ArrayCollection */ - public function getShippings() + public function getShippings(): ArrayCollection { return new ArrayCollection(); } @@ -232,7 +232,7 @@ public function getShippings() /** * @return Cart */ - public function clearCartItems() + public function clearCartItems(): Cart { $this->CartItems->clear(); @@ -242,7 +242,7 @@ public function clearCartItems() /** * @return \Doctrine\Common\Collections\Collection */ - public function getCartItems() + public function getCartItems(): \Doctrine\Common\Collections\Collection { return $this->CartItems; } @@ -253,7 +253,7 @@ public function getCartItems() * @return ItemCollection */ #[\Override] - public function getItems() + public function getItems(): ItemCollection { return (new ItemCollection($this->getCartItems()))->sort(); } @@ -263,7 +263,7 @@ public function getItems() * * @return Cart */ - public function setCartItems($CartItems) + public function setCartItems($CartItems): Cart { $this->CartItems = $CartItems; @@ -275,9 +275,9 @@ public function setCartItems($CartItems) * * @param string $total_price * - * @return Cart + * @return $this */ - public function setTotalPrice($total_price) + public function setTotalPrice($total_price): static { $this->total_price = $total_price; @@ -287,7 +287,7 @@ public function setTotalPrice($total_price) /** * @return string */ - public function getTotalPrice() + public function getTotalPrice(): string { return $this->total_price; } @@ -297,10 +297,10 @@ public function getTotalPrice() * * @param string $total * - * @return Cart + * @return $this */ #[\Override] - public function setTotal($total) + public function setTotal($total): static { return $this->setTotalPrice($total); } @@ -311,7 +311,7 @@ public function setTotal($total) * @return string */ #[\Override] - public function getTotal() + public function getTotal(): string { return $this->getTotalPrice(); } @@ -319,7 +319,7 @@ public function getTotal() /** * @return string */ - public function getTotalQuantity() + public function getTotalQuantity(): string { $totalQuantity = '0'; foreach ($this->CartItems as $CartItem) { @@ -335,7 +335,7 @@ public function getTotalQuantity() * @return void */ #[\Override] - public function addItem(ItemInterface $item) + public function addItem(ItemInterface $item): void { if ($item instanceof CartItem) { $this->CartItems->add($item); @@ -347,7 +347,7 @@ public function addItem(ItemInterface $item) * * @return void */ - public function removeItem(ItemInterface $item) + public function removeItem(ItemInterface $item): void { if ($item instanceof CartItem) { $this->CartItems->removeElement($item); @@ -360,9 +360,9 @@ public function removeItem(ItemInterface $item) * @return string */ #[\Override] - public function getQuantity() + public function getQuantity(): string { - return (string) $this->getTotalQuantity(); + return $this->getTotalQuantity(); } /** @@ -370,10 +370,10 @@ public function getQuantity() * * @param string $total * - * @return Cart + * @return $this */ #[\Override] - public function setDeliveryFeeTotal($total) + public function setDeliveryFeeTotal($total): static { $this->delivery_fee_total = $total; @@ -384,7 +384,7 @@ public function setDeliveryFeeTotal($total) * {@inheritdoc} */ #[\Override] - public function getDeliveryFeeTotal() + public function getDeliveryFeeTotal(): string { return $this->delivery_fee_total; } @@ -402,7 +402,7 @@ public function getCustomer(): ?Customer * * @return Cart */ - public function setCustomer(?Customer $Customer = null) + public function setCustomer(?Customer $Customer = null): Cart { $this->Customer = $Customer; @@ -416,7 +416,7 @@ public function setCustomer(?Customer $Customer = null) * * @return Cart */ - public function setSortNo($sortNo = null) + public function setSortNo($sortNo = null): Cart { $this->sort_no = $sortNo; @@ -428,7 +428,7 @@ public function setSortNo($sortNo = null) * * @return int|null */ - public function getSortNo() + public function getSortNo(): ?int { return $this->sort_no; } @@ -440,7 +440,7 @@ public function getSortNo() * * @return Cart */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Cart { $this->create_date = $createDate; @@ -450,9 +450,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -464,7 +464,7 @@ public function getCreateDate() * * @return Cart */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Cart { $this->update_date = $updateDate; @@ -474,9 +474,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -486,12 +486,13 @@ public function getUpdateDate() * * @param string $total * - * @return void + * @return $this */ #[\Override] - public function setDiscount($total) + public function setDiscount($total): static { - // TODO quiet + // quiet + return $this; } /** @@ -499,12 +500,13 @@ public function setDiscount($total) * * @param string $total * - * @return void + * @return $this */ #[\Override] - public function setCharge($total) + public function setCharge($total): static { - // TODO quiet + // quiet + return $this; } /** @@ -512,14 +514,15 @@ public function setCharge($total) * * @param string $total * - * @return void + * @return $this * * @deprecated */ #[\Override] - public function setTax($total) + public function setTax($total): static { - // TODO quiet + // quiet + return $this; } /** @@ -527,7 +530,7 @@ public function setTax($total) * * @return null */ - public function getOrderStatus() + public function getOrderStatus(): null { return null; } @@ -537,7 +540,7 @@ public function getOrderStatus() * * @return OrderItem[] */ - public function getProductOrderItems() + public function getProductOrderItems(): array { return []; } diff --git a/src/Eccube/Entity/CartItem.php b/src/Eccube/Entity/CartItem.php index 355aeb8a3ab..aa599a392ff 100644 --- a/src/Eccube/Entity/CartItem.php +++ b/src/Eccube/Entity/CartItem.php @@ -91,7 +91,7 @@ class CartItem extends AbstractEntity implements ItemInterface */ private $product_class_id; - public function __sleep() + public function __sleep(): array { return ['product_class_id', 'price', 'quantity']; } @@ -99,7 +99,7 @@ public function __sleep() /** * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -107,9 +107,9 @@ public function getId() /** * @param string $price * - * @return CartItem + * @return static */ - public function setPrice($price) + public function setPrice($price): static { $this->price = $price; @@ -117,10 +117,10 @@ public function setPrice($price) } /** - * @return string + * @return string|null */ #[\Override] - public function getPrice() + public function getPrice(): ?string { return $this->price; } @@ -128,10 +128,10 @@ public function getPrice() /** * @param string $quantity * - * @return CartItem + * @return static */ #[\Override] - public function setQuantity($quantity) + public function setQuantity($quantity): static { $this->quantity = $quantity; @@ -142,7 +142,7 @@ public function setQuantity($quantity) * @return string */ #[\Override] - public function getQuantity() + public function getQuantity(): string { return $this->quantity; } @@ -150,7 +150,7 @@ public function getQuantity() /** * @return string */ - public function getTotalPrice() + public function getTotalPrice(): string { return bcmul($this->getPrice(), $this->getQuantity(), 2); } @@ -161,7 +161,7 @@ public function getTotalPrice() * @return bool 商品明細の場合 true */ #[\Override] - public function isProduct() + public function isProduct(): bool { return true; } @@ -172,7 +172,7 @@ public function isProduct() * @return bool 送料明細の場合 true */ #[\Override] - public function isDeliveryFee() + public function isDeliveryFee(): bool { return false; } @@ -183,7 +183,7 @@ public function isDeliveryFee() * @return bool 手数料明細の場合 true */ #[\Override] - public function isCharge() + public function isCharge(): bool { return false; } @@ -194,7 +194,7 @@ public function isCharge() * @return bool 値引き明細の場合 true */ #[\Override] - public function isDiscount() + public function isDiscount(): bool { return false; } @@ -205,7 +205,7 @@ public function isDiscount() * @return bool 税額明細の場合 true */ #[\Override] - public function isTax() + public function isTax(): bool { return false; } @@ -216,7 +216,7 @@ public function isTax() * @return bool ポイント明細の場合 true */ #[\Override] - public function isPoint() + public function isPoint(): bool { return false; } @@ -225,7 +225,7 @@ public function isPoint() * @return Master\OrderItemType */ #[\Override] - public function getOrderItemType() + public function getOrderItemType(): Master\OrderItemType { // TODO OrderItemType::PRODUCT $ItemType = new Master\OrderItemType(); @@ -238,7 +238,7 @@ public function getOrderItemType() * * @return $this */ - public function setProductClass(ProductClass $ProductClass) + public function setProductClass(ProductClass $ProductClass): static { $this->ProductClass = $ProductClass; @@ -251,7 +251,7 @@ public function setProductClass(ProductClass $ProductClass) * @return ProductClass|null */ #[\Override] - public function getProductClass() + public function getProductClass(): ?ProductClass { return $this->ProductClass; } @@ -259,24 +259,24 @@ public function getProductClass() /** * @return int|null */ - public function getProductClassId() + public function getProductClassId(): ?int { return $this->product_class_id; } /** - * @return float|int|string + * @return string */ - public function getPriceIncTax() + public function getPriceIncTax(): string { // TODO ItemInterfaceに追加, Cart::priceは税込み金額が入っているので,フィールドを分ける必要がある return $this->price; } /** - * @return Cart + * @return Cart|null */ - public function getCart() + public function getCart(): ?Cart { return $this->Cart; } @@ -286,7 +286,7 @@ public function getCart() * * @return $this */ - public function setCart(Cart $Cart) + public function setCart(Cart $Cart): static { $this->Cart = $Cart; diff --git a/src/Eccube/Entity/Category.php b/src/Eccube/Entity/Category.php index 5285cbf6bbc..d4eafea1912 100644 --- a/src/Eccube/Entity/Category.php +++ b/src/Eccube/Entity/Category.php @@ -39,13 +39,13 @@ class Category extends AbstractEntity implements \Stringable #[\Override] public function __toString(): string { - return (string) $this->getName(); + return $this->getName(); } /** * @return int */ - public function countBranches() + public function countBranches(): int { $count = 1; @@ -62,7 +62,7 @@ public function countBranches() * * @return Category */ - public function calcChildrenSortNo(\Doctrine\ORM\EntityManager $em, $sortNo) + public function calcChildrenSortNo(\Doctrine\ORM\EntityManager $em, $sortNo): Category { $this->setSortNo($this->getSortNo() + $sortNo); $em->persist($this); @@ -77,7 +77,7 @@ public function calcChildrenSortNo(\Doctrine\ORM\EntityManager $em, $sortNo) /** * @return array */ - public function getParents() + public function getParents(): array { $path = $this->getPath(); array_pop($path); @@ -88,7 +88,7 @@ public function getParents() /** * @return array */ - public function getPath() + public function getPath(): array { $path = []; $Category = $this; @@ -109,7 +109,7 @@ public function getPath() /** * @return string */ - public function getNameWithLevel() + public function getNameWithLevel(): string { return str_repeat(' ', $this->getHierarchy() - 1).$this->getName(); } @@ -117,7 +117,7 @@ public function getNameWithLevel() /** * @return array */ - public function getDescendants() + public function getDescendants(): array { $DescendantCategories = []; @@ -136,7 +136,7 @@ public function getDescendants() /** * @return Category[]|mixed[] */ - public function getSelfAndDescendants() + public function getSelfAndDescendants(): array { return array_merge([$this], $this->getDescendants()); } @@ -151,7 +151,7 @@ public function getSelfAndDescendants() * * @return bool */ - public function hasProductCategories() + public function hasProductCategories(): bool { $criteria = Criteria::create() ->orderBy(['category_id' => Criteria::ASC]) @@ -266,9 +266,9 @@ public function __construct() /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -280,7 +280,7 @@ public function getId() * * @return Category */ - public function setName($name) + public function setName($name): Category { $this->name = $name; @@ -292,7 +292,7 @@ public function setName($name) * * @return string */ - public function getName() + public function getName(): string { return $this->name; } @@ -304,7 +304,7 @@ public function getName() * * @return Category */ - public function setHierarchy($hierarchy) + public function setHierarchy($hierarchy): Category { $this->hierarchy = $hierarchy; @@ -316,7 +316,7 @@ public function setHierarchy($hierarchy) * * @return int */ - public function getHierarchy() + public function getHierarchy(): int { return $this->hierarchy; } @@ -328,7 +328,7 @@ public function getHierarchy() * * @return Category */ - public function setSortNo($sortNo) + public function setSortNo($sortNo): Category { $this->sort_no = $sortNo; @@ -340,7 +340,7 @@ public function setSortNo($sortNo) * * @return int */ - public function getSortNo() + public function getSortNo(): int { return $this->sort_no; } @@ -352,7 +352,7 @@ public function getSortNo() * * @return Category */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Category { $this->create_date = $createDate; @@ -362,9 +362,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -376,7 +376,7 @@ public function getCreateDate() * * @return Category */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Category { $this->update_date = $updateDate; @@ -386,9 +386,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -400,7 +400,7 @@ public function getUpdateDate() * * @return Category */ - public function addProductCategory(ProductCategory $productCategory) + public function addProductCategory(ProductCategory $productCategory): Category { $this->ProductCategories[] = $productCategory; @@ -414,7 +414,7 @@ public function addProductCategory(ProductCategory $productCategory) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeProductCategory(ProductCategory $productCategory) + public function removeProductCategory(ProductCategory $productCategory): bool { return $this->ProductCategories->removeElement($productCategory); } @@ -424,7 +424,7 @@ public function removeProductCategory(ProductCategory $productCategory) * * @return \Doctrine\Common\Collections\Collection */ - public function getProductCategories() + public function getProductCategories(): \Doctrine\Common\Collections\Collection { return $this->ProductCategories; } @@ -436,7 +436,7 @@ public function getProductCategories() * * @return Category */ - public function addChild(Category $child) + public function addChild(Category $child): Category { $this->Children[] = $child; @@ -450,7 +450,7 @@ public function addChild(Category $child) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeChild(Category $child) + public function removeChild(Category $child): bool { return $this->Children->removeElement($child); } @@ -460,7 +460,7 @@ public function removeChild(Category $child) * * @return \Doctrine\Common\Collections\Collection */ - public function getChildren() + public function getChildren(): \Doctrine\Common\Collections\Collection { return $this->Children; } @@ -472,7 +472,7 @@ public function getChildren() * * @return Category */ - public function setParent(?Category $parent = null) + public function setParent(?Category $parent = null): Category { $this->Parent = $parent; @@ -484,7 +484,7 @@ public function setParent(?Category $parent = null) * * @return Category|null */ - public function getParent() + public function getParent(): ?Category { return $this->Parent; } @@ -496,7 +496,7 @@ public function getParent() * * @return Category */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): Category { $this->Creator = $creator; @@ -508,7 +508,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } diff --git a/src/Eccube/Entity/ClassCategory.php b/src/Eccube/Entity/ClassCategory.php index ffb202139ad..0c85555331e 100644 --- a/src/Eccube/Entity/ClassCategory.php +++ b/src/Eccube/Entity/ClassCategory.php @@ -37,7 +37,7 @@ class ClassCategory extends AbstractEntity implements \Stringable #[\Override] public function __toString(): string { - return (string) $this->getName(); + return $this->getName(); } /** @@ -124,7 +124,7 @@ public function __toString(): string * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -136,7 +136,7 @@ public function getId() * * @return ClassCategory */ - public function setBackendName($backendName) + public function setBackendName($backendName): ClassCategory { $this->backend_name = $backendName; @@ -148,7 +148,7 @@ public function setBackendName($backendName) * * @return string */ - public function getBackendName() + public function getBackendName(): string { return $this->backend_name; } @@ -160,7 +160,7 @@ public function getBackendName() * * @return ClassCategory */ - public function setName($name) + public function setName($name): ClassCategory { $this->name = $name; @@ -172,7 +172,7 @@ public function setName($name) * * @return string */ - public function getName() + public function getName(): string { return $this->name; } @@ -184,7 +184,7 @@ public function getName() * * @return ClassCategory */ - public function setSortNo($sortNo) + public function setSortNo($sortNo): ClassCategory { $this->sort_no = $sortNo; @@ -196,7 +196,7 @@ public function setSortNo($sortNo) * * @return int */ - public function getSortNo() + public function getSortNo(): int { return $this->sort_no; } @@ -208,7 +208,7 @@ public function getSortNo() * * @return ClassCategory */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): ClassCategory { $this->create_date = $createDate; @@ -218,9 +218,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -232,7 +232,7 @@ public function getCreateDate() * * @return ClassCategory */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): ClassCategory { $this->update_date = $updateDate; @@ -242,9 +242,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -256,7 +256,7 @@ public function getUpdateDate() * * @return ClassCategory */ - public function setClassName(?ClassName $className = null) + public function setClassName(?ClassName $className = null): ClassCategory { $this->ClassName = $className; @@ -268,7 +268,7 @@ public function setClassName(?ClassName $className = null) * * @return ClassName|null */ - public function getClassName() + public function getClassName(): ?ClassName { return $this->ClassName; } @@ -280,7 +280,7 @@ public function getClassName() * * @return ClassCategory */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): ClassCategory { $this->Creator = $creator; @@ -292,7 +292,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } @@ -304,7 +304,7 @@ public function getCreator() * * @return ClassCategory */ - public function setVisible($visible) + public function setVisible($visible): ClassCategory { $this->visible = $visible; @@ -316,7 +316,7 @@ public function setVisible($visible) * * @return bool */ - public function isVisible() + public function isVisible(): bool { return $this->visible; } diff --git a/src/Eccube/Entity/ClassName.php b/src/Eccube/Entity/ClassName.php index 9efbd9a1885..dc347c74136 100644 --- a/src/Eccube/Entity/ClassName.php +++ b/src/Eccube/Entity/ClassName.php @@ -122,9 +122,9 @@ public function __construct() /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -136,7 +136,7 @@ public function getId() * * @return ClassName */ - public function setBackendName($backendName) + public function setBackendName($backendName): ClassName { $this->backend_name = $backendName; @@ -146,9 +146,9 @@ public function setBackendName($backendName) /** * Get backend_name. * - * @return string + * @return string|null */ - public function getBackendName() + public function getBackendName(): ?string { return $this->backend_name; } @@ -160,7 +160,7 @@ public function getBackendName() * * @return ClassName */ - public function setName($name) + public function setName($name): ClassName { $this->name = $name; @@ -172,7 +172,7 @@ public function setName($name) * * @return string */ - public function getName() + public function getName(): string { return $this->name; } @@ -184,7 +184,7 @@ public function getName() * * @return ClassName */ - public function setSortNo($sortNo) + public function setSortNo($sortNo): ClassName { $this->sort_no = $sortNo; @@ -196,7 +196,7 @@ public function setSortNo($sortNo) * * @return int */ - public function getSortNo() + public function getSortNo(): int { return $this->sort_no; } @@ -208,7 +208,7 @@ public function getSortNo() * * @return ClassName */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): ClassName { $this->create_date = $createDate; @@ -218,9 +218,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -232,7 +232,7 @@ public function getCreateDate() * * @return ClassName */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): ClassName { $this->update_date = $updateDate; @@ -242,9 +242,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -256,7 +256,7 @@ public function getUpdateDate() * * @return ClassName */ - public function addClassCategory(ClassCategory $classCategory) + public function addClassCategory(ClassCategory $classCategory): ClassName { $this->ClassCategories[] = $classCategory; @@ -270,7 +270,7 @@ public function addClassCategory(ClassCategory $classCategory) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeClassCategory(ClassCategory $classCategory) + public function removeClassCategory(ClassCategory $classCategory): bool { return $this->ClassCategories->removeElement($classCategory); } @@ -280,7 +280,7 @@ public function removeClassCategory(ClassCategory $classCategory) * * @return \Doctrine\Common\Collections\Collection */ - public function getClassCategories() + public function getClassCategories(): \Doctrine\Common\Collections\Collection { return $this->ClassCategories; } @@ -292,7 +292,7 @@ public function getClassCategories() * * @return ClassName */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): ClassName { $this->Creator = $creator; @@ -304,7 +304,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } diff --git a/src/Eccube/Entity/Csv.php b/src/Eccube/Entity/Csv.php index 8a79e86ef2e..7147335f4e1 100644 --- a/src/Eccube/Entity/Csv.php +++ b/src/Eccube/Entity/Csv.php @@ -129,7 +129,7 @@ class Csv extends AbstractEntity * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -141,7 +141,7 @@ public function getId() * * @return Csv */ - public function setEntityName($entityName) + public function setEntityName($entityName): Csv { $this->entity_name = $entityName; @@ -153,7 +153,7 @@ public function setEntityName($entityName) * * @return string */ - public function getEntityName() + public function getEntityName(): string { return $this->entity_name; } @@ -165,7 +165,7 @@ public function getEntityName() * * @return Csv */ - public function setFieldName($fieldName) + public function setFieldName($fieldName): Csv { $this->field_name = $fieldName; @@ -177,7 +177,7 @@ public function setFieldName($fieldName) * * @return string */ - public function getFieldName() + public function getFieldName(): string { return $this->field_name; } @@ -189,7 +189,7 @@ public function getFieldName() * * @return Csv */ - public function setReferenceFieldName($referenceFieldName = null) + public function setReferenceFieldName($referenceFieldName = null): Csv { $this->reference_field_name = $referenceFieldName; @@ -201,7 +201,7 @@ public function setReferenceFieldName($referenceFieldName = null) * * @return string|null */ - public function getReferenceFieldName() + public function getReferenceFieldName(): ?string { return $this->reference_field_name; } @@ -213,7 +213,7 @@ public function getReferenceFieldName() * * @return Csv */ - public function setDispName($dispName) + public function setDispName($dispName): Csv { $this->disp_name = $dispName; @@ -225,7 +225,7 @@ public function setDispName($dispName) * * @return string */ - public function getDispName() + public function getDispName(): string { return $this->disp_name; } @@ -237,7 +237,7 @@ public function getDispName() * * @return Csv */ - public function setSortNo($sortNo) + public function setSortNo($sortNo): Csv { $this->sort_no = $sortNo; @@ -249,7 +249,7 @@ public function setSortNo($sortNo) * * @return int */ - public function getSortNo() + public function getSortNo(): int { return $this->sort_no; } @@ -261,7 +261,7 @@ public function getSortNo() * * @return Csv */ - public function setEnabled($enabled) + public function setEnabled($enabled): Csv { $this->enabled = $enabled; @@ -273,7 +273,7 @@ public function setEnabled($enabled) * * @return bool */ - public function isEnabled() + public function isEnabled(): bool { return $this->enabled; } @@ -285,7 +285,7 @@ public function isEnabled() * * @return Csv */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Csv { $this->create_date = $createDate; @@ -295,9 +295,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -309,7 +309,7 @@ public function getCreateDate() * * @return Csv */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Csv { $this->update_date = $updateDate; @@ -319,9 +319,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -333,7 +333,7 @@ public function getUpdateDate() * * @return Csv */ - public function setCsvType(?Master\CsvType $csvType = null) + public function setCsvType(?Master\CsvType $csvType = null): Csv { $this->CsvType = $csvType; @@ -345,7 +345,7 @@ public function setCsvType(?Master\CsvType $csvType = null) * * @return Master\CsvType|null */ - public function getCsvType() + public function getCsvType(): ?Master\CsvType { return $this->CsvType; } @@ -357,7 +357,7 @@ public function getCsvType() * * @return Csv */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): Csv { $this->Creator = $creator; @@ -369,7 +369,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } diff --git a/src/Eccube/Entity/Customer.php b/src/Eccube/Entity/Customer.php index 19207ad55a8..8ee43fd784e 100644 --- a/src/Eccube/Entity/Customer.php +++ b/src/Eccube/Entity/Customer.php @@ -344,7 +344,7 @@ public function getRoles(): array /** * @return string */ - public function getUsername() + public function getUsername(): string { return $this->email; } @@ -365,7 +365,7 @@ public function eraseCredentials(): void * @return void */ // TODO: できればFormTypeで行いたい - public static function loadValidatorMetadata(ClassMetadata $metadata) + public static function loadValidatorMetadata(ClassMetadata $metadata): void { $metadata->addConstraint(new UniqueEntity([ 'fields' => 'email', @@ -379,7 +379,7 @@ public static function loadValidatorMetadata(ClassMetadata $metadata) * * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -391,7 +391,7 @@ public function getId() * * @return Customer */ - public function setName01($name01) + public function setName01($name01): Customer { $this->name01 = $name01; @@ -401,9 +401,9 @@ public function setName01($name01) /** * Get name01. * - * @return string + * @return string|null */ - public function getName01() + public function getName01(): ?string { return $this->name01; } @@ -415,7 +415,7 @@ public function getName01() * * @return Customer */ - public function setName02($name02) + public function setName02($name02): Customer { $this->name02 = $name02; @@ -425,9 +425,9 @@ public function setName02($name02) /** * Get name02. * - * @return string + * @return string|null */ - public function getName02() + public function getName02(): ?string { return $this->name02; } @@ -439,7 +439,7 @@ public function getName02() * * @return Customer */ - public function setKana01($kana01 = null) + public function setKana01($kana01 = null): Customer { $this->kana01 = $kana01; @@ -451,7 +451,7 @@ public function setKana01($kana01 = null) * * @return string|null */ - public function getKana01() + public function getKana01(): ?string { return $this->kana01; } @@ -463,7 +463,7 @@ public function getKana01() * * @return Customer */ - public function setKana02($kana02 = null) + public function setKana02($kana02 = null): Customer { $this->kana02 = $kana02; @@ -475,7 +475,7 @@ public function setKana02($kana02 = null) * * @return string|null */ - public function getKana02() + public function getKana02(): ?string { return $this->kana02; } @@ -487,7 +487,7 @@ public function getKana02() * * @return Customer */ - public function setCompanyName($companyName = null) + public function setCompanyName($companyName = null): Customer { $this->company_name = $companyName; @@ -499,7 +499,7 @@ public function setCompanyName($companyName = null) * * @return string|null */ - public function getCompanyName() + public function getCompanyName(): ?string { return $this->company_name; } @@ -511,7 +511,7 @@ public function getCompanyName() * * @return Customer */ - public function setPostalCode($postal_code = null) + public function setPostalCode($postal_code = null): Customer { $this->postal_code = $postal_code; @@ -523,7 +523,7 @@ public function setPostalCode($postal_code = null) * * @return string|null */ - public function getPostalCode() + public function getPostalCode(): ?string { return $this->postal_code; } @@ -535,7 +535,7 @@ public function getPostalCode() * * @return Customer */ - public function setAddr01($addr01 = null) + public function setAddr01($addr01 = null): Customer { $this->addr01 = $addr01; @@ -547,7 +547,7 @@ public function setAddr01($addr01 = null) * * @return string|null */ - public function getAddr01() + public function getAddr01(): ?string { return $this->addr01; } @@ -559,7 +559,7 @@ public function getAddr01() * * @return Customer */ - public function setAddr02($addr02 = null) + public function setAddr02($addr02 = null): Customer { $this->addr02 = $addr02; @@ -571,7 +571,7 @@ public function setAddr02($addr02 = null) * * @return string|null */ - public function getAddr02() + public function getAddr02(): ?string { return $this->addr02; } @@ -583,7 +583,7 @@ public function getAddr02() * * @return Customer */ - public function setEmail($email) + public function setEmail($email): Customer { $this->email = $email; @@ -593,9 +593,9 @@ public function setEmail($email) /** * Get email. * - * @return string + * @return string|null */ - public function getEmail() + public function getEmail(): ?string { return $this->email; } @@ -607,7 +607,7 @@ public function getEmail() * * @return Customer */ - public function setPhoneNumber($phone_number = null) + public function setPhoneNumber($phone_number = null): Customer { $this->phone_number = $phone_number; @@ -619,7 +619,7 @@ public function setPhoneNumber($phone_number = null) * * @return string|null */ - public function getPhoneNumber() + public function getPhoneNumber(): ?string { return $this->phone_number; } @@ -631,7 +631,7 @@ public function getPhoneNumber() * * @return Customer */ - public function setBirth($birth = null) + public function setBirth($birth = null): Customer { $this->birth = $birth; @@ -643,7 +643,7 @@ public function setBirth($birth = null) * * @return \DateTime|null */ - public function getBirth() + public function getBirth(): ?\DateTime { return $this->birth; } @@ -653,7 +653,7 @@ public function getBirth() * * @return $this */ - public function setPlainPassword(?string $password): self + public function setPlainPassword(?string $password): static { $this->plain_password = $password; @@ -675,7 +675,7 @@ public function getPlainPassword(): ?string * * @return Customer */ - public function setPassword($password = null) + public function setPassword($password = null): Customer { $this->password = $password; @@ -700,7 +700,7 @@ public function getPassword(): ?string * * @return Customer */ - public function setSalt($salt = null) + public function setSalt($salt = null): Customer { $this->salt = $salt; @@ -725,7 +725,7 @@ public function getSalt(): ?string * * @return Customer */ - public function setSecretKey($secretKey) + public function setSecretKey($secretKey): Customer { $this->secret_key = $secretKey; @@ -737,7 +737,7 @@ public function setSecretKey($secretKey) * * @return string */ - public function getSecretKey() + public function getSecretKey(): string { return $this->secret_key; } @@ -749,7 +749,7 @@ public function getSecretKey() * * @return Customer */ - public function setFirstBuyDate($firstBuyDate = null) + public function setFirstBuyDate($firstBuyDate = null): Customer { $this->first_buy_date = $firstBuyDate; @@ -761,7 +761,7 @@ public function setFirstBuyDate($firstBuyDate = null) * * @return \DateTime|null */ - public function getFirstBuyDate() + public function getFirstBuyDate(): ?\DateTime { return $this->first_buy_date; } @@ -773,7 +773,7 @@ public function getFirstBuyDate() * * @return Customer */ - public function setLastBuyDate($lastBuyDate = null) + public function setLastBuyDate($lastBuyDate = null): Customer { $this->last_buy_date = $lastBuyDate; @@ -785,7 +785,7 @@ public function setLastBuyDate($lastBuyDate = null) * * @return \DateTime|null */ - public function getLastBuyDate() + public function getLastBuyDate(): ?\DateTime { return $this->last_buy_date; } @@ -797,7 +797,7 @@ public function getLastBuyDate() * * @return Customer */ - public function setBuyTimes($buyTimes = null) + public function setBuyTimes($buyTimes = null): Customer { $this->buy_times = $buyTimes; @@ -809,7 +809,7 @@ public function setBuyTimes($buyTimes = null) * * @return string|null */ - public function getBuyTimes() + public function getBuyTimes(): ?string { return $this->buy_times; } @@ -821,7 +821,7 @@ public function getBuyTimes() * * @return Customer */ - public function setBuyTotal($buyTotal = null) + public function setBuyTotal($buyTotal = null): Customer { $this->buy_total = $buyTotal; @@ -833,7 +833,7 @@ public function setBuyTotal($buyTotal = null) * * @return string|null */ - public function getBuyTotal() + public function getBuyTotal(): ?string { return $this->buy_total; } @@ -845,7 +845,7 @@ public function getBuyTotal() * * @return Customer */ - public function setNote($note = null) + public function setNote($note = null): Customer { $this->note = $note; @@ -857,7 +857,7 @@ public function setNote($note = null) * * @return string|null */ - public function getNote() + public function getNote(): ?string { return $this->note; } @@ -869,7 +869,7 @@ public function getNote() * * @return Customer */ - public function setResetKey($resetKey = null) + public function setResetKey($resetKey = null): Customer { $this->reset_key = $resetKey; @@ -881,7 +881,7 @@ public function setResetKey($resetKey = null) * * @return string|null */ - public function getResetKey() + public function getResetKey(): ?string { return $this->reset_key; } @@ -893,7 +893,7 @@ public function getResetKey() * * @return Customer */ - public function setResetExpire($resetExpire = null) + public function setResetExpire($resetExpire = null): Customer { $this->reset_expire = $resetExpire; @@ -905,7 +905,7 @@ public function setResetExpire($resetExpire = null) * * @return \DateTime|null */ - public function getResetExpire() + public function getResetExpire(): ?\DateTime { return $this->reset_expire; } @@ -917,7 +917,7 @@ public function getResetExpire() * * @return Customer */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Customer { $this->create_date = $createDate; @@ -927,9 +927,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -941,7 +941,7 @@ public function getCreateDate() * * @return Customer */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Customer { $this->update_date = $updateDate; @@ -951,9 +951,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -965,7 +965,7 @@ public function getUpdateDate() * * @return Customer */ - public function addCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavoriteProduct) + public function addCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavoriteProduct): Customer { $this->CustomerFavoriteProducts[] = $customerFavoriteProduct; @@ -979,7 +979,7 @@ public function addCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavo * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavoriteProduct) + public function removeCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavoriteProduct): bool { return $this->CustomerFavoriteProducts->removeElement($customerFavoriteProduct); } @@ -989,7 +989,7 @@ public function removeCustomerFavoriteProduct(CustomerFavoriteProduct $customerF * * @return \Doctrine\Common\Collections\Collection */ - public function getCustomerFavoriteProducts() + public function getCustomerFavoriteProducts(): \Doctrine\Common\Collections\Collection { return $this->CustomerFavoriteProducts; } @@ -1001,7 +1001,7 @@ public function getCustomerFavoriteProducts() * * @return Customer */ - public function addCustomerAddress(CustomerAddress $customerAddress) + public function addCustomerAddress(CustomerAddress $customerAddress): Customer { $this->CustomerAddresses[] = $customerAddress; @@ -1015,7 +1015,7 @@ public function addCustomerAddress(CustomerAddress $customerAddress) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeCustomerAddress(CustomerAddress $customerAddress) + public function removeCustomerAddress(CustomerAddress $customerAddress): bool { return $this->CustomerAddresses->removeElement($customerAddress); } @@ -1025,7 +1025,7 @@ public function removeCustomerAddress(CustomerAddress $customerAddress) * * @return \Doctrine\Common\Collections\Collection */ - public function getCustomerAddresses() + public function getCustomerAddresses(): \Doctrine\Common\Collections\Collection { return $this->CustomerAddresses; } @@ -1037,7 +1037,7 @@ public function getCustomerAddresses() * * @return Customer */ - public function addOrder(Order $order) + public function addOrder(Order $order): Customer { $this->Orders[] = $order; @@ -1051,7 +1051,7 @@ public function addOrder(Order $order) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeOrder(Order $order) + public function removeOrder(Order $order): bool { return $this->Orders->removeElement($order); } @@ -1061,7 +1061,7 @@ public function removeOrder(Order $order) * * @return \Doctrine\Common\Collections\Collection */ - public function getOrders() + public function getOrders(): \Doctrine\Common\Collections\Collection { return $this->Orders; } @@ -1073,7 +1073,7 @@ public function getOrders() * * @return Customer */ - public function setStatus(?Master\CustomerStatus $status = null) + public function setStatus(?Master\CustomerStatus $status = null): Customer { $this->Status = $status; @@ -1085,7 +1085,7 @@ public function setStatus(?Master\CustomerStatus $status = null) * * @return Master\CustomerStatus|null */ - public function getStatus() + public function getStatus(): ?Master\CustomerStatus { return $this->Status; } @@ -1097,7 +1097,7 @@ public function getStatus() * * @return Customer */ - public function setSex(?Master\Sex $sex = null) + public function setSex(?Master\Sex $sex = null): Customer { $this->Sex = $sex; @@ -1109,7 +1109,7 @@ public function setSex(?Master\Sex $sex = null) * * @return Master\Sex|null */ - public function getSex() + public function getSex(): ?Master\Sex { return $this->Sex; } @@ -1121,7 +1121,7 @@ public function getSex() * * @return Customer */ - public function setJob(?Master\Job $job = null) + public function setJob(?Master\Job $job = null): Customer { $this->Job = $job; @@ -1133,7 +1133,7 @@ public function setJob(?Master\Job $job = null) * * @return Master\Job|null */ - public function getJob() + public function getJob(): ?Master\Job { return $this->Job; } @@ -1145,7 +1145,7 @@ public function getJob() * * @return Customer */ - public function setCountry(?Master\Country $country = null) + public function setCountry(?Master\Country $country = null): Customer { $this->Country = $country; @@ -1157,7 +1157,7 @@ public function setCountry(?Master\Country $country = null) * * @return Master\Country|null */ - public function getCountry() + public function getCountry(): ?Master\Country { return $this->Country; } @@ -1169,7 +1169,7 @@ public function getCountry() * * @return Customer */ - public function setPref(?Master\Pref $pref = null) + public function setPref(?Master\Pref $pref = null): Customer { $this->Pref = $pref; @@ -1181,7 +1181,7 @@ public function setPref(?Master\Pref $pref = null) * * @return Master\Pref|null */ - public function getPref() + public function getPref(): ?Master\Pref { return $this->Pref; } @@ -1193,7 +1193,7 @@ public function getPref() * * @return Customer */ - public function setPoint($point) + public function setPoint($point): Customer { $this->point = $point; @@ -1203,9 +1203,9 @@ public function setPoint($point) /** * Get point * - * @return string|int + * @return string|null */ - public function getPoint() + public function getPoint(): ?string { return $this->point; } @@ -1220,7 +1220,7 @@ public function getPoint() * @since 5.1.0 */ #[\Override] - public function serialize() + public function serialize(): string { // see https://symfony.com/doc/2.7/security/entity_provider.html#create-your-user-entity // CustomerRepository::loadUserByIdentifier() で Status をチェックしているため、ここでは不要 @@ -1246,7 +1246,7 @@ public function serialize() * @since 5.1.0 */ #[\Override] - public function unserialize($serialized) + public function unserialize($serialized): void { [$this->id, $this->email, $this->password, $this->salt] = unserialize($serialized); } diff --git a/src/Eccube/Entity/CustomerAddress.php b/src/Eccube/Entity/CustomerAddress.php index 37dc8488892..b8aafa295e5 100644 --- a/src/Eccube/Entity/CustomerAddress.php +++ b/src/Eccube/Entity/CustomerAddress.php @@ -36,7 +36,7 @@ class CustomerAddress extends AbstractEntity * * @return string */ - public function getShippingMultipleDefaultName() + public function getShippingMultipleDefaultName(): string { return $this->getName01().' '.$this->getPref()->getName().' '.$this->getAddr01().' '.$this->getAddr02(); } @@ -48,7 +48,7 @@ public function getShippingMultipleDefaultName() * * @return CustomerAddress */ - public function setFromCustomer(Customer $Customer) + public function setFromCustomer(Customer $Customer): CustomerAddress { $this ->setCustomer($Customer) @@ -73,7 +73,7 @@ public function setFromCustomer(Customer $Customer) * * @return CustomerAddress */ - public function setFromShipping(Shipping $Shipping) + public function setFromShipping(Shipping $Shipping): CustomerAddress { $this ->setName01($Shipping->getName01()) @@ -219,9 +219,9 @@ public function setFromShipping(Shipping $Shipping) /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -233,7 +233,7 @@ public function getId() * * @return CustomerAddress */ - public function setName01($name01 = null) + public function setName01($name01 = null): CustomerAddress { $this->name01 = $name01; @@ -245,7 +245,7 @@ public function setName01($name01 = null) * * @return string|null */ - public function getName01() + public function getName01(): ?string { return $this->name01; } @@ -257,7 +257,7 @@ public function getName01() * * @return CustomerAddress */ - public function setName02($name02 = null) + public function setName02($name02 = null): CustomerAddress { $this->name02 = $name02; @@ -269,7 +269,7 @@ public function setName02($name02 = null) * * @return string|null */ - public function getName02() + public function getName02(): ?string { return $this->name02; } @@ -281,7 +281,7 @@ public function getName02() * * @return CustomerAddress */ - public function setKana01($kana01 = null) + public function setKana01($kana01 = null): CustomerAddress { $this->kana01 = $kana01; @@ -293,7 +293,7 @@ public function setKana01($kana01 = null) * * @return string|null */ - public function getKana01() + public function getKana01(): ?string { return $this->kana01; } @@ -305,7 +305,7 @@ public function getKana01() * * @return CustomerAddress */ - public function setKana02($kana02 = null) + public function setKana02($kana02 = null): CustomerAddress { $this->kana02 = $kana02; @@ -317,7 +317,7 @@ public function setKana02($kana02 = null) * * @return string|null */ - public function getKana02() + public function getKana02(): ?string { return $this->kana02; } @@ -329,7 +329,7 @@ public function getKana02() * * @return CustomerAddress */ - public function setCompanyName($companyName = null) + public function setCompanyName($companyName = null): CustomerAddress { $this->company_name = $companyName; @@ -341,7 +341,7 @@ public function setCompanyName($companyName = null) * * @return string|null */ - public function getCompanyName() + public function getCompanyName(): ?string { return $this->company_name; } @@ -353,7 +353,7 @@ public function getCompanyName() * * @return CustomerAddress */ - public function setPostalCode($postal_code = null) + public function setPostalCode($postal_code = null): CustomerAddress { $this->postal_code = $postal_code; @@ -365,7 +365,7 @@ public function setPostalCode($postal_code = null) * * @return string|null */ - public function getPostalCode() + public function getPostalCode(): ?string { return $this->postal_code; } @@ -377,7 +377,7 @@ public function getPostalCode() * * @return CustomerAddress */ - public function setAddr01($addr01 = null) + public function setAddr01($addr01 = null): CustomerAddress { $this->addr01 = $addr01; @@ -389,7 +389,7 @@ public function setAddr01($addr01 = null) * * @return string|null */ - public function getAddr01() + public function getAddr01(): ?string { return $this->addr01; } @@ -401,7 +401,7 @@ public function getAddr01() * * @return CustomerAddress */ - public function setAddr02($addr02 = null) + public function setAddr02($addr02 = null): CustomerAddress { $this->addr02 = $addr02; @@ -413,7 +413,7 @@ public function setAddr02($addr02 = null) * * @return string|null */ - public function getAddr02() + public function getAddr02(): ?string { return $this->addr02; } @@ -425,7 +425,7 @@ public function getAddr02() * * @return CustomerAddress */ - public function setPhoneNumber($phone_number = null) + public function setPhoneNumber($phone_number = null): CustomerAddress { $this->phone_number = $phone_number; @@ -437,7 +437,7 @@ public function setPhoneNumber($phone_number = null) * * @return string|null */ - public function getPhoneNumber() + public function getPhoneNumber(): ?string { return $this->phone_number; } @@ -449,7 +449,7 @@ public function getPhoneNumber() * * @return CustomerAddress */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): CustomerAddress { $this->create_date = $createDate; @@ -459,9 +459,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -473,7 +473,7 @@ public function getCreateDate() * * @return CustomerAddress */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): CustomerAddress { $this->update_date = $updateDate; @@ -483,9 +483,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -497,7 +497,7 @@ public function getUpdateDate() * * @return CustomerAddress */ - public function setCustomer(?Customer $customer = null) + public function setCustomer(?Customer $customer = null): CustomerAddress { $this->Customer = $customer; @@ -509,7 +509,7 @@ public function setCustomer(?Customer $customer = null) * * @return Customer|null */ - public function getCustomer() + public function getCustomer(): ?Customer { return $this->Customer; } @@ -521,7 +521,7 @@ public function getCustomer() * * @return CustomerAddress */ - public function setCountry(?Master\Country $country = null) + public function setCountry(?Master\Country $country = null): CustomerAddress { $this->Country = $country; @@ -533,7 +533,7 @@ public function setCountry(?Master\Country $country = null) * * @return Master\Country|null */ - public function getCountry() + public function getCountry(): ?Master\Country { return $this->Country; } @@ -545,7 +545,7 @@ public function getCountry() * * @return CustomerAddress */ - public function setPref(?Master\Pref $pref = null) + public function setPref(?Master\Pref $pref = null): CustomerAddress { $this->Pref = $pref; @@ -557,7 +557,7 @@ public function setPref(?Master\Pref $pref = null) * * @return Master\Pref|null */ - public function getPref() + public function getPref(): ?Master\Pref { return $this->Pref; } diff --git a/src/Eccube/Entity/CustomerFavoriteProduct.php b/src/Eccube/Entity/CustomerFavoriteProduct.php index f15dcbfba8f..b6d7072bf63 100644 --- a/src/Eccube/Entity/CustomerFavoriteProduct.php +++ b/src/Eccube/Entity/CustomerFavoriteProduct.php @@ -85,9 +85,9 @@ class CustomerFavoriteProduct extends AbstractEntity /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -99,7 +99,7 @@ public function getId() * * @return CustomerFavoriteProduct */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): CustomerFavoriteProduct { $this->create_date = $createDate; @@ -109,9 +109,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -123,7 +123,7 @@ public function getCreateDate() * * @return CustomerFavoriteProduct */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): CustomerFavoriteProduct { $this->update_date = $updateDate; @@ -133,9 +133,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -147,7 +147,7 @@ public function getUpdateDate() * * @return CustomerFavoriteProduct */ - public function setCustomer(?Customer $customer = null) + public function setCustomer(?Customer $customer = null): CustomerFavoriteProduct { $this->Customer = $customer; @@ -159,7 +159,7 @@ public function setCustomer(?Customer $customer = null) * * @return Customer|null */ - public function getCustomer() + public function getCustomer(): ?Customer { return $this->Customer; } @@ -171,7 +171,7 @@ public function getCustomer() * * @return CustomerFavoriteProduct */ - public function setProduct(?Product $product = null) + public function setProduct(?Product $product = null): CustomerFavoriteProduct { $this->Product = $product; @@ -183,7 +183,7 @@ public function setProduct(?Product $product = null) * * @return Product|null */ - public function getProduct() + public function getProduct(): ?Product { return $this->Product; } diff --git a/src/Eccube/Entity/Delivery.php b/src/Eccube/Entity/Delivery.php index 56ba6fb9f91..c2397d655ee 100644 --- a/src/Eccube/Entity/Delivery.php +++ b/src/Eccube/Entity/Delivery.php @@ -171,9 +171,9 @@ public function __construct() /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -185,7 +185,7 @@ public function getId() * * @return Delivery */ - public function setName($name = null) + public function setName($name = null): Delivery { $this->name = $name; @@ -197,7 +197,7 @@ public function setName($name = null) * * @return string|null */ - public function getName() + public function getName(): ?string { return $this->name; } @@ -209,7 +209,7 @@ public function getName() * * @return Delivery */ - public function setServiceName($serviceName = null) + public function setServiceName($serviceName = null): Delivery { $this->service_name = $serviceName; @@ -221,7 +221,7 @@ public function setServiceName($serviceName = null) * * @return string|null */ - public function getServiceName() + public function getServiceName(): ?string { return $this->service_name; } @@ -233,7 +233,7 @@ public function getServiceName() * * @return Delivery */ - public function setDescription($description = null) + public function setDescription($description = null): Delivery { $this->description = $description; @@ -245,7 +245,7 @@ public function setDescription($description = null) * * @return string|null */ - public function getDescription() + public function getDescription(): ?string { return $this->description; } @@ -257,7 +257,7 @@ public function getDescription() * * @return Delivery */ - public function setConfirmUrl($confirmUrl = null) + public function setConfirmUrl($confirmUrl = null): Delivery { $this->confirm_url = $confirmUrl; @@ -269,7 +269,7 @@ public function setConfirmUrl($confirmUrl = null) * * @return string|null */ - public function getConfirmUrl() + public function getConfirmUrl(): ?string { return $this->confirm_url; } @@ -281,7 +281,7 @@ public function getConfirmUrl() * * @return Delivery */ - public function setSortNo($sortNo = null) + public function setSortNo($sortNo = null): Delivery { $this->sort_no = $sortNo; @@ -293,7 +293,7 @@ public function setSortNo($sortNo = null) * * @return int|null */ - public function getSortNo() + public function getSortNo(): ?int { return $this->sort_no; } @@ -305,7 +305,7 @@ public function getSortNo() * * @return Delivery */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Delivery { $this->create_date = $createDate; @@ -315,9 +315,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -329,7 +329,7 @@ public function getCreateDate() * * @return Delivery */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Delivery { $this->update_date = $updateDate; @@ -339,9 +339,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -353,7 +353,7 @@ public function getUpdateDate() * * @return Delivery */ - public function addPaymentOption(PaymentOption $paymentOption) + public function addPaymentOption(PaymentOption $paymentOption): Delivery { $this->PaymentOptions[] = $paymentOption; @@ -367,7 +367,7 @@ public function addPaymentOption(PaymentOption $paymentOption) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removePaymentOption(PaymentOption $paymentOption) + public function removePaymentOption(PaymentOption $paymentOption): bool { return $this->PaymentOptions->removeElement($paymentOption); } @@ -377,7 +377,7 @@ public function removePaymentOption(PaymentOption $paymentOption) * * @return \Doctrine\Common\Collections\Collection */ - public function getPaymentOptions() + public function getPaymentOptions(): \Doctrine\Common\Collections\Collection { return $this->PaymentOptions; } @@ -389,7 +389,7 @@ public function getPaymentOptions() * * @return Delivery */ - public function addDeliveryFee(DeliveryFee $deliveryFee) + public function addDeliveryFee(DeliveryFee $deliveryFee): Delivery { $this->DeliveryFees[] = $deliveryFee; @@ -403,7 +403,7 @@ public function addDeliveryFee(DeliveryFee $deliveryFee) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeDeliveryFee(DeliveryFee $deliveryFee) + public function removeDeliveryFee(DeliveryFee $deliveryFee): bool { return $this->DeliveryFees->removeElement($deliveryFee); } @@ -413,7 +413,7 @@ public function removeDeliveryFee(DeliveryFee $deliveryFee) * * @return \Doctrine\Common\Collections\Collection */ - public function getDeliveryFees() + public function getDeliveryFees(): \Doctrine\Common\Collections\Collection { return $this->DeliveryFees; } @@ -425,7 +425,7 @@ public function getDeliveryFees() * * @return Delivery */ - public function addDeliveryTime(DeliveryTime $deliveryTime) + public function addDeliveryTime(DeliveryTime $deliveryTime): Delivery { $this->DeliveryTimes[] = $deliveryTime; @@ -439,7 +439,7 @@ public function addDeliveryTime(DeliveryTime $deliveryTime) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeDeliveryTime(DeliveryTime $deliveryTime) + public function removeDeliveryTime(DeliveryTime $deliveryTime): bool { return $this->DeliveryTimes->removeElement($deliveryTime); } @@ -449,7 +449,7 @@ public function removeDeliveryTime(DeliveryTime $deliveryTime) * * @return \Doctrine\Common\Collections\Collection */ - public function getDeliveryTimes() + public function getDeliveryTimes(): \Doctrine\Common\Collections\Collection { return $this->DeliveryTimes; } @@ -461,7 +461,7 @@ public function getDeliveryTimes() * * @return Delivery */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): Delivery { $this->Creator = $creator; @@ -473,7 +473,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } @@ -485,7 +485,7 @@ public function getCreator() * * @return Delivery */ - public function setSaleType(?Master\SaleType $saleType = null) + public function setSaleType(?Master\SaleType $saleType = null): Delivery { $this->SaleType = $saleType; @@ -497,7 +497,7 @@ public function setSaleType(?Master\SaleType $saleType = null) * * @return Master\SaleType|null */ - public function getSaleType() + public function getSaleType(): ?Master\SaleType { return $this->SaleType; } @@ -509,7 +509,7 @@ public function getSaleType() * * @return Delivery */ - public function setVisible($visible) + public function setVisible($visible): Delivery { $this->visible = $visible; @@ -521,7 +521,7 @@ public function setVisible($visible) * * @return bool */ - public function isVisible() + public function isVisible(): bool { return $this->visible; } diff --git a/src/Eccube/Entity/DeliveryDuration.php b/src/Eccube/Entity/DeliveryDuration.php index 81c17438fc0..729e42a7aea 100644 --- a/src/Eccube/Entity/DeliveryDuration.php +++ b/src/Eccube/Entity/DeliveryDuration.php @@ -79,7 +79,7 @@ public function __toString(): string * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -91,7 +91,7 @@ public function getId() * * @return DeliveryDuration */ - public function setName($name = null) + public function setName($name = null): DeliveryDuration { $this->name = $name; @@ -103,7 +103,7 @@ public function setName($name = null) * * @return string|null */ - public function getName() + public function getName(): ?string { return $this->name; } @@ -115,7 +115,7 @@ public function getName() * * @return DeliveryDuration */ - public function setDuration($duration) + public function setDuration($duration): DeliveryDuration { $this->duration = $duration; @@ -127,7 +127,7 @@ public function setDuration($duration) * * @return int */ - public function getDuration() + public function getDuration(): int { return $this->duration; } @@ -139,7 +139,7 @@ public function getDuration() * * @return DeliveryDuration */ - public function setSortNo($sortNo) + public function setSortNo($sortNo): DeliveryDuration { $this->sort_no = $sortNo; @@ -151,7 +151,7 @@ public function setSortNo($sortNo) * * @return int */ - public function getSortNo() + public function getSortNo(): int { return $this->sort_no; } diff --git a/src/Eccube/Entity/DeliveryFee.php b/src/Eccube/Entity/DeliveryFee.php index ad41400976f..7010eba7f0b 100644 --- a/src/Eccube/Entity/DeliveryFee.php +++ b/src/Eccube/Entity/DeliveryFee.php @@ -80,7 +80,7 @@ class DeliveryFee extends AbstractEntity * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -92,7 +92,7 @@ public function getId() * * @return DeliveryFee */ - public function setFee($fee) + public function setFee($fee): DeliveryFee { $this->fee = $fee; @@ -102,9 +102,9 @@ public function setFee($fee) /** * Get fee. * - * @return string + * @return string|null */ - public function getFee() + public function getFee(): ?string { return $this->fee; } @@ -116,7 +116,7 @@ public function getFee() * * @return DeliveryFee */ - public function setDelivery(?Delivery $delivery = null) + public function setDelivery(?Delivery $delivery = null): DeliveryFee { $this->Delivery = $delivery; @@ -128,7 +128,7 @@ public function setDelivery(?Delivery $delivery = null) * * @return Delivery|null */ - public function getDelivery() + public function getDelivery(): ?Delivery { return $this->Delivery; } @@ -140,7 +140,7 @@ public function getDelivery() * * @return DeliveryFee */ - public function setPref(?Master\Pref $pref = null) + public function setPref(?Master\Pref $pref = null): DeliveryFee { $this->Pref = $pref; @@ -152,7 +152,7 @@ public function setPref(?Master\Pref $pref = null) * * @return Master\Pref|null */ - public function getPref() + public function getPref(): ?Master\Pref { return $this->Pref; } diff --git a/src/Eccube/Entity/DeliveryTime.php b/src/Eccube/Entity/DeliveryTime.php index 97ff5e9936c..28045b1a5b8 100644 --- a/src/Eccube/Entity/DeliveryTime.php +++ b/src/Eccube/Entity/DeliveryTime.php @@ -102,7 +102,7 @@ public function __toString(): string * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -114,7 +114,7 @@ public function getId() * * @return DeliveryTime */ - public function setDeliveryTime($deliveryTime) + public function setDeliveryTime($deliveryTime): DeliveryTime { $this->delivery_time = $deliveryTime; @@ -126,7 +126,7 @@ public function setDeliveryTime($deliveryTime) * * @return string */ - public function getDeliveryTime() + public function getDeliveryTime(): string { return $this->delivery_time; } @@ -138,7 +138,7 @@ public function getDeliveryTime() * * @return DeliveryTime */ - public function setDelivery(?Delivery $delivery = null) + public function setDelivery(?Delivery $delivery = null): DeliveryTime { $this->Delivery = $delivery; @@ -150,7 +150,7 @@ public function setDelivery(?Delivery $delivery = null) * * @return Delivery|null */ - public function getDelivery() + public function getDelivery(): ?Delivery { return $this->Delivery; } @@ -162,7 +162,7 @@ public function getDelivery() * * @return $this */ - public function setSortNo($sort_no) + public function setSortNo($sort_no): static { $this->sort_no = $sort_no; @@ -174,7 +174,7 @@ public function setSortNo($sort_no) * * @return int */ - public function getSortNo() + public function getSortNo(): int { return $this->sort_no; } @@ -186,7 +186,7 @@ public function getSortNo() * * @return DeliveryTime */ - public function setVisible($visible) + public function setVisible($visible): DeliveryTime { $this->visible = $visible; @@ -198,7 +198,7 @@ public function setVisible($visible) * * @return bool */ - public function isVisible() + public function isVisible(): bool { return $this->visible; } @@ -210,7 +210,7 @@ public function isVisible() * * @return DeliveryTime */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): DeliveryTime { $this->create_date = $createDate; @@ -220,9 +220,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -234,7 +234,7 @@ public function getCreateDate() * * @return DeliveryTime */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): DeliveryTime { $this->update_date = $updateDate; @@ -244,9 +244,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } diff --git a/src/Eccube/Entity/ExportCsvRow.php b/src/Eccube/Entity/ExportCsvRow.php index cc370ccc77e..18a364bbdfe 100644 --- a/src/Eccube/Entity/ExportCsvRow.php +++ b/src/Eccube/Entity/ExportCsvRow.php @@ -33,7 +33,7 @@ class ExportCsvRow extends AbstractEntity * * @return ExportCsvRow */ - public function setData($data = null) + public function setData($data = null): ExportCsvRow { $this->data = $data; @@ -45,7 +45,7 @@ public function setData($data = null) * * @return bool */ - public function isDataNull() + public function isDataNull(): bool { if (is_null($this->data)) { return true; @@ -59,7 +59,7 @@ public function isDataNull() * * @return void */ - public function pushData() + public function pushData(): void { $this->row[] = $this->data; $this->data = null; @@ -70,7 +70,7 @@ public function pushData() * * @return array */ - public function getRow() + public function getRow(): array { return $this->row; } diff --git a/src/Eccube/Entity/ItemHolderInterface.php b/src/Eccube/Entity/ItemHolderInterface.php index 7b331fd9580..53f4086e43b 100644 --- a/src/Eccube/Entity/ItemHolderInterface.php +++ b/src/Eccube/Entity/ItemHolderInterface.php @@ -13,7 +13,7 @@ namespace Eccube\Entity; -use Doctrine\Common\Collections\ArrayCollection; +use Doctrine\Common\Collections\Collection; use Eccube\Service\PurchaseFlow\ItemCollection; interface ItemHolderInterface @@ -21,140 +21,140 @@ interface ItemHolderInterface /** * @return ItemCollection|ItemCollection */ - public function getItems(); + public function getItems(): ItemCollection; /** * 合計金額を返します。 * * @return string */ - public function getTotal(); + public function getTotal(): string; /** * 合計金額を設定します。 * * @param string $total * - * @return ItemHolderInterface + * @return $this */ - public function setTotal($total); + public function setTotal($total): static; /** * 個数の合計を返します。 * * @return string */ - public function getQuantity(); + public function getQuantity(): string; /** * 送料合計を設定します。 * * @param string $total * - * @return ItemHolderInterface + * @return $this */ - public function setDeliveryFeeTotal($total); + public function setDeliveryFeeTotal($total): static; /** * 送料合計を返します。 * * @return string */ - public function getDeliveryFeeTotal(); + public function getDeliveryFeeTotal(): string; /** * 値引き合計を設定します。 * * @param string $total * - * @return ItemHolderInterface|void + * @return $this */ - public function setDiscount($total); + public function setDiscount($total): static; /** * 手数料合計を設定します。 * * @param string $total * - * @return ItemHolderInterface|void + * @return $this */ - public function setCharge($total); + public function setCharge($total): static; /** * 税額合計を設定します。 * * @param string $total * - * @return ItemHolderInterface|void + * @return $this * * @deprecated 明細ごとに集計した税額と差異が発生する場合があるため非推奨 */ - public function setTax($total); + public function setTax($total): static; /** * 加算ポイントを設定します。 * * @param string $addPoint * - * @return ItemHolderInterface + * @return $this */ - public function setAddPoint($addPoint); + public function setAddPoint($addPoint): static; /** * 加算ポイントを返します. * * @return string */ - public function getAddPoint(); + public function getAddPoint(): string; /** * 利用ポイントを設定します。 * * @param string $usePoint * - * @return ItemHolderInterface + * @return $this */ - public function setUsePoint($usePoint); + public function setUsePoint($usePoint): static; /** * 利用ポイントを返します. * - * @return string + * @return string|null */ - public function getUsePoint(); + public function getUsePoint(): ?string; /** * @param ItemInterface $item * * @return void */ - public function addItem(ItemInterface $item); + public function addItem(ItemInterface $item): void; /** * Get customer. * * @return Customer|null */ - public function getCustomer(); + public function getCustomer(): ?Customer; /** * 出荷情報を追加します - 注文のみ * - * @return ArrayCollection + * @return Collection */ - public function getShippings(); + public function getShippings(): Collection; /** * 注文ステータスを返す - 注文のみ * - * @return mixed + * @return Master\OrderStatus|null */ - public function getOrderStatus(); + public function getOrderStatus(): ?Master\OrderStatus; /** * 商品の受注明細を取得 - 注文のみ * * @return OrderItem[] */ - public function getProductOrderItems(); + public function getProductOrderItems(): array; } diff --git a/src/Eccube/Entity/ItemInterface.php b/src/Eccube/Entity/ItemInterface.php index 1d2e525875d..06254922587 100644 --- a/src/Eccube/Entity/ItemInterface.php +++ b/src/Eccube/Entity/ItemInterface.php @@ -20,47 +20,47 @@ interface ItemInterface * * @return bool 商品明細の場合 true */ - public function isProduct(); + public function isProduct(): bool; /** * 送料明細かどうか. * * @return bool 送料明細の場合 true */ - public function isDeliveryFee(); + public function isDeliveryFee(): bool; /** * 手数料明細かどうか. * * @return bool 手数料明細の場合 true */ - public function isCharge(); + public function isCharge(): bool; /** * 値引き明細かどうか. * * @return bool 値引き明細の場合 true */ - public function isDiscount(); + public function isDiscount(): bool; /** * ポイント明細かどうか. * * @return bool ポイント明細の場合 true */ - public function isPoint(); + public function isPoint(): bool; /** * 税額明細かどうか. * * @return bool 税額明細の場合 true */ - public function isTax(); + public function isTax(): bool; /** * @return Master\OrderItemType|null */ - public function getOrderItemType(); + public function getOrderItemType(): ?Master\OrderItemType; /** * @return ?ProductClass @@ -68,41 +68,41 @@ public function getOrderItemType(); public function getProductClass(); /** - * @return string + * @return string|null */ - public function getPrice(); + public function getPrice(): ?string; /** * @return string */ - public function getQuantity(); + public function getQuantity(): string; /** * @param string $quantity * - * @return ItemInterface + * @return $this */ - public function setQuantity($quantity); + public function setQuantity($quantity): static; /** - * @return int + * @return int|null */ - public function getId(); + public function getId(): ?int; /** - * @return string + * @return string|null */ - public function getPointRate(); + public function getPointRate(): ?string; /** - * @param string $price + * @param string|null $price * * @return $this */ - public function setPrice($price); + public function setPrice($price): static; /** * @return string */ - public function getPriceIncTax(); + public function getPriceIncTax(): string; } diff --git a/src/Eccube/Entity/Layout.php b/src/Eccube/Entity/Layout.php index f971413d4d8..cc893074280 100644 --- a/src/Eccube/Entity/Layout.php +++ b/src/Eccube/Entity/Layout.php @@ -75,7 +75,7 @@ public function __toString(): string /** * @return bool */ - public function isDefault() + public function isDefault(): bool { return in_array($this->id, [self::DEFAULT_LAYOUT_PREVIEW_PAGE, self::DEFAULT_LAYOUT_TOP_PAGE, self::DEFAULT_LAYOUT_UNDERLAYER_PAGE]); } @@ -83,7 +83,7 @@ public function isDefault() /** * @return Page[] */ - public function getPages() + public function getPages(): array { $Pages = []; foreach ($this->PageLayouts as $PageLayout) { @@ -98,7 +98,7 @@ public function getPages() * * @return Block[] */ - public function getBlocks($targetId = null) + public function getBlocks($targetId = null): array { /** @var BlockPosition[] $TargetBlockPositions */ $TargetBlockPositions = []; @@ -131,9 +131,9 @@ public function getBlocks($targetId = null) /** * @param int $targetId * - * @return BlockPosition[]|Collection + * @return Collection */ - public function getBlockPositionsByTargetId($targetId) + public function getBlockPositionsByTargetId($targetId): Collection { return $this->BlockPositions->filter( function ($BlockPosition) use ($targetId) { @@ -145,7 +145,7 @@ function ($BlockPosition) use ($targetId) { /** * @return Block[] */ - public function getUnused() + public function getUnused(): array { return $this->getBlocks(self::TARGET_ID_UNUSED); } @@ -153,7 +153,7 @@ public function getUnused() /** * @return Block[] */ - public function getHead() + public function getHead(): array { return $this->getBlocks(self::TARGET_ID_HEAD); } @@ -161,7 +161,7 @@ public function getHead() /** * @return Block[] */ - public function getBodyAfter() + public function getBodyAfter(): array { return $this->getBlocks(self::TARGET_ID_BODY_AFTER); } @@ -169,7 +169,7 @@ public function getBodyAfter() /** * @return Block[] */ - public function getHeader() + public function getHeader(): array { return $this->getBlocks(self::TARGET_ID_HEADER); } @@ -177,7 +177,7 @@ public function getHeader() /** * @return Block[] */ - public function getContentsTop() + public function getContentsTop(): array { return $this->getBlocks(self::TARGET_ID_CONTENTS_TOP); } @@ -185,7 +185,7 @@ public function getContentsTop() /** * @return Block[] */ - public function getSideLeft() + public function getSideLeft(): array { return $this->getBlocks(self::TARGET_ID_SIDE_LEFT); } @@ -193,7 +193,7 @@ public function getSideLeft() /** * @return Block[] */ - public function getMainTop() + public function getMainTop(): array { return $this->getBlocks(self::TARGET_ID_MAIN_TOP); } @@ -201,7 +201,7 @@ public function getMainTop() /** * @return Block[] */ - public function getMainBottom() + public function getMainBottom(): array { return $this->getBlocks(self::TARGET_ID_MAIN_BOTTOM); } @@ -209,7 +209,7 @@ public function getMainBottom() /** * @return Block[] */ - public function getSideRight() + public function getSideRight(): array { return $this->getBlocks(self::TARGET_ID_SIDE_RIGHT); } @@ -217,7 +217,7 @@ public function getSideRight() /** * @return Block[] */ - public function getContentsBottom() + public function getContentsBottom(): array { return $this->getBlocks(self::TARGET_ID_CONTENTS_BOTTOM); } @@ -225,7 +225,7 @@ public function getContentsBottom() /** * @return Block[] */ - public function getFooter() + public function getFooter(): array { return $this->getBlocks(self::TARGET_ID_FOOTER); } @@ -233,7 +233,7 @@ public function getFooter() /** * @return Block[] */ - public function getDrawer() + public function getDrawer(): array { return $this->getBlocks(self::TARGET_ID_DRAWER); } @@ -241,7 +241,7 @@ public function getDrawer() /** * @return Block[] */ - public function getCloseBodyBefore() + public function getCloseBodyBefore(): array { return $this->getBlocks(self::TARGET_ID_CLOSE_BODY_BEFORE); } @@ -251,7 +251,7 @@ public function getCloseBodyBefore() * * @return int */ - public function getColumnNum() + public function getColumnNum(): int { return 1 + ($this->getSideLeft() ? 1 : 0) + ($this->getSideRight() ? 1 : 0); } @@ -336,7 +336,7 @@ public function __construct() * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -348,7 +348,7 @@ public function getId() * * @return Layout */ - public function setName($name) + public function setName($name): Layout { $this->name = $name; @@ -360,7 +360,7 @@ public function setName($name) * * @return string */ - public function getName() + public function getName(): string { return $this->name; } @@ -372,7 +372,7 @@ public function getName() * * @return Layout */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Layout { $this->create_date = $createDate; @@ -384,7 +384,7 @@ public function setCreateDate($createDate) * * @return \DateTime */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -396,7 +396,7 @@ public function getCreateDate() * * @return Layout */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Layout { $this->update_date = $updateDate; @@ -408,7 +408,7 @@ public function setUpdateDate($updateDate) * * @return \DateTime */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -420,7 +420,7 @@ public function getUpdateDate() * * @return Layout */ - public function addBlockPosition(BlockPosition $blockPosition) + public function addBlockPosition(BlockPosition $blockPosition): Layout { $this->BlockPositions[] = $blockPosition; @@ -434,7 +434,7 @@ public function addBlockPosition(BlockPosition $blockPosition) * * @return void */ - public function removeBlockPosition(BlockPosition $blockPosition) + public function removeBlockPosition(BlockPosition $blockPosition): void { $this->BlockPositions->removeElement($blockPosition); } @@ -444,7 +444,7 @@ public function removeBlockPosition(BlockPosition $blockPosition) * * @return Collection */ - public function getBlockPositions() + public function getBlockPositions(): Collection { return $this->BlockPositions; } @@ -456,7 +456,7 @@ public function getBlockPositions() * * @return Layout */ - public function addPageLayout(PageLayout $PageLayout) + public function addPageLayout(PageLayout $PageLayout): Layout { $this->PageLayouts[] = $PageLayout; @@ -470,7 +470,7 @@ public function addPageLayout(PageLayout $PageLayout) * * @return void */ - public function removePageLayout(PageLayout $PageLayout) + public function removePageLayout(PageLayout $PageLayout): void { $this->PageLayouts->removeElement($PageLayout); } @@ -480,7 +480,7 @@ public function removePageLayout(PageLayout $PageLayout) * * @return Collection */ - public function getPageLayouts() + public function getPageLayouts(): Collection { return $this->PageLayouts; } @@ -492,7 +492,7 @@ public function getPageLayouts() * * @return Layout */ - public function setDeviceType(?Master\DeviceType $deviceType = null) + public function setDeviceType(?Master\DeviceType $deviceType = null): Layout { $this->DeviceType = $deviceType; @@ -504,7 +504,7 @@ public function setDeviceType(?Master\DeviceType $deviceType = null) * * @return Master\DeviceType|null */ - public function getDeviceType() + public function getDeviceType(): ?Master\DeviceType { return $this->DeviceType; } @@ -514,7 +514,7 @@ public function getDeviceType() * * @return bool */ - public function isDeletable() + public function isDeletable(): bool { if (!$this->getPageLayouts()->isEmpty()) { return false; diff --git a/src/Eccube/Entity/LoginHistory.php b/src/Eccube/Entity/LoginHistory.php index e1f35995d78..790c88e87c6 100644 --- a/src/Eccube/Entity/LoginHistory.php +++ b/src/Eccube/Entity/LoginHistory.php @@ -102,7 +102,7 @@ class LoginHistory extends AbstractEntity * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -114,7 +114,7 @@ public function getId() * * @return LoginHistory */ - public function setUserName($userName) + public function setUserName($userName): LoginHistory { $this->user_name = $userName; @@ -126,7 +126,7 @@ public function setUserName($userName) * * @return string */ - public function getUserName() + public function getUserName(): string { return $this->user_name; } @@ -136,7 +136,7 @@ public function getUserName() * * @return LoginHistory */ - public function setStatus($Status) + public function setStatus($Status): LoginHistory { $this->Status = $Status; @@ -146,7 +146,7 @@ public function setStatus($Status) /** * @return LoginHistoryStatus */ - public function getStatus() + public function getStatus(): LoginHistoryStatus { return $this->Status; } @@ -158,7 +158,7 @@ public function getStatus() * * @return LoginHistory */ - public function setClientIp($clientIp) + public function setClientIp($clientIp): LoginHistory { $this->client_ip = $clientIp; @@ -170,7 +170,7 @@ public function setClientIp($clientIp) * * @return string */ - public function getClientIp() + public function getClientIp(): string { return $this->client_ip; } @@ -182,7 +182,7 @@ public function getClientIp() * * @return LoginHistory */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): LoginHistory { $this->create_date = $createDate; @@ -194,7 +194,7 @@ public function setCreateDate($createDate) * * @return \DateTime */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -206,7 +206,7 @@ public function getCreateDate() * * @return LoginHistory */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): LoginHistory { $this->update_date = $updateDate; @@ -218,7 +218,7 @@ public function setUpdateDate($updateDate) * * @return \DateTime */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -230,7 +230,7 @@ public function getUpdateDate() * * @return LoginHistory */ - public function setLoginUser(?Member $loginUser = null) + public function setLoginUser(?Member $loginUser = null): LoginHistory { $this->LoginUser = $loginUser; @@ -242,7 +242,7 @@ public function setLoginUser(?Member $loginUser = null) * * @return Member */ - public function getLoginUser() + public function getLoginUser(): Member { return $this->LoginUser; } diff --git a/src/Eccube/Entity/MailHistory.php b/src/Eccube/Entity/MailHistory.php index 53ace760e4b..024de1c9e0c 100644 --- a/src/Eccube/Entity/MailHistory.php +++ b/src/Eccube/Entity/MailHistory.php @@ -110,7 +110,7 @@ public function __toString(): string * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -122,7 +122,7 @@ public function getId() * * @return MailHistory */ - public function setSendDate($sendDate = null) + public function setSendDate($sendDate = null): MailHistory { $this->send_date = $sendDate; @@ -134,7 +134,7 @@ public function setSendDate($sendDate = null) * * @return \DateTime|null */ - public function getSendDate() + public function getSendDate(): ?\DateTime { return $this->send_date; } @@ -146,7 +146,7 @@ public function getSendDate() * * @return MailHistory */ - public function setMailSubject($mailSubject = null) + public function setMailSubject($mailSubject = null): MailHistory { $this->mail_subject = $mailSubject; @@ -158,7 +158,7 @@ public function setMailSubject($mailSubject = null) * * @return string|null */ - public function getMailSubject() + public function getMailSubject(): ?string { return $this->mail_subject; } @@ -170,7 +170,7 @@ public function getMailSubject() * * @return MailHistory */ - public function setMailBody($mailBody = null) + public function setMailBody($mailBody = null): MailHistory { $this->mail_body = $mailBody; @@ -182,7 +182,7 @@ public function setMailBody($mailBody = null) * * @return string|null */ - public function getMailBody() + public function getMailBody(): ?string { return $this->mail_body; } @@ -194,7 +194,7 @@ public function getMailBody() * * @return MailHistory */ - public function setMailHtmlBody($mailHtmlBody = null) + public function setMailHtmlBody($mailHtmlBody = null): MailHistory { $this->mail_html_body = $mailHtmlBody; @@ -206,7 +206,7 @@ public function setMailHtmlBody($mailHtmlBody = null) * * @return string|null */ - public function getMailHtmlBody() + public function getMailHtmlBody(): ?string { return $this->mail_html_body; } @@ -218,7 +218,7 @@ public function getMailHtmlBody() * * @return MailHistory */ - public function setOrder(?Order $order = null) + public function setOrder(?Order $order = null): MailHistory { $this->Order = $order; @@ -230,7 +230,7 @@ public function setOrder(?Order $order = null) * * @return Order|null */ - public function getOrder() + public function getOrder(): ?Order { return $this->Order; } @@ -242,7 +242,7 @@ public function getOrder() * * @return MailHistory */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): MailHistory { $this->Creator = $creator; @@ -254,7 +254,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } diff --git a/src/Eccube/Entity/MailTemplate.php b/src/Eccube/Entity/MailTemplate.php index 96a3db7853e..a352661a392 100644 --- a/src/Eccube/Entity/MailTemplate.php +++ b/src/Eccube/Entity/MailTemplate.php @@ -112,9 +112,9 @@ public function __toString(): string /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -126,7 +126,7 @@ public function getId() * * @return MailTemplate */ - public function setName($name = null) + public function setName($name = null): MailTemplate { $this->name = $name; @@ -138,7 +138,7 @@ public function setName($name = null) * * @return string|null */ - public function getName() + public function getName(): ?string { return $this->name; } @@ -150,7 +150,7 @@ public function getName() * * @return MailTemplate */ - public function setFileName($fileName = null) + public function setFileName($fileName = null): MailTemplate { $this->file_name = $fileName; @@ -162,7 +162,7 @@ public function setFileName($fileName = null) * * @return string|null */ - public function getFileName() + public function getFileName(): ?string { return $this->file_name; } @@ -174,7 +174,7 @@ public function getFileName() * * @return MailTemplate */ - public function setMailSubject($mailSubject = null) + public function setMailSubject($mailSubject = null): MailTemplate { $this->mail_subject = $mailSubject; @@ -186,7 +186,7 @@ public function setMailSubject($mailSubject = null) * * @return string|null */ - public function getMailSubject() + public function getMailSubject(): ?string { return $this->mail_subject; } @@ -198,7 +198,7 @@ public function getMailSubject() * * @return MailTemplate */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): MailTemplate { $this->create_date = $createDate; @@ -208,9 +208,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -222,7 +222,7 @@ public function getCreateDate() * * @return MailTemplate */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): MailTemplate { $this->update_date = $updateDate; @@ -232,9 +232,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -246,7 +246,7 @@ public function getUpdateDate() * * @return MailTemplate */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): MailTemplate { $this->Creator = $creator; @@ -258,7 +258,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } @@ -276,7 +276,7 @@ public function isDeletable(): bool * * @return $this */ - public function setDeletable(bool $deletable): self + public function setDeletable(bool $deletable): static { $this->deletable = $deletable; diff --git a/src/Eccube/Entity/Master/AbstractMasterEntity.php b/src/Eccube/Entity/Master/AbstractMasterEntity.php index 8cc3605e1f2..c353d865f24 100644 --- a/src/Eccube/Entity/Master/AbstractMasterEntity.php +++ b/src/Eccube/Entity/Master/AbstractMasterEntity.php @@ -28,7 +28,7 @@ abstract class AbstractMasterEntity extends \Eccube\Entity\AbstractEntity implem #[\Override] public function __toString(): string { - return (string) $this->getName(); + return $this->getName(); } /** @@ -63,7 +63,7 @@ public function __toString(): string * * @return $this */ - public function setId($id) + public function setId($id): static { $this->id = $id; @@ -75,7 +75,7 @@ public function setId($id) * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -87,7 +87,7 @@ public function getId() * * @return $this */ - public function setName($name) + public function setName($name): static { $this->name = $name; @@ -99,7 +99,7 @@ public function setName($name) * * @return string */ - public function getName() + public function getName(): string { return $this->name; } @@ -111,7 +111,7 @@ public function getName() * * @return $this */ - public function setSortNo($sortNo) + public function setSortNo($sortNo): static { $this->sort_no = $sortNo; @@ -123,7 +123,7 @@ public function setSortNo($sortNo) * * @return int */ - public function getSortNo() + public function getSortNo(): int { return $this->sort_no; } @@ -133,7 +133,7 @@ public function getSortNo() * * @return mixed */ - public function __get($name) + public function __get($name): mixed { return self::getConstantValue($name); } @@ -141,10 +141,8 @@ public function __get($name) /** * @param string $name * @param mixed $value - * - * @return mixed */ - public function __set($name, $value) + public function __set($name, $value): void { throw new \InvalidArgumentException(); } @@ -155,7 +153,7 @@ public function __set($name, $value) * * @return mixed */ - public static function __callStatic($name, $arguments) + public static function __callStatic($name, $arguments): mixed { return self::getConstantValue($name); } @@ -167,7 +165,7 @@ public static function __callStatic($name, $arguments) * * @throws \ReflectionException */ - protected static function getConstantValue($name) + protected static function getConstantValue($name): mixed { if (in_array($name, ['id', 'name', 'sortNo'])) { throw new \InvalidArgumentException(); diff --git a/src/Eccube/Entity/Master/OrderItemType.php b/src/Eccube/Entity/Master/OrderItemType.php index 364eadfc533..752f170780e 100644 --- a/src/Eccube/Entity/Master/OrderItemType.php +++ b/src/Eccube/Entity/Master/OrderItemType.php @@ -82,7 +82,7 @@ class OrderItemType extends AbstractMasterEntity * * @return bool */ - public function isProduct() + public function isProduct(): bool { if ($this->id == self::PRODUCT) { return true; diff --git a/src/Eccube/Entity/Master/OrderStatus.php b/src/Eccube/Entity/Master/OrderStatus.php index 0acbd898a36..aeaaf1e755b 100644 --- a/src/Eccube/Entity/Master/OrderStatus.php +++ b/src/Eccube/Entity/Master/OrderStatus.php @@ -62,7 +62,7 @@ class OrderStatus extends AbstractMasterEntity /** * @return bool */ - public function isDisplayOrderCount() + public function isDisplayOrderCount(): bool { return $this->display_order_count; } @@ -72,7 +72,7 @@ public function isDisplayOrderCount() * * @return void */ - public function setDisplayOrderCount($display_order_count = false) + public function setDisplayOrderCount($display_order_count = false): void { $this->display_order_count = $display_order_count; } diff --git a/src/Eccube/Entity/Member.php b/src/Eccube/Entity/Member.php index 0a42b76c4b5..dc50ee26fdc 100644 --- a/src/Eccube/Entity/Member.php +++ b/src/Eccube/Entity/Member.php @@ -42,7 +42,7 @@ class Member extends AbstractEntity implements UserInterface, PasswordAuthentica * * @return void */ - public static function loadValidatorMetadata(ClassMetadata $metadata) + public static function loadValidatorMetadata(ClassMetadata $metadata): void { $metadata->addConstraint(new UniqueEntity([ 'fields' => 'login_id', @@ -71,7 +71,7 @@ public function getRoles(): array /** * @return string */ - public function getUsername() + public function getUsername(): string { return $this->login_id; } @@ -222,9 +222,9 @@ public function eraseCredentials(): void /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -236,7 +236,7 @@ public function getId() * * @return Member */ - public function setName($name = null) + public function setName($name = null): Member { $this->name = $name; @@ -248,7 +248,7 @@ public function setName($name = null) * * @return string|null */ - public function getName() + public function getName(): ?string { return $this->name; } @@ -260,7 +260,7 @@ public function getName() * * @return Member */ - public function setDepartment($department = null) + public function setDepartment($department = null): Member { $this->department = $department; @@ -272,7 +272,7 @@ public function setDepartment($department = null) * * @return string|null */ - public function getDepartment() + public function getDepartment(): ?string { return $this->department; } @@ -284,7 +284,7 @@ public function getDepartment() * * @return Member */ - public function setLoginId($loginId) + public function setLoginId($loginId): Member { $this->login_id = $loginId; @@ -296,7 +296,7 @@ public function setLoginId($loginId) * * @return string */ - public function getLoginId() + public function getLoginId(): string { return $this->login_id; } @@ -314,7 +314,7 @@ public function getPlainPassword(): ?string * * @return $this */ - public function setPlainPassword(?string $password): self + public function setPlainPassword(?string $password): static { $this->plainPassword = $password; @@ -328,7 +328,7 @@ public function setPlainPassword(?string $password): self * * @return Member */ - public function setPassword($password) + public function setPassword($password): Member { $this->password = $password; @@ -341,7 +341,7 @@ public function setPassword($password) * @return string */ #[\Override] - public function getPassword(): ?string + public function getPassword(): string { return $this->password; } @@ -353,7 +353,7 @@ public function getPassword(): ?string * * @return Member */ - public function setSalt($salt) + public function setSalt($salt): Member { $this->salt = $salt; @@ -363,7 +363,7 @@ public function setSalt($salt) /** * Get salt. * - * @return string + * @return string|null */ #[\Override] public function getSalt(): ?string @@ -378,7 +378,7 @@ public function getSalt(): ?string * * @return Member */ - public function setSortNo($sortNo) + public function setSortNo($sortNo): Member { $this->sort_no = $sortNo; @@ -390,7 +390,7 @@ public function setSortNo($sortNo) * * @return int */ - public function getSortNo() + public function getSortNo(): int { return $this->sort_no; } @@ -402,7 +402,7 @@ public function getSortNo() * * @return Member */ - public function setTwoFactorAuthKey($two_factor_auth_key) + public function setTwoFactorAuthKey($two_factor_auth_key): Member { $this->two_factor_auth_key = $two_factor_auth_key; @@ -414,7 +414,7 @@ public function setTwoFactorAuthKey($two_factor_auth_key) * * @return string */ - public function getTwoFactorAuthKey() + public function getTwoFactorAuthKey(): string { return $this->two_factor_auth_key; } @@ -426,7 +426,7 @@ public function getTwoFactorAuthKey() * * @return Member */ - public function setTwoFactorAuthEnabled($two_factor_auth_enabled) + public function setTwoFactorAuthEnabled($two_factor_auth_enabled): Member { $this->two_factor_auth_enabled = $two_factor_auth_enabled; @@ -438,7 +438,7 @@ public function setTwoFactorAuthEnabled($two_factor_auth_enabled) * * @return bool */ - public function isTwoFactorAuthEnabled() + public function isTwoFactorAuthEnabled(): bool { return $this->two_factor_auth_enabled; } @@ -450,7 +450,7 @@ public function isTwoFactorAuthEnabled() * * @return Member */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Member { $this->create_date = $createDate; @@ -460,9 +460,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -474,7 +474,7 @@ public function getCreateDate() * * @return Member */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Member { $this->update_date = $updateDate; @@ -484,9 +484,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -498,7 +498,7 @@ public function getUpdateDate() * * @return Member */ - public function setLoginDate($loginDate = null) + public function setLoginDate($loginDate = null): Member { $this->login_date = $loginDate; @@ -510,7 +510,7 @@ public function setLoginDate($loginDate = null) * * @return \DateTime|null */ - public function getLoginDate() + public function getLoginDate(): ?\DateTime { return $this->login_date; } @@ -522,7 +522,7 @@ public function getLoginDate() * * @return Member */ - public function setWork(?Master\Work $work = null) + public function setWork(?Master\Work $work = null): Member { $this->Work = $work; @@ -534,7 +534,7 @@ public function setWork(?Master\Work $work = null) * * @return Master\Work|null */ - public function getWork() + public function getWork(): ?Master\Work { return $this->Work; } @@ -546,7 +546,7 @@ public function getWork() * * @return Member */ - public function setAuthority(?Master\Authority $authority = null) + public function setAuthority(?Master\Authority $authority = null): Member { $this->Authority = $authority; @@ -558,7 +558,7 @@ public function setAuthority(?Master\Authority $authority = null) * * @return Master\Authority|null */ - public function getAuthority() + public function getAuthority(): ?Master\Authority { return $this->Authority; } @@ -570,7 +570,7 @@ public function getAuthority() * * @return Member */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): Member { $this->Creator = $creator; @@ -582,7 +582,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } @@ -597,7 +597,7 @@ public function getCreator() * @since 5.1.0 */ #[\Override] - public function serialize() + public function serialize(): string { // see https://symfony.com/doc/2.7/security/entity_provider.html#create-your-user-entity // MemberRepository::loadUserByIdentifier() で Work をチェックしているため、ここでは不要 @@ -623,7 +623,7 @@ public function serialize() * @since 5.1.0 */ #[\Override] - public function unserialize($serialized) + public function unserialize($serialized): void { [$this->id, $this->login_id, $this->password, $this->salt] = unserialize($serialized); } diff --git a/src/Eccube/Entity/NameTrait.php b/src/Eccube/Entity/NameTrait.php index 9edf2970f25..68d00a189ca 100644 --- a/src/Eccube/Entity/NameTrait.php +++ b/src/Eccube/Entity/NameTrait.php @@ -18,7 +18,7 @@ trait NameTrait /** * @return string */ - public function getFullName() + public function getFullName(): string { return $this->name01.' '.$this->name02; } @@ -26,7 +26,7 @@ public function getFullName() /** * @return string */ - public function getFullNameKana() + public function getFullNameKana(): string { return $this->kana01.' '.$this->kana02; } diff --git a/src/Eccube/Entity/News.php b/src/Eccube/Entity/News.php index a8014a71bce..2708449ddd5 100644 --- a/src/Eccube/Entity/News.php +++ b/src/Eccube/Entity/News.php @@ -39,7 +39,7 @@ class News extends AbstractEntity implements \Stringable #[\Override] public function __toString(): string { - return (string) $this->getTitle(); + return $this->getTitle(); } /** @@ -126,9 +126,9 @@ public function __toString(): string /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -140,7 +140,7 @@ public function getId() * * @return News */ - public function setPublishDate($publishDate = null) + public function setPublishDate($publishDate = null): News { $this->publish_date = $publishDate; @@ -152,7 +152,7 @@ public function setPublishDate($publishDate = null) * * @return \DateTime|null */ - public function getPublishDate() + public function getPublishDate(): ?\DateTime { return $this->publish_date; } @@ -164,7 +164,7 @@ public function getPublishDate() * * @return News */ - public function setTitle($title) + public function setTitle($title): News { $this->title = $title; @@ -176,7 +176,7 @@ public function setTitle($title) * * @return string */ - public function getTitle() + public function getTitle(): string { return $this->title; } @@ -188,7 +188,7 @@ public function getTitle() * * @return News */ - public function setDescription($description = null) + public function setDescription($description = null): News { $this->description = $description; @@ -200,7 +200,7 @@ public function setDescription($description = null) * * @return string|null */ - public function getDescription() + public function getDescription(): ?string { return $this->description; } @@ -212,7 +212,7 @@ public function getDescription() * * @return News */ - public function setUrl($url = null) + public function setUrl($url = null): News { $this->url = $url; @@ -224,7 +224,7 @@ public function setUrl($url = null) * * @return string|null */ - public function getUrl() + public function getUrl(): ?string { return $this->url; } @@ -236,7 +236,7 @@ public function getUrl() * * @return News */ - public function setLinkMethod($linkMethod) + public function setLinkMethod($linkMethod): News { $this->link_method = $linkMethod; @@ -248,7 +248,7 @@ public function setLinkMethod($linkMethod) * * @return bool */ - public function isLinkMethod() + public function isLinkMethod(): bool { return $this->link_method; } @@ -260,7 +260,7 @@ public function isLinkMethod() * * @return News */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): News { $this->create_date = $createDate; @@ -270,9 +270,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -284,7 +284,7 @@ public function getCreateDate() * * @return News */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): News { $this->update_date = $updateDate; @@ -294,9 +294,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -304,7 +304,7 @@ public function getUpdateDate() /** * @return bool */ - public function isVisible() + public function isVisible(): bool { return $this->visible; } @@ -314,7 +314,7 @@ public function isVisible() * * @return News */ - public function setVisible($visible) + public function setVisible($visible): News { $this->visible = $visible; @@ -328,7 +328,7 @@ public function setVisible($visible) * * @return News */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): News { $this->Creator = $creator; @@ -340,7 +340,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } diff --git a/src/Eccube/Entity/Order.php b/src/Eccube/Entity/Order.php index 362857df502..da51bb68456 100644 --- a/src/Eccube/Entity/Order.php +++ b/src/Eccube/Entity/Order.php @@ -58,7 +58,7 @@ class Order extends AbstractEntity implements PurchaseInterface, ItemHolderInter * * @return OrderItem[] */ - public function getTaxableItems() + public function getTaxableItems(): array { $Items = []; @@ -81,7 +81,7 @@ public function getTaxableItems() * * @return string */ - public function getTaxableTotal() + public function getTaxableTotal(): string { $total = '0'; @@ -97,7 +97,7 @@ public function getTaxableTotal() * * @return array [税率 => 合計金額] */ - public function getTaxableTotalByTaxRate() + public function getTaxableTotalByTaxRate(): array { $total = []; @@ -121,7 +121,7 @@ public function getTaxableTotalByTaxRate() * * @return array */ - public function getTotalByTaxRate() + public function getTotalByTaxRate(): array { $roundingTypes = $this->getRoundingTypeByTaxRate(); $total = []; @@ -156,7 +156,7 @@ public function getTotalByTaxRate() * * @return array */ - public function getTaxByTaxRate() + public function getTaxByTaxRate(): array { $roundingTypes = $this->getRoundingTypeByTaxRate(); $tax = []; @@ -204,7 +204,7 @@ public function getTaxByTaxRate() * * @return array */ - public function getTaxableDiscountItems() + public function getTaxableDiscountItems(): array { /** @var OrderItem[] $items */ $items = (new ItemCollection($this->getTaxableItems()))->sort()->toArray(); @@ -219,7 +219,7 @@ public function getTaxableDiscountItems() * * @return string */ - public function getTaxableDiscount() + public function getTaxableDiscount(): string { return array_reduce($this->getTaxableDiscountItems(), function ($sum, OrderItem $Item) { return bcadd($sum, $Item->getTotalPrice(), 2); @@ -231,7 +231,7 @@ public function getTaxableDiscount() * * @return array */ - public function getTaxFreeDiscountItems() + public function getTaxFreeDiscountItems(): array { /** @var OrderItem[] $items */ $items = (new ItemCollection($this->getOrderItems()))->sort()->toArray(); @@ -246,7 +246,7 @@ public function getTaxFreeDiscountItems() * * @return string */ - public function getTaxFreeDiscount() + public function getTaxFreeDiscount(): string { return array_reduce($this->getTaxFreeDiscountItems(), function ($sum, OrderItem $Item) { return bcadd($sum, $Item->getTotalPrice(), 2); @@ -258,7 +258,7 @@ public function getTaxFreeDiscount() * * @return array */ - public function getRoundingTypeByTaxRate() + public function getRoundingTypeByTaxRate(): array { $roundingTypes = []; foreach ($this->getTaxableItems() as $Item) { @@ -273,7 +273,7 @@ public function getRoundingTypeByTaxRate() * * @return bool */ - public function isMultiple() + public function isMultiple(): bool { $Shippings = []; // クエリビルダ使用時に絞り込まれる場合があるため, @@ -298,7 +298,7 @@ public function isMultiple() * * @return Shipping|null */ - public function findShipping($shippingId) + public function findShipping($shippingId): ?Shipping { foreach ($this->getShippings() as $Shipping) { if ($Shipping->getId() == $shippingId) { @@ -314,7 +314,7 @@ public function findShipping($shippingId) * * @return Master\SaleType[] 一意な販売種別の配列 */ - public function getSaleTypes() + public function getSaleTypes(): array { $saleTypes = []; foreach ($this->getOrderItems() as $OrderItem) { @@ -332,7 +332,7 @@ public function getSaleTypes() * * @return OrderItem[] */ - public function getMergedProductOrderItems() + public function getMergedProductOrderItems(): array { $ProductOrderItems = $this->getProductOrderItems(); $orderItemArray = []; @@ -363,7 +363,7 @@ public function getMergedProductOrderItems() * * @deprecated */ - public function getTotalPrice() + public function getTotalPrice(): string { @trigger_error('The '.__METHOD__.' method is deprecated.', E_USER_DEPRECATED); @@ -808,7 +808,7 @@ public function __clone() * * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -820,7 +820,7 @@ public function getId() * * @return Order */ - public function setPreOrderId($preOrderId = null) + public function setPreOrderId($preOrderId = null): Order { $this->pre_order_id = $preOrderId; @@ -832,7 +832,7 @@ public function setPreOrderId($preOrderId = null) * * @return string|null */ - public function getPreOrderId() + public function getPreOrderId(): ?string { return $this->pre_order_id; } @@ -844,7 +844,7 @@ public function getPreOrderId() * * @return Order */ - public function setOrderNo($orderNo = null) + public function setOrderNo($orderNo = null): Order { $this->order_no = $orderNo; @@ -856,7 +856,7 @@ public function setOrderNo($orderNo = null) * * @return string|null */ - public function getOrderNo() + public function getOrderNo(): ?string { return $this->order_no; } @@ -868,7 +868,7 @@ public function getOrderNo() * * @return Order */ - public function setMessage($message = null) + public function setMessage($message = null): Order { $this->message = $message; @@ -880,7 +880,7 @@ public function setMessage($message = null) * * @return string|null */ - public function getMessage() + public function getMessage(): ?string { return $this->message; } @@ -892,7 +892,7 @@ public function getMessage() * * @return Order */ - public function setName01($name01 = null) + public function setName01($name01 = null): Order { $this->name01 = $name01; @@ -904,7 +904,7 @@ public function setName01($name01 = null) * * @return string|null */ - public function getName01() + public function getName01(): ?string { return $this->name01; } @@ -916,7 +916,7 @@ public function getName01() * * @return Order */ - public function setName02($name02 = null) + public function setName02($name02 = null): Order { $this->name02 = $name02; @@ -928,7 +928,7 @@ public function setName02($name02 = null) * * @return string|null */ - public function getName02() + public function getName02(): ?string { return $this->name02; } @@ -940,7 +940,7 @@ public function getName02() * * @return Order */ - public function setKana01($kana01 = null) + public function setKana01($kana01 = null): Order { $this->kana01 = $kana01; @@ -952,7 +952,7 @@ public function setKana01($kana01 = null) * * @return string|null */ - public function getKana01() + public function getKana01(): ?string { return $this->kana01; } @@ -964,7 +964,7 @@ public function getKana01() * * @return Order */ - public function setKana02($kana02 = null) + public function setKana02($kana02 = null): Order { $this->kana02 = $kana02; @@ -976,7 +976,7 @@ public function setKana02($kana02 = null) * * @return string|null */ - public function getKana02() + public function getKana02(): ?string { return $this->kana02; } @@ -988,7 +988,7 @@ public function getKana02() * * @return Order */ - public function setCompanyName($companyName = null) + public function setCompanyName($companyName = null): Order { $this->company_name = $companyName; @@ -1000,7 +1000,7 @@ public function setCompanyName($companyName = null) * * @return string|null */ - public function getCompanyName() + public function getCompanyName(): ?string { return $this->company_name; } @@ -1012,7 +1012,7 @@ public function getCompanyName() * * @return Order */ - public function setEmail($email = null) + public function setEmail($email = null): Order { $this->email = $email; @@ -1024,7 +1024,7 @@ public function setEmail($email = null) * * @return string|null */ - public function getEmail() + public function getEmail(): ?string { return $this->email; } @@ -1036,7 +1036,7 @@ public function getEmail() * * @return Order */ - public function setPhoneNumber($phone_number = null) + public function setPhoneNumber($phone_number = null): Order { $this->phone_number = $phone_number; @@ -1048,7 +1048,7 @@ public function setPhoneNumber($phone_number = null) * * @return string|null */ - public function getPhoneNumber() + public function getPhoneNumber(): ?string { return $this->phone_number; } @@ -1060,7 +1060,7 @@ public function getPhoneNumber() * * @return Order */ - public function setPostalCode($postal_code = null) + public function setPostalCode($postal_code = null): Order { $this->postal_code = $postal_code; @@ -1072,7 +1072,7 @@ public function setPostalCode($postal_code = null) * * @return string|null */ - public function getPostalCode() + public function getPostalCode(): ?string { return $this->postal_code; } @@ -1084,7 +1084,7 @@ public function getPostalCode() * * @return Order */ - public function setAddr01($addr01 = null) + public function setAddr01($addr01 = null): Order { $this->addr01 = $addr01; @@ -1096,7 +1096,7 @@ public function setAddr01($addr01 = null) * * @return string|null */ - public function getAddr01() + public function getAddr01(): ?string { return $this->addr01; } @@ -1108,7 +1108,7 @@ public function getAddr01() * * @return Order */ - public function setAddr02($addr02 = null) + public function setAddr02($addr02 = null): Order { $this->addr02 = $addr02; @@ -1120,7 +1120,7 @@ public function setAddr02($addr02 = null) * * @return string|null */ - public function getAddr02() + public function getAddr02(): ?string { return $this->addr02; } @@ -1132,7 +1132,7 @@ public function getAddr02() * * @return Order */ - public function setBirth($birth = null) + public function setBirth($birth = null): Order { $this->birth = $birth; @@ -1144,7 +1144,7 @@ public function setBirth($birth = null) * * @return \DateTime|null */ - public function getBirth() + public function getBirth(): ?\DateTime { return $this->birth; } @@ -1156,7 +1156,7 @@ public function getBirth() * * @return Order */ - public function setSubtotal($subtotal) + public function setSubtotal($subtotal): Order { $this->subtotal = $subtotal; @@ -1168,7 +1168,7 @@ public function setSubtotal($subtotal) * * @return string */ - public function getSubtotal() + public function getSubtotal(): string { return $this->subtotal; } @@ -1178,10 +1178,10 @@ public function getSubtotal() * * @param string $discount * - * @return Order + * @return static */ #[\Override] - public function setDiscount($discount) + public function setDiscount($discount): static { $this->discount = $discount; @@ -1195,7 +1195,7 @@ public function setDiscount($discount) * * @deprecated 4.0.3 から値引きは課税値引きと 非課税・不課税の値引きの2種に分かれる. 課税値引きについてはgetTaxableDiscountを利用してください. */ - public function getDiscount() + public function getDiscount(): string { return $this->discount; } @@ -1205,10 +1205,10 @@ public function getDiscount() * * @param string $deliveryFeeTotal * - * @return Order + * @return $this */ #[\Override] - public function setDeliveryFeeTotal($deliveryFeeTotal) + public function setDeliveryFeeTotal($deliveryFeeTotal): static { $this->delivery_fee_total = $deliveryFeeTotal; @@ -1221,7 +1221,7 @@ public function setDeliveryFeeTotal($deliveryFeeTotal) * @return string */ #[\Override] - public function getDeliveryFeeTotal() + public function getDeliveryFeeTotal(): string { return $this->delivery_fee_total; } @@ -1231,10 +1231,10 @@ public function getDeliveryFeeTotal() * * @param string $charge * - * @return Order + * @return $this */ #[\Override] - public function setCharge($charge) + public function setCharge($charge): static { $this->charge = $charge; @@ -1246,7 +1246,7 @@ public function setCharge($charge) * * @return string */ - public function getCharge() + public function getCharge(): string { return $this->charge; } @@ -1256,12 +1256,12 @@ public function getCharge() * * @param string $tax * - * @return Order + * @return $this * * @deprecated 明細ごとに集計した税額と差異が発生する場合があるため非推奨 */ #[\Override] - public function setTax($tax) + public function setTax($tax): static { $this->tax = $tax; @@ -1275,7 +1275,7 @@ public function setTax($tax) * * @deprecated 明細ごとに集計した税額と差異が発生する場合があるため非推奨 */ - public function getTax() + public function getTax(): string { return $this->tax; } @@ -1285,10 +1285,10 @@ public function getTax() * * @param string $total * - * @return Order + * @return static */ #[\Override] - public function setTotal($total) + public function setTotal($total): static { $this->total = $total; @@ -1301,7 +1301,7 @@ public function setTotal($total) * @return string */ #[\Override] - public function getTotal() + public function getTotal(): string { return $this->total; } @@ -1313,7 +1313,7 @@ public function getTotal() * * @return Order */ - public function setPaymentTotal($paymentTotal) + public function setPaymentTotal($paymentTotal): Order { $this->payment_total = $paymentTotal; @@ -1325,7 +1325,7 @@ public function setPaymentTotal($paymentTotal) * * @return string */ - public function getPaymentTotal() + public function getPaymentTotal(): string { return $this->payment_total; } @@ -1337,7 +1337,7 @@ public function getPaymentTotal() * * @return Order */ - public function setPaymentMethod($paymentMethod = null) + public function setPaymentMethod($paymentMethod = null): Order { $this->payment_method = $paymentMethod; @@ -1349,7 +1349,7 @@ public function setPaymentMethod($paymentMethod = null) * * @return string|null */ - public function getPaymentMethod() + public function getPaymentMethod(): ?string { return $this->payment_method; } @@ -1361,7 +1361,7 @@ public function getPaymentMethod() * * @return Order */ - public function setNote($note = null) + public function setNote($note = null): Order { $this->note = $note; @@ -1373,7 +1373,7 @@ public function setNote($note = null) * * @return string|null */ - public function getNote() + public function getNote(): ?string { return $this->note; } @@ -1385,7 +1385,7 @@ public function getNote() * * @return Order */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Order { $this->create_date = $createDate; @@ -1395,9 +1395,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -1409,7 +1409,7 @@ public function getCreateDate() * * @return Order */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Order { $this->update_date = $updateDate; @@ -1419,9 +1419,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -1433,7 +1433,7 @@ public function getUpdateDate() * * @return Order */ - public function setOrderDate($orderDate = null) + public function setOrderDate($orderDate = null): Order { $this->order_date = $orderDate; @@ -1445,7 +1445,7 @@ public function setOrderDate($orderDate = null) * * @return \DateTime|null */ - public function getOrderDate() + public function getOrderDate(): ?\DateTime { return $this->order_date; } @@ -1457,7 +1457,7 @@ public function getOrderDate() * * @return Order */ - public function setPaymentDate($paymentDate = null) + public function setPaymentDate($paymentDate = null): Order { $this->payment_date = $paymentDate; @@ -1469,7 +1469,7 @@ public function setPaymentDate($paymentDate = null) * * @return \DateTime|null */ - public function getPaymentDate() + public function getPaymentDate(): ?\DateTime { return $this->payment_date; } @@ -1479,7 +1479,7 @@ public function getPaymentDate() * * @return string */ - public function getCurrencyCode() + public function getCurrencyCode(): string { return $this->currency_code; } @@ -1491,7 +1491,7 @@ public function getCurrencyCode() * * @return $this */ - public function setCurrencyCode($currencyCode = null) + public function setCurrencyCode($currencyCode = null): static { $this->currency_code = $currencyCode; @@ -1501,7 +1501,7 @@ public function setCurrencyCode($currencyCode = null) /** * @return string|null */ - public function getCompleteMessage() + public function getCompleteMessage(): ?string { return $this->complete_message; } @@ -1511,7 +1511,7 @@ public function getCompleteMessage() * * @return $this */ - public function setCompleteMessage($complete_message = null) + public function setCompleteMessage($complete_message = null): static { $this->complete_message = $complete_message; @@ -1523,7 +1523,7 @@ public function setCompleteMessage($complete_message = null) * * @return $this */ - public function appendCompleteMessage($complete_message = null) + public function appendCompleteMessage($complete_message = null): static { $this->complete_message .= $complete_message; @@ -1533,7 +1533,7 @@ public function appendCompleteMessage($complete_message = null) /** * @return string|null */ - public function getCompleteMailMessage() + public function getCompleteMailMessage(): ?string { return $this->complete_mail_message; } @@ -1543,7 +1543,7 @@ public function getCompleteMailMessage() * * @return self */ - public function setCompleteMailMessage($complete_mail_message = null) + public function setCompleteMailMessage($complete_mail_message = null): Order { $this->complete_mail_message = $complete_mail_message; @@ -1555,7 +1555,7 @@ public function setCompleteMailMessage($complete_mail_message = null) * * @return self */ - public function appendCompleteMailMessage($complete_mail_message = null) + public function appendCompleteMailMessage($complete_mail_message = null): Order { $this->complete_mail_message .= $complete_mail_message; @@ -1567,7 +1567,7 @@ public function appendCompleteMailMessage($complete_mail_message = null) * * @return OrderItem[] */ - public function getProductOrderItems() + public function getProductOrderItems(): array { $sio = new OrderItemCollection($this->OrderItems->toArray()); @@ -1581,7 +1581,7 @@ public function getProductOrderItems() * * @return Order */ - public function addOrderItem(OrderItem $OrderItem) + public function addOrderItem(OrderItem $OrderItem): Order { $this->OrderItems[] = $OrderItem; @@ -1595,7 +1595,7 @@ public function addOrderItem(OrderItem $OrderItem) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeOrderItem(OrderItem $OrderItem) + public function removeOrderItem(OrderItem $OrderItem): bool { return $this->OrderItems->removeElement($OrderItem); } @@ -1605,7 +1605,7 @@ public function removeOrderItem(OrderItem $OrderItem) * * @return \Doctrine\Common\Collections\Collection */ - public function getOrderItems() + public function getOrderItems(): \Doctrine\Common\Collections\Collection { return $this->OrderItems; } @@ -1616,7 +1616,7 @@ public function getOrderItems() * @return ItemCollection */ #[\Override] - public function getItems() + public function getItems(): ItemCollection { return (new ItemCollection($this->getOrderItems()))->sort(); } @@ -1628,7 +1628,7 @@ public function getItems() * * @return Order */ - public function addShipping(Shipping $Shipping) + public function addShipping(Shipping $Shipping): Order { $this->Shippings[] = $Shipping; @@ -1642,7 +1642,7 @@ public function addShipping(Shipping $Shipping) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeShipping(Shipping $Shipping) + public function removeShipping(Shipping $Shipping): bool { return $this->Shippings->removeElement($Shipping); } @@ -1652,7 +1652,7 @@ public function removeShipping(Shipping $Shipping) * * @return \Doctrine\Common\Collections\Collection */ - public function getShippings() + public function getShippings(): \Doctrine\Common\Collections\Collection { $criteria = Criteria::create() ->orderBy(['name01' => Criteria::ASC, 'name02' => Criteria::ASC, 'id' => Criteria::ASC]); @@ -1670,7 +1670,7 @@ public function getShippings() * * @return Order */ - public function addMailHistory(MailHistory $mailHistory) + public function addMailHistory(MailHistory $mailHistory): Order { $this->MailHistories[] = $mailHistory; @@ -1684,7 +1684,7 @@ public function addMailHistory(MailHistory $mailHistory) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeMailHistory(MailHistory $mailHistory) + public function removeMailHistory(MailHistory $mailHistory): bool { return $this->MailHistories->removeElement($mailHistory); } @@ -1694,7 +1694,7 @@ public function removeMailHistory(MailHistory $mailHistory) * * @return \Doctrine\Common\Collections\Collection */ - public function getMailHistories() + public function getMailHistories(): \Doctrine\Common\Collections\Collection { return $this->MailHistories; } @@ -1706,7 +1706,7 @@ public function getMailHistories() * * @return Order */ - public function setCustomer(?Customer $customer = null) + public function setCustomer(?Customer $customer = null): Order { $this->Customer = $customer; @@ -1730,7 +1730,7 @@ public function getCustomer(): ?Customer * * @return Order */ - public function setCountry(?Master\Country $country = null) + public function setCountry(?Master\Country $country = null): Order { $this->Country = $country; @@ -1742,7 +1742,7 @@ public function setCountry(?Master\Country $country = null) * * @return Master\Country|null */ - public function getCountry() + public function getCountry(): ?Master\Country { return $this->Country; } @@ -1754,7 +1754,7 @@ public function getCountry() * * @return Order */ - public function setPref(?Master\Pref $pref = null) + public function setPref(?Master\Pref $pref = null): Order { $this->Pref = $pref; @@ -1766,7 +1766,7 @@ public function setPref(?Master\Pref $pref = null) * * @return Master\Pref|null */ - public function getPref() + public function getPref(): ?Master\Pref { return $this->Pref; } @@ -1778,7 +1778,7 @@ public function getPref() * * @return Order */ - public function setSex(?Master\Sex $sex = null) + public function setSex(?Master\Sex $sex = null): Order { $this->Sex = $sex; @@ -1790,7 +1790,7 @@ public function setSex(?Master\Sex $sex = null) * * @return Master\Sex|null */ - public function getSex() + public function getSex(): ?Master\Sex { return $this->Sex; } @@ -1802,7 +1802,7 @@ public function getSex() * * @return Order */ - public function setJob(?Master\Job $job = null) + public function setJob(?Master\Job $job = null): Order { $this->Job = $job; @@ -1814,7 +1814,7 @@ public function setJob(?Master\Job $job = null) * * @return Master\Job|null */ - public function getJob() + public function getJob(): ?Master\Job { return $this->Job; } @@ -1826,7 +1826,7 @@ public function getJob() * * @return Order */ - public function setPayment(?Payment $payment = null) + public function setPayment(?Payment $payment = null): Order { $this->Payment = $payment; @@ -1838,7 +1838,7 @@ public function setPayment(?Payment $payment = null) * * @return Payment|null */ - public function getPayment() + public function getPayment(): ?Payment { return $this->Payment; } @@ -1850,7 +1850,7 @@ public function getPayment() * * @return Order */ - public function setDeviceType(?Master\DeviceType $deviceType = null) + public function setDeviceType(?Master\DeviceType $deviceType = null): Order { $this->DeviceType = $deviceType; @@ -1862,7 +1862,7 @@ public function setDeviceType(?Master\DeviceType $deviceType = null) * * @return Master\DeviceType|null */ - public function getDeviceType() + public function getDeviceType(): ?Master\DeviceType { return $this->DeviceType; } @@ -1874,7 +1874,7 @@ public function getDeviceType() * * @return Order */ - public function setCustomerOrderStatus(?Master\CustomerOrderStatus $customerOrderStatus = null) + public function setCustomerOrderStatus(?Master\CustomerOrderStatus $customerOrderStatus = null): Order { $this->CustomerOrderStatus = $customerOrderStatus; @@ -1886,7 +1886,7 @@ public function setCustomerOrderStatus(?Master\CustomerOrderStatus $customerOrde * * @return Master\CustomerOrderStatus|null */ - public function getCustomerOrderStatus() + public function getCustomerOrderStatus(): ?Master\CustomerOrderStatus { return $this->CustomerOrderStatus; } @@ -1898,7 +1898,7 @@ public function getCustomerOrderStatus() * * @return Order */ - public function setOrderStatusColor(?Master\OrderStatusColor $orderStatusColor = null) + public function setOrderStatusColor(?Master\OrderStatusColor $orderStatusColor = null): Order { $this->OrderStatusColor = $orderStatusColor; @@ -1910,7 +1910,7 @@ public function setOrderStatusColor(?Master\OrderStatusColor $orderStatusColor = * * @return Master\OrderStatusColor|null */ - public function getOrderStatusColor() + public function getOrderStatusColor(): ?Master\OrderStatusColor { return $this->OrderStatusColor; } @@ -1922,7 +1922,7 @@ public function getOrderStatusColor() * * @return self */ - public function setOrderStatus(?Master\OrderStatus $orderStatus = null) + public function setOrderStatus(?Master\OrderStatus $orderStatus = null): Order { $this->OrderStatus = $orderStatus; @@ -1934,7 +1934,7 @@ public function setOrderStatus(?Master\OrderStatus $orderStatus = null) * * @return Master\OrderStatus|null */ - public function getOrderStatus() + public function getOrderStatus(): ?Master\OrderStatus { return $this->OrderStatus; } @@ -1945,7 +1945,7 @@ public function getOrderStatus() * @return void */ #[\Override] - public function addItem(ItemInterface $item) + public function addItem(ItemInterface $item): void { if ($item instanceof OrderItem) { $this->OrderItems->add($item); @@ -1953,11 +1953,11 @@ public function addItem(ItemInterface $item) } #[\Override] - public function getQuantity() + public function getQuantity(): string { $quantity = '0'; foreach ($this->getItems() as $item) { - $quantity = bcadd($quantity, (string) $item->getQuantity()); + $quantity = bcadd($quantity, $item->getQuantity()); } return $quantity; diff --git a/src/Eccube/Entity/OrderItem.php b/src/Eccube/Entity/OrderItem.php index 739467cb2b5..c0c30648829 100644 --- a/src/Eccube/Entity/OrderItem.php +++ b/src/Eccube/Entity/OrderItem.php @@ -41,7 +41,7 @@ class OrderItem extends AbstractEntity implements ItemInterface * * @return string */ - public function getPriceIncTax() + public function getPriceIncTax(): string { // 税表示区分が税込の場合は, priceに税込金額が入っている. if ($this->TaxDisplayType && $this->TaxDisplayType->getId() == TaxDisplayType::INCLUDED) { @@ -54,7 +54,7 @@ public function getPriceIncTax() /** * @return string */ - public function getTotalPrice() + public function getTotalPrice(): string { return bcmul($this->getPriceIncTax(), $this->getQuantity(), 2); } @@ -62,7 +62,7 @@ public function getTotalPrice() /** * @return int|null */ - public function getOrderItemTypeId() + public function getOrderItemTypeId(): ?int { if (is_object($this->getOrderItemType())) { return $this->getOrderItemType()->getId(); @@ -77,7 +77,7 @@ public function getOrderItemTypeId() * @return bool 商品明細の場合 true */ #[\Override] - public function isProduct() + public function isProduct(): bool { return $this->getOrderItemTypeId() === OrderItemType::PRODUCT; } @@ -88,7 +88,7 @@ public function isProduct() * @return bool 送料明細の場合 true */ #[\Override] - public function isDeliveryFee() + public function isDeliveryFee(): bool { return $this->getOrderItemTypeId() === OrderItemType::DELIVERY_FEE; } @@ -99,7 +99,7 @@ public function isDeliveryFee() * @return bool 手数料明細の場合 true */ #[\Override] - public function isCharge() + public function isCharge(): bool { return $this->getOrderItemTypeId() === OrderItemType::CHARGE; } @@ -110,7 +110,7 @@ public function isCharge() * @return bool 値引き明細の場合 true */ #[\Override] - public function isDiscount() + public function isDiscount(): bool { return $this->getOrderItemTypeId() === OrderItemType::DISCOUNT; } @@ -121,7 +121,7 @@ public function isDiscount() * @return bool 税額明細の場合 true */ #[\Override] - public function isTax() + public function isTax(): bool { return $this->getOrderItemTypeId() === OrderItemType::TAX; } @@ -132,13 +132,13 @@ public function isTax() * @return bool ポイント明細の場合 true */ #[\Override] - public function isPoint() + public function isPoint(): bool { return $this->getOrderItemTypeId() === OrderItemType::POINT; } /** - * @var int + * @var int|null * * @ORM\Column(name="id", type="integer", options={"unsigned":true}) * @@ -347,9 +347,9 @@ public function isPoint() /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -361,7 +361,7 @@ public function getId() * * @return OrderItem */ - public function setProductName($productName) + public function setProductName($productName): OrderItem { $this->product_name = $productName; @@ -373,7 +373,7 @@ public function setProductName($productName) * * @return string */ - public function getProductName() + public function getProductName(): string { return $this->product_name; } @@ -385,7 +385,7 @@ public function getProductName() * * @return OrderItem */ - public function setProductCode($productCode = null) + public function setProductCode($productCode = null): OrderItem { $this->product_code = $productCode; @@ -397,7 +397,7 @@ public function setProductCode($productCode = null) * * @return string|null */ - public function getProductCode() + public function getProductCode(): ?string { return $this->product_code; } @@ -409,7 +409,7 @@ public function getProductCode() * * @return OrderItem */ - public function setClassName1($className1 = null) + public function setClassName1($className1 = null): OrderItem { $this->class_name1 = $className1; @@ -421,7 +421,7 @@ public function setClassName1($className1 = null) * * @return string|null */ - public function getClassName1() + public function getClassName1(): ?string { return $this->class_name1; } @@ -433,7 +433,7 @@ public function getClassName1() * * @return OrderItem */ - public function setClassName2($className2 = null) + public function setClassName2($className2 = null): OrderItem { $this->class_name2 = $className2; @@ -445,7 +445,7 @@ public function setClassName2($className2 = null) * * @return string|null */ - public function getClassName2() + public function getClassName2(): ?string { return $this->class_name2; } @@ -457,7 +457,7 @@ public function getClassName2() * * @return OrderItem */ - public function setClassCategoryName1($classCategoryName1 = null) + public function setClassCategoryName1($classCategoryName1 = null): OrderItem { $this->class_category_name1 = $classCategoryName1; @@ -469,7 +469,7 @@ public function setClassCategoryName1($classCategoryName1 = null) * * @return string|null */ - public function getClassCategoryName1() + public function getClassCategoryName1(): ?string { return $this->class_category_name1; } @@ -481,7 +481,7 @@ public function getClassCategoryName1() * * @return OrderItem */ - public function setClassCategoryName2($classCategoryName2 = null) + public function setClassCategoryName2($classCategoryName2 = null): OrderItem { $this->class_category_name2 = $classCategoryName2; @@ -493,7 +493,7 @@ public function setClassCategoryName2($classCategoryName2 = null) * * @return string|null */ - public function getClassCategoryName2() + public function getClassCategoryName2(): ?string { return $this->class_category_name2; } @@ -503,9 +503,9 @@ public function getClassCategoryName2() * * @param string $price * - * @return OrderItem + * @return $this */ - public function setPrice($price) + public function setPrice($price): static { $this->price = $price; @@ -518,7 +518,7 @@ public function setPrice($price) * @return string|null */ #[\Override] - public function getPrice() + public function getPrice(): ?string { return $this->price; } @@ -526,12 +526,12 @@ public function getPrice() /** * Set quantity. * - * @param string|int $quantity + * @param string $quantity * - * @return OrderItem + * @return $this */ #[\Override] - public function setQuantity($quantity) + public function setQuantity($quantity): static { $this->quantity = $quantity; @@ -541,10 +541,10 @@ public function setQuantity($quantity) /** * Get quantity. * - * @return string|float|int + * @return string */ #[\Override] - public function getQuantity() + public function getQuantity(): string { return $this->quantity; } @@ -552,17 +552,17 @@ public function getQuantity() /** * @return string */ - public function getTax() + public function getTax(): string { return $this->tax; } /** - * @param string|float $tax + * @param string $tax * * @return $this */ - public function setTax($tax) + public function setTax($tax): static { $this->tax = $tax; @@ -572,11 +572,11 @@ public function setTax($tax) /** * Set taxRate. * - * @param string|int $taxRate + * @param string $taxRate * * @return OrderItem */ - public function setTaxRate($taxRate) + public function setTaxRate($taxRate): OrderItem { $this->tax_rate = $taxRate; @@ -588,7 +588,7 @@ public function setTaxRate($taxRate) * * @return string */ - public function getTaxRate() + public function getTaxRate(): string { return $this->tax_rate; } @@ -600,7 +600,7 @@ public function getTaxRate() * * @return OrderItem */ - public function setTaxAdjust($tax_adjust) + public function setTaxAdjust($tax_adjust): OrderItem { $this->tax_adjust = $tax_adjust; @@ -610,9 +610,9 @@ public function setTaxAdjust($tax_adjust) /** * Get taxAdjust. * - * @return string|float|int + * @return string */ - public function getTaxAdjust() + public function getTaxAdjust(): string { return $this->tax_adjust; } @@ -626,7 +626,7 @@ public function getTaxAdjust() * * @return OrderItem */ - public function setTaxRuleId($taxRuleId = null) + public function setTaxRuleId($taxRuleId = null): OrderItem { $this->tax_rule_id = $taxRuleId; @@ -640,7 +640,7 @@ public function setTaxRuleId($taxRuleId = null) * * @return int|null */ - public function getTaxRuleId() + public function getTaxRuleId(): ?int { return $this->tax_rule_id; } @@ -650,7 +650,7 @@ public function getTaxRuleId() * * @return string */ - public function getCurrencyCode() + public function getCurrencyCode(): string { return $this->currency_code; } @@ -662,7 +662,7 @@ public function getCurrencyCode() * * @return OrderItem */ - public function setCurrencyCode($currencyCode = null) + public function setCurrencyCode($currencyCode = null): OrderItem { $this->currency_code = $currencyCode; @@ -672,9 +672,9 @@ public function setCurrencyCode($currencyCode = null) /** * Get processorName. * - * @return string + * @return string|null */ - public function getProcessorName() + public function getProcessorName(): ?string { return $this->processor_name; } @@ -686,7 +686,7 @@ public function getProcessorName() * * @return $this */ - public function setProcessorName($processorName = null) + public function setProcessorName($processorName = null): static { $this->processor_name = $processorName; @@ -700,7 +700,7 @@ public function setProcessorName($processorName = null) * * @return OrderItem */ - public function setOrder(?Order $order = null) + public function setOrder(?Order $order = null): OrderItem { $this->Order = $order; @@ -712,7 +712,7 @@ public function setOrder(?Order $order = null) * * @return Order|null */ - public function getOrder() + public function getOrder(): ?Order { return $this->Order; } @@ -720,7 +720,7 @@ public function getOrder() /** * @return int|null */ - public function getOrderId() + public function getOrderId(): ?int { if (is_object($this->getOrder())) { return $this->getOrder()->getId(); @@ -736,7 +736,7 @@ public function getOrderId() * * @return OrderItem */ - public function setProduct(?Product $product = null) + public function setProduct(?Product $product = null): OrderItem { $this->Product = $product; @@ -748,7 +748,7 @@ public function setProduct(?Product $product = null) * * @return Product|null */ - public function getProduct() + public function getProduct(): ?Product { return $this->Product; } @@ -760,7 +760,7 @@ public function getProduct() * * @return OrderItem */ - public function setProductClass(?ProductClass $productClass = null) + public function setProductClass(?ProductClass $productClass = null): OrderItem { $this->ProductClass = $productClass; @@ -773,7 +773,7 @@ public function setProductClass(?ProductClass $productClass = null) * @return ProductClass|null */ #[\Override] - public function getProductClass() + public function getProductClass(): ?ProductClass { return $this->ProductClass; } @@ -785,7 +785,7 @@ public function getProductClass() * * @return OrderItem */ - public function setShipping(?Shipping $shipping = null) + public function setShipping(?Shipping $shipping = null): OrderItem { $this->Shipping = $shipping; @@ -797,7 +797,7 @@ public function setShipping(?Shipping $shipping = null) * * @return Shipping|null */ - public function getShipping() + public function getShipping(): ?Shipping { return $this->Shipping; } @@ -805,7 +805,7 @@ public function getShipping() /** * @return RoundingType|null */ - public function getRoundingType() + public function getRoundingType(): ?RoundingType { return $this->RoundingType; } @@ -815,7 +815,7 @@ public function getRoundingType() * * @return $this */ - public function setRoundingType(?RoundingType $RoundingType = null) + public function setRoundingType(?RoundingType $RoundingType = null): static { $this->RoundingType = $RoundingType; @@ -829,7 +829,7 @@ public function setRoundingType(?RoundingType $RoundingType = null) * * @return OrderItem */ - public function setTaxType(?Master\TaxType $taxType = null) + public function setTaxType(?Master\TaxType $taxType = null): OrderItem { $this->TaxType = $taxType; @@ -841,7 +841,7 @@ public function setTaxType(?Master\TaxType $taxType = null) * * @return Master\TaxType|null */ - public function getTaxType() + public function getTaxType(): ?Master\TaxType { return $this->TaxType; } @@ -853,7 +853,7 @@ public function getTaxType() * * @return OrderItem */ - public function setTaxDisplayType(?TaxDisplayType $taxDisplayType = null) + public function setTaxDisplayType(?TaxDisplayType $taxDisplayType = null): OrderItem { $this->TaxDisplayType = $taxDisplayType; @@ -865,7 +865,7 @@ public function setTaxDisplayType(?TaxDisplayType $taxDisplayType = null) * * @return TaxDisplayType|null */ - public function getTaxDisplayType() + public function getTaxDisplayType(): ?TaxDisplayType { return $this->TaxDisplayType; } @@ -877,7 +877,7 @@ public function getTaxDisplayType() * * @return OrderItem */ - public function setOrderItemType(?OrderItemType $orderItemType = null) + public function setOrderItemType(?OrderItemType $orderItemType = null): OrderItem { $this->OrderItemType = $orderItemType; @@ -890,7 +890,7 @@ public function setOrderItemType(?OrderItemType $orderItemType = null) * @return OrderItemType|null */ #[\Override] - public function getOrderItemType() + public function getOrderItemType(): ?OrderItemType { return $this->OrderItemType; } diff --git a/src/Eccube/Entity/OrderPdf.php b/src/Eccube/Entity/OrderPdf.php index 61bb50c52d1..3e29504aad6 100644 --- a/src/Eccube/Entity/OrderPdf.php +++ b/src/Eccube/Entity/OrderPdf.php @@ -118,7 +118,7 @@ class OrderPdf extends AbstractEntity /** * @return int */ - public function getMemberId() + public function getMemberId(): int { return $this->member_id; } @@ -128,7 +128,7 @@ public function getMemberId() * * @return $this */ - public function setMemberId($member_id) + public function setMemberId($member_id): static { $this->member_id = $member_id; @@ -138,7 +138,7 @@ public function setMemberId($member_id) /** * @return string */ - public function getTitle() + public function getTitle(): string { return $this->title; } @@ -148,7 +148,7 @@ public function getTitle() * * @return $this */ - public function setTitle($title) + public function setTitle($title): static { $this->title = $title; @@ -156,9 +156,9 @@ public function setTitle($title) } /** - * @return string + * @return string|null */ - public function getMessage1() + public function getMessage1(): ?string { return $this->message1; } @@ -168,7 +168,7 @@ public function getMessage1() * * @return $this */ - public function setMessage1($message1) + public function setMessage1($message1): static { $this->message1 = $message1; @@ -176,9 +176,9 @@ public function setMessage1($message1) } /** - * @return string + * @return string|null */ - public function getMessage2() + public function getMessage2(): ?string { return $this->message2; } @@ -188,7 +188,7 @@ public function getMessage2() * * @return $this */ - public function setMessage2($message2) + public function setMessage2($message2): static { $this->message2 = $message2; @@ -196,9 +196,9 @@ public function setMessage2($message2) } /** - * @return string + * @return string|null */ - public function getMessage3() + public function getMessage3(): ?string { return $this->message3; } @@ -208,7 +208,7 @@ public function getMessage3() * * @return $this */ - public function setMessage3($message3) + public function setMessage3($message3): static { $this->message3 = $message3; @@ -216,9 +216,9 @@ public function setMessage3($message3) } /** - * @return string + * @return string|null */ - public function getNote1() + public function getNote1(): ?string { return $this->note1; } @@ -228,7 +228,7 @@ public function getNote1() * * @return $this */ - public function setNote1($note1) + public function setNote1($note1): static { $this->note1 = $note1; @@ -236,9 +236,9 @@ public function setNote1($note1) } /** - * @return string + * @return string|null */ - public function getNote2() + public function getNote2(): ?string { return $this->note2; } @@ -248,7 +248,7 @@ public function getNote2() * * @return $this */ - public function setNote2($note2) + public function setNote2($note2): static { $this->note2 = $note2; @@ -256,9 +256,9 @@ public function setNote2($note2) } /** - * @return string + * @return string|null */ - public function getNote3() + public function getNote3(): ?string { return $this->note3; } @@ -268,7 +268,7 @@ public function getNote3() * * @return $this */ - public function setNote3($note3) + public function setNote3($note3): static { $this->note3 = $note3; @@ -278,7 +278,7 @@ public function setNote3($note3) /** * @return \DateTime */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -288,7 +288,7 @@ public function getCreateDate() * * @return $this */ - public function setCreateDate($create_date) + public function setCreateDate($create_date): static { $this->create_date = $create_date; @@ -298,7 +298,7 @@ public function setCreateDate($create_date) /** * @return \DateTime */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -308,7 +308,7 @@ public function getUpdateDate() * * @return $this */ - public function setUpdateDate($update_date) + public function setUpdateDate($update_date): static { $this->update_date = $update_date; @@ -322,7 +322,7 @@ public function setUpdateDate($update_date) * * @return OrderPdf */ - public function setVisible($visible) + public function setVisible($visible): OrderPdf { $this->visible = $visible; @@ -334,7 +334,7 @@ public function setVisible($visible) * * @return bool */ - public function isVisible() + public function isVisible(): bool { return $this->visible; } diff --git a/src/Eccube/Entity/Page.php b/src/Eccube/Entity/Page.php index 966d0f6cfad..a0b02c234d5 100644 --- a/src/Eccube/Entity/Page.php +++ b/src/Eccube/Entity/Page.php @@ -46,7 +46,7 @@ class Page extends AbstractEntity /** * @return array|Layout[] */ - public function getLayouts() + public function getLayouts(): array { $Layouts = []; foreach ($this->PageLayouts as $PageLayout) { @@ -178,7 +178,7 @@ public function __construct() * * @return Page */ - public function setId($id) + public function setId($id): Page { $this->id = $id; @@ -190,7 +190,7 @@ public function setId($id) * * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -202,7 +202,7 @@ public function getId() * * @return Page */ - public function setName($name = null) + public function setName($name = null): Page { $this->name = $name; @@ -214,7 +214,7 @@ public function setName($name = null) * * @return string|null */ - public function getName() + public function getName(): ?string { return $this->name; } @@ -226,7 +226,7 @@ public function getName() * * @return Page */ - public function setUrl($url) + public function setUrl($url): Page { $this->url = $url; @@ -236,9 +236,9 @@ public function setUrl($url) /** * Get url. * - * @return string + * @return string|null */ - public function getUrl() + public function getUrl(): ?string { return $this->url; } @@ -250,7 +250,7 @@ public function getUrl() * * @return Page */ - public function setFileName($fileName = null) + public function setFileName($fileName = null): Page { $this->file_name = $fileName; @@ -262,7 +262,7 @@ public function setFileName($fileName = null) * * @return string|null */ - public function getFileName() + public function getFileName(): ?string { return $this->file_name; } @@ -274,7 +274,7 @@ public function getFileName() * * @return Page */ - public function setEditType($editType) + public function setEditType($editType): Page { $this->edit_type = $editType; @@ -286,7 +286,7 @@ public function setEditType($editType) * * @return int */ - public function getEditType() + public function getEditType(): int { return $this->edit_type; } @@ -298,7 +298,7 @@ public function getEditType() * * @return Page */ - public function setAuthor($author = null) + public function setAuthor($author = null): Page { $this->author = $author; @@ -310,7 +310,7 @@ public function setAuthor($author = null) * * @return string|null */ - public function getAuthor() + public function getAuthor(): ?string { return $this->author; } @@ -322,7 +322,7 @@ public function getAuthor() * * @return Page */ - public function setDescription($description = null) + public function setDescription($description = null): Page { $this->description = $description; @@ -334,7 +334,7 @@ public function setDescription($description = null) * * @return string|null */ - public function getDescription() + public function getDescription(): ?string { return $this->description; } @@ -346,7 +346,7 @@ public function getDescription() * * @return Page */ - public function setKeyword($keyword = null) + public function setKeyword($keyword = null): Page { $this->keyword = $keyword; @@ -358,7 +358,7 @@ public function setKeyword($keyword = null) * * @return string|null */ - public function getKeyword() + public function getKeyword(): ?string { return $this->keyword; } @@ -370,7 +370,7 @@ public function getKeyword() * * @return Page */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Page { $this->create_date = $createDate; @@ -380,9 +380,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -394,7 +394,7 @@ public function getCreateDate() * * @return Page */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Page { $this->update_date = $updateDate; @@ -404,9 +404,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -418,7 +418,7 @@ public function getUpdateDate() * * @return Page */ - public function setMetaRobots($metaRobots = null) + public function setMetaRobots($metaRobots = null): Page { $this->meta_robots = $metaRobots; @@ -430,7 +430,7 @@ public function setMetaRobots($metaRobots = null) * * @return string|null */ - public function getMetaRobots() + public function getMetaRobots(): ?string { return $this->meta_robots; } @@ -442,7 +442,7 @@ public function getMetaRobots() * * @return Page */ - public function setMetaTags($metaTags) + public function setMetaTags($metaTags): Page { $this->meta_tags = $metaTags; @@ -452,9 +452,9 @@ public function setMetaTags($metaTags) /** * Get meta_tags * - * @return string + * @return string|null */ - public function getMetaTags() + public function getMetaTags(): ?string { return $this->meta_tags; } @@ -464,7 +464,7 @@ public function getMetaTags() * * @return \Doctrine\Common\Collections\Collection */ - public function getPageLayouts() + public function getPageLayouts(): \Doctrine\Common\Collections\Collection { return $this->PageLayouts; } @@ -476,7 +476,7 @@ public function getPageLayouts() * * @return Page */ - public function addPageLayout(PageLayout $PageLayout) + public function addPageLayout(PageLayout $PageLayout): Page { $this->PageLayouts[] = $PageLayout; @@ -490,7 +490,7 @@ public function addPageLayout(PageLayout $PageLayout) * * @return void */ - public function removePageLayout(PageLayout $PageLayout) + public function removePageLayout(PageLayout $PageLayout): void { $this->PageLayouts->removeElement($PageLayout); } @@ -502,7 +502,7 @@ public function removePageLayout(PageLayout $PageLayout) * * @return Page */ - public function setMasterPage(?Page $page = null) + public function setMasterPage(?Page $page = null): Page { $this->MasterPage = $page; @@ -514,7 +514,7 @@ public function setMasterPage(?Page $page = null) * * @return Page|null */ - public function getMasterPage() + public function getMasterPage(): ?Page { return $this->MasterPage; } @@ -524,7 +524,7 @@ public function getMasterPage() * * @return int|null */ - public function getSortNo($layoutId) + public function getSortNo($layoutId): ?int { $pageLayouts = $this->getPageLayouts(); diff --git a/src/Eccube/Entity/PageLayout.php b/src/Eccube/Entity/PageLayout.php index 4a7529edc8e..e18622e004a 100644 --- a/src/Eccube/Entity/PageLayout.php +++ b/src/Eccube/Entity/PageLayout.php @@ -91,7 +91,7 @@ class PageLayout extends AbstractEntity * * @return PageLayout */ - public function setPageId($pageId) + public function setPageId($pageId): PageLayout { $this->page_id = $pageId; @@ -103,7 +103,7 @@ public function setPageId($pageId) * * @return int */ - public function getPageId() + public function getPageId(): int { return $this->page_id; } @@ -115,7 +115,7 @@ public function getPageId() * * @return PageLayout */ - public function setLayoutId($layoutId) + public function setLayoutId($layoutId): PageLayout { $this->layout_id = $layoutId; @@ -127,7 +127,7 @@ public function setLayoutId($layoutId) * * @return int */ - public function getLayoutId() + public function getLayoutId(): int { return $this->layout_id; } @@ -139,7 +139,7 @@ public function getLayoutId() * * @return PageLayout */ - public function setSortNo($sortNo) + public function setSortNo($sortNo): PageLayout { $this->sort_no = $sortNo; @@ -151,7 +151,7 @@ public function setSortNo($sortNo) * * @return int */ - public function getSortNo() + public function getSortNo(): int { return $this->sort_no; } @@ -163,7 +163,7 @@ public function getSortNo() * * @return PageLayout */ - public function setPage(?Page $Page = null) + public function setPage(?Page $Page = null): PageLayout { $this->Page = $Page; @@ -175,7 +175,7 @@ public function setPage(?Page $Page = null) * * @return Page */ - public function getPage() + public function getPage(): Page { return $this->Page; } @@ -187,7 +187,7 @@ public function getPage() * * @return PageLayout */ - public function setLayout(?Layout $layout = null) + public function setLayout(?Layout $layout = null): PageLayout { $this->Layout = $layout; @@ -199,7 +199,7 @@ public function setLayout(?Layout $layout = null) * * @return Layout */ - public function getLayout() + public function getLayout(): Layout { return $this->Layout; } @@ -210,7 +210,7 @@ public function getLayout() * * @return int|null */ - public function getDeviceTypeId() + public function getDeviceTypeId(): ?int { if ($this->Layout->getDeviceType()) { return $this->Layout->getDeviceType()->getId(); diff --git a/src/Eccube/Entity/Payment.php b/src/Eccube/Entity/Payment.php index 9a95f8aa2f4..594f621ac2a 100644 --- a/src/Eccube/Entity/Payment.php +++ b/src/Eccube/Entity/Payment.php @@ -160,9 +160,9 @@ public function __construct() /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -174,7 +174,7 @@ public function getId() * * @return Payment */ - public function setMethod($method = null) + public function setMethod($method = null): Payment { $this->method = $method; @@ -186,7 +186,7 @@ public function setMethod($method = null) * * @return string|null */ - public function getMethod() + public function getMethod(): ?string { return $this->method; } @@ -198,7 +198,7 @@ public function getMethod() * * @return Payment */ - public function setCharge($charge = null) + public function setCharge($charge = null): Payment { $this->charge = $charge; @@ -210,7 +210,7 @@ public function setCharge($charge = null) * * @return string|null */ - public function getCharge() + public function getCharge(): ?string { return $this->charge; } @@ -222,7 +222,7 @@ public function getCharge() * * @return Payment */ - public function setRuleMax($ruleMax = null) + public function setRuleMax($ruleMax = null): Payment { $this->rule_max = $ruleMax; @@ -234,7 +234,7 @@ public function setRuleMax($ruleMax = null) * * @return string|null */ - public function getRuleMax() + public function getRuleMax(): ?string { return $this->rule_max; } @@ -246,7 +246,7 @@ public function getRuleMax() * * @return Payment */ - public function setSortNo($sortNo = null) + public function setSortNo($sortNo = null): Payment { $this->sort_no = $sortNo; @@ -258,7 +258,7 @@ public function setSortNo($sortNo = null) * * @return int|null */ - public function getSortNo() + public function getSortNo(): ?int { return $this->sort_no; } @@ -270,7 +270,7 @@ public function getSortNo() * * @return Payment */ - public function setFixed($fixed) + public function setFixed($fixed): Payment { $this->fixed = $fixed; @@ -282,7 +282,7 @@ public function setFixed($fixed) * * @return bool */ - public function isFixed() + public function isFixed(): bool { return $this->fixed; } @@ -294,7 +294,7 @@ public function isFixed() * * @return Payment */ - public function setPaymentImage($paymentImage = null) + public function setPaymentImage($paymentImage = null): Payment { $this->payment_image = $paymentImage; @@ -306,7 +306,7 @@ public function setPaymentImage($paymentImage = null) * * @return string|null */ - public function getPaymentImage() + public function getPaymentImage(): ?string { return $this->payment_image; } @@ -318,7 +318,7 @@ public function getPaymentImage() * * @return Payment */ - public function setRuleMin($ruleMin = null) + public function setRuleMin($ruleMin = null): Payment { $this->rule_min = $ruleMin; @@ -330,7 +330,7 @@ public function setRuleMin($ruleMin = null) * * @return string|null */ - public function getRuleMin() + public function getRuleMin(): ?string { return $this->rule_min; } @@ -342,7 +342,7 @@ public function getRuleMin() * * @return Payment */ - public function setMethodClass($methodClass = null) + public function setMethodClass($methodClass = null): Payment { $this->method_class = $methodClass; @@ -354,7 +354,7 @@ public function setMethodClass($methodClass = null) * * @return string|null */ - public function getMethodClass() + public function getMethodClass(): ?string { return $this->method_class; } @@ -362,7 +362,7 @@ public function getMethodClass() /** * @return bool */ - public function isVisible() + public function isVisible(): bool { return $this->visible; } @@ -372,7 +372,7 @@ public function isVisible() * * @return Payment */ - public function setVisible($visible) + public function setVisible($visible): Payment { $this->visible = $visible; @@ -386,7 +386,7 @@ public function setVisible($visible) * * @return Payment */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Payment { $this->create_date = $createDate; @@ -396,9 +396,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -410,7 +410,7 @@ public function getCreateDate() * * @return Payment */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Payment { $this->update_date = $updateDate; @@ -420,9 +420,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -434,7 +434,7 @@ public function getUpdateDate() * * @return Payment */ - public function addPaymentOption(PaymentOption $paymentOption) + public function addPaymentOption(PaymentOption $paymentOption): Payment { $this->PaymentOptions[] = $paymentOption; @@ -448,7 +448,7 @@ public function addPaymentOption(PaymentOption $paymentOption) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removePaymentOption(PaymentOption $paymentOption) + public function removePaymentOption(PaymentOption $paymentOption): bool { return $this->PaymentOptions->removeElement($paymentOption); } @@ -458,7 +458,7 @@ public function removePaymentOption(PaymentOption $paymentOption) * * @return \Doctrine\Common\Collections\Collection */ - public function getPaymentOptions() + public function getPaymentOptions(): \Doctrine\Common\Collections\Collection { return $this->PaymentOptions; } @@ -470,7 +470,7 @@ public function getPaymentOptions() * * @return Payment */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): Payment { $this->Creator = $creator; @@ -482,7 +482,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } diff --git a/src/Eccube/Entity/PaymentOption.php b/src/Eccube/Entity/PaymentOption.php index 4bb42a940ab..17d0a1dfee2 100644 --- a/src/Eccube/Entity/PaymentOption.php +++ b/src/Eccube/Entity/PaymentOption.php @@ -84,7 +84,7 @@ class PaymentOption extends AbstractEntity * * @return PaymentOption */ - public function setDeliveryId($deliveryId) + public function setDeliveryId($deliveryId): PaymentOption { $this->delivery_id = $deliveryId; @@ -96,7 +96,7 @@ public function setDeliveryId($deliveryId) * * @return int */ - public function getDeliveryId() + public function getDeliveryId(): int { return $this->delivery_id; } @@ -108,7 +108,7 @@ public function getDeliveryId() * * @return PaymentOption */ - public function setPaymentId($paymentId) + public function setPaymentId($paymentId): PaymentOption { $this->payment_id = $paymentId; @@ -120,7 +120,7 @@ public function setPaymentId($paymentId) * * @return int */ - public function getPaymentId() + public function getPaymentId(): int { return $this->payment_id; } @@ -132,7 +132,7 @@ public function getPaymentId() * * @return PaymentOption */ - public function setDelivery(?Delivery $delivery = null) + public function setDelivery(?Delivery $delivery = null): PaymentOption { $this->Delivery = $delivery; @@ -144,7 +144,7 @@ public function setDelivery(?Delivery $delivery = null) * * @return Delivery|null */ - public function getDelivery() + public function getDelivery(): ?Delivery { return $this->Delivery; } @@ -156,7 +156,7 @@ public function getDelivery() * * @return PaymentOption */ - public function setPayment(?Payment $payment = null) + public function setPayment(?Payment $payment = null): PaymentOption { $this->Payment = $payment; @@ -168,7 +168,7 @@ public function setPayment(?Payment $payment = null) * * @return Payment|null */ - public function getPayment() + public function getPayment(): ?Payment { return $this->Payment; } diff --git a/src/Eccube/Entity/Plugin.php b/src/Eccube/Entity/Plugin.php index 83e04d77e1a..3782e64f1aa 100644 --- a/src/Eccube/Entity/Plugin.php +++ b/src/Eccube/Entity/Plugin.php @@ -105,7 +105,7 @@ class Plugin extends AbstractEntity * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -117,7 +117,7 @@ public function getId() * * @return Plugin */ - public function setName($name) + public function setName($name): Plugin { $this->name = $name; @@ -129,7 +129,7 @@ public function setName($name) * * @return string */ - public function getName() + public function getName(): string { return $this->name; } @@ -141,7 +141,7 @@ public function getName() * * @return Plugin */ - public function setCode($code) + public function setCode($code): Plugin { $this->code = $code; @@ -153,7 +153,7 @@ public function setCode($code) * * @return string */ - public function getCode() + public function getCode(): string { return $this->code; } @@ -165,7 +165,7 @@ public function getCode() * * @return Plugin */ - public function setEnabled($enabled) + public function setEnabled($enabled): Plugin { $this->enabled = $enabled; @@ -177,7 +177,7 @@ public function setEnabled($enabled) * * @return bool */ - public function isEnabled() + public function isEnabled(): bool { return $this->enabled; } @@ -189,7 +189,7 @@ public function isEnabled() * * @return Plugin */ - public function setVersion($version) + public function setVersion($version): Plugin { $this->version = $version; @@ -201,7 +201,7 @@ public function setVersion($version) * * @return string */ - public function getVersion() + public function getVersion(): string { return $this->version; } @@ -213,7 +213,7 @@ public function getVersion() * * @return Plugin */ - public function setSource($source) + public function setSource($source): Plugin { $this->source = $source; @@ -225,7 +225,7 @@ public function setSource($source) * * @return string */ - public function getSource() + public function getSource(): string { return $this->source; } @@ -247,7 +247,7 @@ public function isInitialized(): bool * * @return Plugin */ - public function setInitialized(bool $initialized) + public function setInitialized(bool $initialized): Plugin { $this->initialized = $initialized; @@ -261,7 +261,7 @@ public function setInitialized(bool $initialized) * * @return Plugin */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Plugin { $this->create_date = $createDate; @@ -271,9 +271,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -285,7 +285,7 @@ public function getCreateDate() * * @return Plugin */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Plugin { $this->update_date = $updateDate; @@ -295,9 +295,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } diff --git a/src/Eccube/Entity/PointRateTrait.php b/src/Eccube/Entity/PointRateTrait.php index 445a2706596..1554629f512 100644 --- a/src/Eccube/Entity/PointRateTrait.php +++ b/src/Eccube/Entity/PointRateTrait.php @@ -27,11 +27,11 @@ trait PointRateTrait /** * Set pointRate * - * @param string $pointRate + * @param string|null $pointRate * * @return $this */ - public function setPointRate($pointRate) + public function setPointRate($pointRate): static { $this->point_rate = $pointRate; @@ -41,9 +41,9 @@ public function setPointRate($pointRate) /** * Get pointRate * - * @return string + * @return string|null */ - public function getPointRate() + public function getPointRate(): ?string { return $this->point_rate; } diff --git a/src/Eccube/Entity/PointTrait.php b/src/Eccube/Entity/PointTrait.php index f017d701f64..dc4fa259808 100644 --- a/src/Eccube/Entity/PointTrait.php +++ b/src/Eccube/Entity/PointTrait.php @@ -38,7 +38,7 @@ trait PointTrait * * @return $this */ - public function setAddPoint($addPoint) + public function setAddPoint($addPoint): static { $this->add_point = $addPoint; @@ -50,7 +50,7 @@ public function setAddPoint($addPoint) * * @return string */ - public function getAddPoint() + public function getAddPoint(): string { return $this->add_point; } @@ -62,7 +62,7 @@ public function getAddPoint() * * @return $this */ - public function setUsePoint($usePoint) + public function setUsePoint($usePoint): static { $this->use_point = $usePoint; @@ -72,9 +72,9 @@ public function setUsePoint($usePoint) /** * Get usePoint * - * @return string + * @return string|null */ - public function getUsePoint() + public function getUsePoint(): ?string { return $this->use_point; } diff --git a/src/Eccube/Entity/Product.php b/src/Eccube/Entity/Product.php index 1ce28340d72..94a3dbf1e9c 100644 --- a/src/Eccube/Entity/Product.php +++ b/src/Eccube/Entity/Product.php @@ -91,13 +91,13 @@ class Product extends AbstractEntity implements \Stringable #[\Override] public function __toString(): string { - return (string) $this->getName(); + return $this->getName(); } /** * @return void */ - public function _calc() + public function _calc(): void { if (!$this->_calc) { $i = 0; @@ -173,7 +173,7 @@ public function _calc() * * @deprecated */ - public function isEnable() + public function isEnable(): bool { return $this->getStatus()->getId() === Master\ProductStatus::DISPLAY_SHOW ? true : false; } @@ -183,7 +183,7 @@ public function isEnable() * * @return string|null */ - public function getClassName1() + public function getClassName1(): ?string { $this->_calc(); @@ -195,7 +195,7 @@ public function getClassName1() * * @return string|null */ - public function getClassName2() + public function getClassName2(): ?string { $this->_calc(); @@ -207,7 +207,7 @@ public function getClassName2() * * @return array */ - public function getClassCategories1() + public function getClassCategories1(): array { $this->_calc(); @@ -217,7 +217,7 @@ public function getClassCategories1() /** * @return array */ - public function getClassCategories1AsFlip() + public function getClassCategories1AsFlip(): array { return array_flip($this->getClassCategories1()); } @@ -229,7 +229,7 @@ public function getClassCategories1AsFlip() * * @return array */ - public function getClassCategories2($class_category1) + public function getClassCategories2($class_category1): array { $this->_calc(); @@ -241,7 +241,7 @@ public function getClassCategories2($class_category1) * * @return array */ - public function getClassCategories2AsFlip($class_category1) + public function getClassCategories2AsFlip($class_category1): array { return array_flip($this->getClassCategories2($class_category1)); } @@ -251,7 +251,7 @@ public function getClassCategories2AsFlip($class_category1) * * @return bool|null */ - public function getStockFind() + public function getStockFind(): ?bool { $this->_calc(); @@ -265,7 +265,7 @@ public function getStockFind() * * @return string|null */ - public function getStockMin() + public function getStockMin(): ?string { $this->_calc(); @@ -279,7 +279,7 @@ public function getStockMin() * * @return string|null */ - public function getStockMax() + public function getStockMax(): ?string { $this->_calc(); @@ -293,7 +293,7 @@ public function getStockMax() * * @return bool|null */ - public function getStockUnlimitedMin() + public function getStockUnlimitedMin(): ?bool { $this->_calc(); @@ -307,7 +307,7 @@ public function getStockUnlimitedMin() * * @return bool|null */ - public function getStockUnlimitedMax() + public function getStockUnlimitedMax(): ?bool { $this->_calc(); @@ -321,7 +321,7 @@ public function getStockUnlimitedMax() * * @return string|null */ - public function getPrice01Min() + public function getPrice01Min(): ?string { $this->_calc(); @@ -337,7 +337,7 @@ public function getPrice01Min() * * @return string|null */ - public function getPrice01Max() + public function getPrice01Max(): ?string { $this->_calc(); @@ -353,7 +353,7 @@ public function getPrice01Max() * * @return string|null */ - public function getPrice02Min() + public function getPrice02Min(): ?string { $this->_calc(); @@ -367,7 +367,7 @@ public function getPrice02Min() * * @return string|null */ - public function getPrice02Max() + public function getPrice02Max(): ?string { $this->_calc(); @@ -381,7 +381,7 @@ public function getPrice02Max() * * @return string|null */ - public function getPrice01IncTaxMin() + public function getPrice01IncTaxMin(): ?string { $this->_calc(); @@ -395,7 +395,7 @@ public function getPrice01IncTaxMin() * * @return string|null */ - public function getPrice01IncTaxMax() + public function getPrice01IncTaxMax(): ?string { $this->_calc(); @@ -409,7 +409,7 @@ public function getPrice01IncTaxMax() * * @return string|null */ - public function getPrice02IncTaxMin() + public function getPrice02IncTaxMin(): ?string { $this->_calc(); @@ -423,7 +423,7 @@ public function getPrice02IncTaxMin() * * @return string|null */ - public function getPrice02IncTaxMax() + public function getPrice02IncTaxMax(): ?string { $this->_calc(); @@ -437,7 +437,7 @@ public function getPrice02IncTaxMax() * * @return string|null */ - public function getCodeMin() + public function getCodeMin(): ?string { $this->_calc(); @@ -456,7 +456,7 @@ public function getCodeMin() * * @return string|null */ - public function getCodeMax() + public function getCodeMax(): ?string { $this->_calc(); @@ -473,7 +473,7 @@ public function getCodeMax() /** * @return ProductImage|null */ - public function getMainListImage() + public function getMainListImage(): ?ProductImage { $ProductImages = $this->getProductImage(); @@ -483,7 +483,7 @@ public function getMainListImage() /** * @return ProductImage|null */ - public function getMainFileName() + public function getMainFileName(): ?ProductImage { if (count($this->ProductImage) > 0) { return $this->ProductImage[0]; @@ -495,7 +495,7 @@ public function getMainFileName() /** * @return bool */ - public function hasProductClass() + public function hasProductClass(): bool { foreach ($this->ProductClasses as $ProductClass) { if (!$ProductClass->isVisible()) { @@ -659,7 +659,7 @@ public function __clone() /** * @return Product */ - public function copy() + public function copy(): Product { // コピー対象外 $this->CustomerFavoriteProducts = new ArrayCollection(); @@ -704,7 +704,7 @@ public function copy() * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -716,7 +716,7 @@ public function getId() * * @return Product */ - public function setName($name) + public function setName($name): Product { $this->name = $name; @@ -728,7 +728,7 @@ public function setName($name) * * @return string */ - public function getName() + public function getName(): string { return $this->name; } @@ -740,7 +740,7 @@ public function getName() * * @return Product */ - public function setNote($note = null) + public function setNote($note = null): Product { $this->note = $note; @@ -752,7 +752,7 @@ public function setNote($note = null) * * @return string|null */ - public function getNote() + public function getNote(): ?string { return $this->note; } @@ -764,7 +764,7 @@ public function getNote() * * @return Product */ - public function setDescriptionList($descriptionList = null) + public function setDescriptionList($descriptionList = null): Product { $this->description_list = $descriptionList; @@ -776,7 +776,7 @@ public function setDescriptionList($descriptionList = null) * * @return string|null */ - public function getDescriptionList() + public function getDescriptionList(): ?string { return $this->description_list; } @@ -788,7 +788,7 @@ public function getDescriptionList() * * @return Product */ - public function setDescriptionDetail($descriptionDetail = null) + public function setDescriptionDetail($descriptionDetail = null): Product { $this->description_detail = $descriptionDetail; @@ -800,7 +800,7 @@ public function setDescriptionDetail($descriptionDetail = null) * * @return string|null */ - public function getDescriptionDetail() + public function getDescriptionDetail(): ?string { return $this->description_detail; } @@ -812,7 +812,7 @@ public function getDescriptionDetail() * * @return Product */ - public function setSearchWord($searchWord = null) + public function setSearchWord($searchWord = null): Product { $this->search_word = $searchWord; @@ -824,7 +824,7 @@ public function setSearchWord($searchWord = null) * * @return string|null */ - public function getSearchWord() + public function getSearchWord(): ?string { return $this->search_word; } @@ -836,7 +836,7 @@ public function getSearchWord() * * @return Product */ - public function setFreeArea($freeArea = null) + public function setFreeArea($freeArea = null): Product { $this->free_area = $freeArea; @@ -848,7 +848,7 @@ public function setFreeArea($freeArea = null) * * @return string|null */ - public function getFreeArea() + public function getFreeArea(): ?string { return $this->free_area; } @@ -860,7 +860,7 @@ public function getFreeArea() * * @return Product */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Product { $this->create_date = $createDate; @@ -870,9 +870,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -884,7 +884,7 @@ public function getCreateDate() * * @return Product */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Product { $this->update_date = $updateDate; @@ -894,9 +894,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -908,7 +908,7 @@ public function getUpdateDate() * * @return Product */ - public function addProductCategory(ProductCategory $productCategory) + public function addProductCategory(ProductCategory $productCategory): Product { $this->ProductCategories[] = $productCategory; @@ -922,7 +922,7 @@ public function addProductCategory(ProductCategory $productCategory) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeProductCategory(ProductCategory $productCategory) + public function removeProductCategory(ProductCategory $productCategory): bool { return $this->ProductCategories->removeElement($productCategory); } @@ -932,7 +932,7 @@ public function removeProductCategory(ProductCategory $productCategory) * * @return \Doctrine\Common\Collections\Collection */ - public function getProductCategories() + public function getProductCategories(): \Doctrine\Common\Collections\Collection { return $this->ProductCategories; } @@ -944,7 +944,7 @@ public function getProductCategories() * * @return Product */ - public function addProductClass(ProductClass $productClass) + public function addProductClass(ProductClass $productClass): Product { $this->ProductClasses[] = $productClass; @@ -958,7 +958,7 @@ public function addProductClass(ProductClass $productClass) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeProductClass(ProductClass $productClass) + public function removeProductClass(ProductClass $productClass): bool { return $this->ProductClasses->removeElement($productClass); } @@ -968,7 +968,7 @@ public function removeProductClass(ProductClass $productClass) * * @return \Doctrine\Common\Collections\Collection|null */ - public function getProductClasses() + public function getProductClasses(): ?\Doctrine\Common\Collections\Collection { return $this->ProductClasses; } @@ -980,7 +980,7 @@ public function getProductClasses() * * @return Product */ - public function addProductImage(ProductImage $productImage) + public function addProductImage(ProductImage $productImage): Product { $this->ProductImage[] = $productImage; @@ -994,7 +994,7 @@ public function addProductImage(ProductImage $productImage) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeProductImage(ProductImage $productImage) + public function removeProductImage(ProductImage $productImage): bool { return $this->ProductImage->removeElement($productImage); } @@ -1004,7 +1004,7 @@ public function removeProductImage(ProductImage $productImage) * * @return \Doctrine\Common\Collections\Collection */ - public function getProductImage() + public function getProductImage(): \Doctrine\Common\Collections\Collection { return $this->ProductImage; } @@ -1016,7 +1016,7 @@ public function getProductImage() * * @return Product */ - public function addProductTag(ProductTag $productTag) + public function addProductTag(ProductTag $productTag): Product { $this->ProductTag[] = $productTag; @@ -1030,7 +1030,7 @@ public function addProductTag(ProductTag $productTag) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeProductTag(ProductTag $productTag) + public function removeProductTag(ProductTag $productTag): bool { return $this->ProductTag->removeElement($productTag); } @@ -1040,7 +1040,7 @@ public function removeProductTag(ProductTag $productTag) * * @return \Doctrine\Common\Collections\Collection */ - public function getProductTag() + public function getProductTag(): \Doctrine\Common\Collections\Collection { return $this->ProductTag; } @@ -1051,7 +1051,7 @@ public function getProductTag() * * @return Tag[] */ - public function getTags() + public function getTags(): array { $tags = []; @@ -1073,7 +1073,7 @@ public function getTags() * * @return Product */ - public function addCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavoriteProduct) + public function addCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavoriteProduct): Product { $this->CustomerFavoriteProducts[] = $customerFavoriteProduct; @@ -1087,7 +1087,7 @@ public function addCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavo * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavoriteProduct) + public function removeCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavoriteProduct): bool { return $this->CustomerFavoriteProducts->removeElement($customerFavoriteProduct); } @@ -1097,7 +1097,7 @@ public function removeCustomerFavoriteProduct(CustomerFavoriteProduct $customerF * * @return \Doctrine\Common\Collections\Collection */ - public function getCustomerFavoriteProducts() + public function getCustomerFavoriteProducts(): \Doctrine\Common\Collections\Collection { return $this->CustomerFavoriteProducts; } @@ -1109,7 +1109,7 @@ public function getCustomerFavoriteProducts() * * @return Product */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): Product { $this->Creator = $creator; @@ -1121,7 +1121,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } @@ -1133,7 +1133,7 @@ public function getCreator() * * @return Product */ - public function setStatus(?Master\ProductStatus $status = null) + public function setStatus(?Master\ProductStatus $status = null): Product { $this->Status = $status; @@ -1145,7 +1145,7 @@ public function setStatus(?Master\ProductStatus $status = null) * * @return Master\ProductStatus|null */ - public function getStatus() + public function getStatus(): ?Master\ProductStatus { return $this->Status; } diff --git a/src/Eccube/Entity/ProductCategory.php b/src/Eccube/Entity/ProductCategory.php index 6af582674a8..773ec75b212 100644 --- a/src/Eccube/Entity/ProductCategory.php +++ b/src/Eccube/Entity/ProductCategory.php @@ -84,7 +84,7 @@ class ProductCategory extends AbstractEntity * * @return ProductCategory */ - public function setProductId($productId) + public function setProductId($productId): ProductCategory { $this->product_id = $productId; @@ -96,7 +96,7 @@ public function setProductId($productId) * * @return int */ - public function getProductId() + public function getProductId(): int { return $this->product_id; } @@ -108,7 +108,7 @@ public function getProductId() * * @return ProductCategory */ - public function setCategoryId($categoryId) + public function setCategoryId($categoryId): ProductCategory { $this->category_id = $categoryId; @@ -120,7 +120,7 @@ public function setCategoryId($categoryId) * * @return int */ - public function getCategoryId() + public function getCategoryId(): int { return $this->category_id; } @@ -132,7 +132,7 @@ public function getCategoryId() * * @return ProductCategory */ - public function setProduct(?Product $product = null) + public function setProduct(?Product $product = null): ProductCategory { $this->Product = $product; @@ -144,7 +144,7 @@ public function setProduct(?Product $product = null) * * @return Product|null */ - public function getProduct() + public function getProduct(): ?Product { return $this->Product; } @@ -156,7 +156,7 @@ public function getProduct() * * @return ProductCategory */ - public function setCategory(?Category $category = null) + public function setCategory(?Category $category = null): ProductCategory { $this->Category = $category; @@ -168,7 +168,7 @@ public function setCategory(?Category $category = null) * * @return Category|null */ - public function getCategory() + public function getCategory(): ?Category { return $this->Category; } diff --git a/src/Eccube/Entity/ProductClass.php b/src/Eccube/Entity/ProductClass.php index d8b5fffee07..3a75b38bdb3 100644 --- a/src/Eccube/Entity/ProductClass.php +++ b/src/Eccube/Entity/ProductClass.php @@ -43,7 +43,7 @@ class ProductClass extends AbstractEntity * * @return string */ - public function formattedProductName() + public function formattedProductName(): string { $productName = $this->getProduct()->getName(); if ($this->hasClassCategory1()) { @@ -63,7 +63,7 @@ public function formattedProductName() * * @deprecated */ - public function isEnable() + public function isEnable(): bool { return $this->getProduct()->isEnable(); } @@ -75,7 +75,7 @@ public function isEnable() * * @return ProductClass */ - public function setPrice01IncTax($price01_inc_tax) + public function setPrice01IncTax($price01_inc_tax): ProductClass { $this->price01_inc_tax = $price01_inc_tax; @@ -87,7 +87,7 @@ public function setPrice01IncTax($price01_inc_tax) * * @return string */ - public function getPrice01IncTax() + public function getPrice01IncTax(): string { return $this->price01_inc_tax; } @@ -99,7 +99,7 @@ public function getPrice01IncTax() * * @return ProductClass */ - public function setPrice02IncTax($price02_inc_tax) + public function setPrice02IncTax($price02_inc_tax): ProductClass { $this->price02_inc_tax = $price02_inc_tax; @@ -111,7 +111,7 @@ public function setPrice02IncTax($price02_inc_tax) * * @return string */ - public function getPrice02IncTax() + public function getPrice02IncTax(): string { return $this->price02_inc_tax; } @@ -121,7 +121,7 @@ public function getPrice02IncTax() * * @return bool */ - public function getStockFind() + public function getStockFind(): bool { if ($this->getStock() > 0 || $this->isStockUnlimited()) { return true; @@ -137,7 +137,7 @@ public function getStockFind() * * @return ProductClass */ - public function setTaxRate($tax_rate) + public function setTaxRate($tax_rate): ProductClass { $this->tax_rate = $tax_rate; @@ -149,7 +149,7 @@ public function setTaxRate($tax_rate) * * @return string|null */ - public function getTaxRate() + public function getTaxRate(): ?string { return $this->tax_rate; } @@ -159,7 +159,7 @@ public function getTaxRate() * * @return bool */ - public function hasClassCategory1() + public function hasClassCategory1(): bool { return isset($this->ClassCategory1); } @@ -169,7 +169,7 @@ public function hasClassCategory1() * * @return bool */ - public function hasClassCategory2() + public function hasClassCategory2(): bool { return isset($this->ClassCategory2); } @@ -363,9 +363,9 @@ public function __clone() /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -377,7 +377,7 @@ public function getId() * * @return ProductClass */ - public function setCode($code = null) + public function setCode($code = null): ProductClass { $this->code = $code; @@ -389,7 +389,7 @@ public function setCode($code = null) * * @return string|null */ - public function getCode() + public function getCode(): ?string { return $this->code; } @@ -401,7 +401,7 @@ public function getCode() * * @return ProductClass */ - public function setStock($stock = null) + public function setStock($stock = null): ProductClass { $this->stock = $stock; @@ -413,7 +413,7 @@ public function setStock($stock = null) * * @return string|null */ - public function getStock() + public function getStock(): ?string { return $this->stock; } @@ -425,7 +425,7 @@ public function getStock() * * @return ProductClass */ - public function setStockUnlimited($stockUnlimited) + public function setStockUnlimited($stockUnlimited): ProductClass { $this->stock_unlimited = $stockUnlimited; @@ -437,7 +437,7 @@ public function setStockUnlimited($stockUnlimited) * * @return bool */ - public function isStockUnlimited() + public function isStockUnlimited(): bool { return $this->stock_unlimited; } @@ -449,7 +449,7 @@ public function isStockUnlimited() * * @return ProductClass */ - public function setSaleLimit($saleLimit = null) + public function setSaleLimit($saleLimit = null): ProductClass { $this->sale_limit = $saleLimit; @@ -461,7 +461,7 @@ public function setSaleLimit($saleLimit = null) * * @return string|null */ - public function getSaleLimit() + public function getSaleLimit(): ?string { return $this->sale_limit; } @@ -473,7 +473,7 @@ public function getSaleLimit() * * @return ProductClass */ - public function setPrice01($price01 = null) + public function setPrice01($price01 = null): ProductClass { $this->price01 = $price01; @@ -485,7 +485,7 @@ public function setPrice01($price01 = null) * * @return string|null */ - public function getPrice01() + public function getPrice01(): ?string { return $this->price01; } @@ -497,7 +497,7 @@ public function getPrice01() * * @return ProductClass */ - public function setPrice02($price02) + public function setPrice02($price02): ProductClass { $this->price02 = $price02; @@ -507,9 +507,9 @@ public function setPrice02($price02) /** * Get price02. * - * @return string + * @return string|null */ - public function getPrice02() + public function getPrice02(): ?string { return $this->price02; } @@ -521,7 +521,7 @@ public function getPrice02() * * @return ProductClass */ - public function setDeliveryFee($deliveryFee = null) + public function setDeliveryFee($deliveryFee = null): ProductClass { $this->delivery_fee = $deliveryFee; @@ -533,7 +533,7 @@ public function setDeliveryFee($deliveryFee = null) * * @return string|null */ - public function getDeliveryFee() + public function getDeliveryFee(): ?string { return $this->delivery_fee; } @@ -541,7 +541,7 @@ public function getDeliveryFee() /** * @return bool */ - public function isVisible() + public function isVisible(): bool { return $this->visible; } @@ -551,7 +551,7 @@ public function isVisible() * * @return ProductClass */ - public function setVisible($visible) + public function setVisible($visible): ProductClass { $this->visible = $visible; @@ -565,7 +565,7 @@ public function setVisible($visible) * * @return ProductClass */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): ProductClass { $this->create_date = $createDate; @@ -575,9 +575,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -589,7 +589,7 @@ public function getCreateDate() * * @return ProductClass */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): ProductClass { $this->update_date = $updateDate; @@ -599,9 +599,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -611,7 +611,7 @@ public function getUpdateDate() * * @return string */ - public function getCurrencyCode() + public function getCurrencyCode(): string { return $this->currency_code; } @@ -623,7 +623,7 @@ public function getCurrencyCode() * * @return $this */ - public function setCurrencyCode($currencyCode = null) + public function setCurrencyCode($currencyCode = null): static { $this->currency_code = $currencyCode; @@ -637,7 +637,7 @@ public function setCurrencyCode($currencyCode = null) * * @return ProductClass */ - public function setProductStock(?ProductStock $productStock = null) + public function setProductStock(?ProductStock $productStock = null): ProductClass { $this->ProductStock = $productStock; @@ -649,7 +649,7 @@ public function setProductStock(?ProductStock $productStock = null) * * @return ProductStock|null */ - public function getProductStock() + public function getProductStock(): ?ProductStock { return $this->ProductStock; } @@ -661,7 +661,7 @@ public function getProductStock() * * @return ProductClass */ - public function setTaxRule(?TaxRule $taxRule = null) + public function setTaxRule(?TaxRule $taxRule = null): ProductClass { $this->TaxRule = $taxRule; @@ -673,7 +673,7 @@ public function setTaxRule(?TaxRule $taxRule = null) * * @return TaxRule|null */ - public function getTaxRule() + public function getTaxRule(): ?TaxRule { return $this->TaxRule; } @@ -685,7 +685,7 @@ public function getTaxRule() * * @return ProductClass */ - public function setProduct(?Product $product = null) + public function setProduct(?Product $product = null): ProductClass { $this->Product = $product; @@ -697,7 +697,7 @@ public function setProduct(?Product $product = null) * * @return Product|null */ - public function getProduct() + public function getProduct(): ?Product { return $this->Product; } @@ -709,7 +709,7 @@ public function getProduct() * * @return ProductClass */ - public function setSaleType(?Master\SaleType $saleType = null) + public function setSaleType(?Master\SaleType $saleType = null): ProductClass { $this->SaleType = $saleType; @@ -721,7 +721,7 @@ public function setSaleType(?Master\SaleType $saleType = null) * * @return Master\SaleType|null */ - public function getSaleType() + public function getSaleType(): ?Master\SaleType { return $this->SaleType; } @@ -733,7 +733,7 @@ public function getSaleType() * * @return ProductClass */ - public function setClassCategory1(?ClassCategory $classCategory1 = null) + public function setClassCategory1(?ClassCategory $classCategory1 = null): ProductClass { $this->ClassCategory1 = $classCategory1; @@ -745,7 +745,7 @@ public function setClassCategory1(?ClassCategory $classCategory1 = null) * * @return ClassCategory|null */ - public function getClassCategory1() + public function getClassCategory1(): ?ClassCategory { return $this->ClassCategory1; } @@ -757,7 +757,7 @@ public function getClassCategory1() * * @return ProductClass */ - public function setClassCategory2(?ClassCategory $classCategory2 = null) + public function setClassCategory2(?ClassCategory $classCategory2 = null): ProductClass { $this->ClassCategory2 = $classCategory2; @@ -769,7 +769,7 @@ public function setClassCategory2(?ClassCategory $classCategory2 = null) * * @return ClassCategory|null */ - public function getClassCategory2() + public function getClassCategory2(): ?ClassCategory { return $this->ClassCategory2; } @@ -781,7 +781,7 @@ public function getClassCategory2() * * @return ProductClass */ - public function setDeliveryDuration(?DeliveryDuration $deliveryDuration = null) + public function setDeliveryDuration(?DeliveryDuration $deliveryDuration = null): ProductClass { $this->DeliveryDuration = $deliveryDuration; @@ -793,7 +793,7 @@ public function setDeliveryDuration(?DeliveryDuration $deliveryDuration = null) * * @return DeliveryDuration|null */ - public function getDeliveryDuration() + public function getDeliveryDuration(): ?DeliveryDuration { return $this->DeliveryDuration; } @@ -805,7 +805,7 @@ public function getDeliveryDuration() * * @return ProductClass */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): ProductClass { $this->Creator = $creator; @@ -817,7 +817,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } @@ -829,7 +829,7 @@ public function getCreator() * * @return ProductClass */ - public function setPointRate($pointRate) + public function setPointRate($pointRate): ProductClass { $this->point_rate = $pointRate; @@ -839,9 +839,9 @@ public function setPointRate($pointRate) /** * Get pointRate * - * @return string + * @return string|null */ - public function getPointRate() + public function getPointRate(): ?string { return $this->point_rate; } diff --git a/src/Eccube/Entity/ProductImage.php b/src/Eccube/Entity/ProductImage.php index 0e392effb04..c01fe88f86b 100644 --- a/src/Eccube/Entity/ProductImage.php +++ b/src/Eccube/Entity/ProductImage.php @@ -37,7 +37,7 @@ class ProductImage extends AbstractEntity implements \Stringable #[\Override] public function __toString(): string { - return (string) $this->getFileName(); + return $this->getFileName(); } /** @@ -103,7 +103,7 @@ public function __toString(): string * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -115,7 +115,7 @@ public function getId() * * @return ProductImage */ - public function setFileName($fileName) + public function setFileName($fileName): ProductImage { $this->file_name = $fileName; @@ -127,7 +127,7 @@ public function setFileName($fileName) * * @return string */ - public function getFileName() + public function getFileName(): string { return $this->file_name; } @@ -139,7 +139,7 @@ public function getFileName() * * @return ProductImage */ - public function setSortNo($sortNo) + public function setSortNo($sortNo): ProductImage { $this->sort_no = $sortNo; @@ -151,7 +151,7 @@ public function setSortNo($sortNo) * * @return int */ - public function getSortNo() + public function getSortNo(): int { return $this->sort_no; } @@ -163,7 +163,7 @@ public function getSortNo() * * @return ProductImage */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): ProductImage { $this->create_date = $createDate; @@ -173,9 +173,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -187,7 +187,7 @@ public function getCreateDate() * * @return ProductImage */ - public function setProduct(?Product $product = null) + public function setProduct(?Product $product = null): ProductImage { $this->Product = $product; @@ -199,7 +199,7 @@ public function setProduct(?Product $product = null) * * @return Product|null */ - public function getProduct() + public function getProduct(): ?Product { return $this->Product; } @@ -211,7 +211,7 @@ public function getProduct() * * @return ProductImage */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): ProductImage { $this->Creator = $creator; @@ -223,7 +223,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } diff --git a/src/Eccube/Entity/ProductStock.php b/src/Eccube/Entity/ProductStock.php index e3ce1cdebad..229b581baf9 100644 --- a/src/Eccube/Entity/ProductStock.php +++ b/src/Eccube/Entity/ProductStock.php @@ -46,7 +46,7 @@ class ProductStock extends AbstractEntity * * @return ProductStock */ - public function setProductClassId($productClassId) + public function setProductClassId($productClassId): ProductStock { $this->product_class_id = $productClassId; @@ -58,7 +58,7 @@ public function setProductClassId($productClassId) * * @return int|null */ - public function getProductClassId() + public function getProductClassId(): ?int { return $this->product_class_id; } @@ -126,7 +126,7 @@ public function getProductClassId() * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -138,7 +138,7 @@ public function getId() * * @return ProductStock */ - public function setStock($stock = null) + public function setStock($stock = null): ProductStock { $this->stock = $stock; @@ -150,7 +150,7 @@ public function setStock($stock = null) * * @return string|null */ - public function getStock() + public function getStock(): ?string { return $this->stock; } @@ -162,7 +162,7 @@ public function getStock() * * @return ProductStock */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): ProductStock { $this->create_date = $createDate; @@ -172,9 +172,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -186,7 +186,7 @@ public function getCreateDate() * * @return ProductStock */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): ProductStock { $this->update_date = $updateDate; @@ -196,9 +196,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -210,7 +210,7 @@ public function getUpdateDate() * * @return ProductStock */ - public function setProductClass(?ProductClass $productClass = null) + public function setProductClass(?ProductClass $productClass = null): ProductStock { $this->ProductClass = $productClass; @@ -222,7 +222,7 @@ public function setProductClass(?ProductClass $productClass = null) * * @return ProductClass|null */ - public function getProductClass() + public function getProductClass(): ?ProductClass { return $this->ProductClass; } @@ -234,7 +234,7 @@ public function getProductClass() * * @return ProductStock */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): ProductStock { $this->Creator = $creator; @@ -246,7 +246,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } diff --git a/src/Eccube/Entity/ProductTag.php b/src/Eccube/Entity/ProductTag.php index 0ecf6d5b262..2ce4f4628e2 100644 --- a/src/Eccube/Entity/ProductTag.php +++ b/src/Eccube/Entity/ProductTag.php @@ -37,7 +37,7 @@ class ProductTag extends AbstractEntity * * @return int|null */ - public function getTagId() + public function getTagId(): ?int { if (empty($this->Tag)) { return null; @@ -107,7 +107,7 @@ public function getTagId() * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -119,7 +119,7 @@ public function getId() * * @return ProductTag */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): ProductTag { $this->create_date = $createDate; @@ -129,9 +129,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -143,7 +143,7 @@ public function getCreateDate() * * @return ProductTag */ - public function setProduct(?Product $product = null) + public function setProduct(?Product $product = null): ProductTag { $this->Product = $product; @@ -155,7 +155,7 @@ public function setProduct(?Product $product = null) * * @return Product|null */ - public function getProduct() + public function getProduct(): ?Product { return $this->Product; } @@ -167,7 +167,7 @@ public function getProduct() * * @return ProductTag */ - public function setTag(?Tag $tag = null) + public function setTag(?Tag $tag = null): ProductTag { $this->Tag = $tag; @@ -179,7 +179,7 @@ public function setTag(?Tag $tag = null) * * @return Tag|null */ - public function getTag() + public function getTag(): ?Tag { return $this->Tag; } @@ -191,7 +191,7 @@ public function getTag() * * @return ProductTag */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): ProductTag { $this->Creator = $creator; @@ -203,7 +203,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } diff --git a/src/Eccube/Entity/PurchaseInterface.php b/src/Eccube/Entity/PurchaseInterface.php index 6037d33c4d7..001166bac0f 100644 --- a/src/Eccube/Entity/PurchaseInterface.php +++ b/src/Eccube/Entity/PurchaseInterface.php @@ -22,17 +22,17 @@ interface PurchaseInterface * * @return ItemHolderInterface */ - public function setTotal($total); + public function setTotal($total): ItemHolderInterface; /** * 合計金額を返す。 * * @return string */ - public function getTotal(); + public function getTotal(): string; /** * @return \Eccube\Service\PurchaseFlow\ItemCollection */ - public function getItems(); + public function getItems(): \Eccube\Service\PurchaseFlow\ItemCollection; } diff --git a/src/Eccube/Entity/Shipping.php b/src/Eccube/Entity/Shipping.php index 6daefca8fba..8cd6a4cc9a9 100644 --- a/src/Eccube/Entity/Shipping.php +++ b/src/Eccube/Entity/Shipping.php @@ -47,7 +47,7 @@ class Shipping extends AbstractEntity /** * @return string */ - public function getShippingMultipleDefaultName() + public function getShippingMultipleDefaultName(): string { return $this->getName01().' '.$this->getPref()->getName().' '.$this->getAddr01().' '.$this->getAddr02(); } @@ -296,7 +296,7 @@ public function __construct() * * @return Shipping */ - public function setFromCustomerAddress(CustomerAddress $CustomerAddress) + public function setFromCustomerAddress(CustomerAddress $CustomerAddress): Shipping { $this ->setName01($CustomerAddress->getName01()) @@ -318,7 +318,7 @@ public function setFromCustomerAddress(CustomerAddress $CustomerAddress) * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -330,7 +330,7 @@ public function getId() * * @return Shipping */ - public function setName01($name01) + public function setName01($name01): Shipping { $this->name01 = $name01; @@ -342,7 +342,7 @@ public function setName01($name01) * * @return string */ - public function getName01() + public function getName01(): string { return $this->name01; } @@ -354,7 +354,7 @@ public function getName01() * * @return Shipping */ - public function setName02($name02) + public function setName02($name02): Shipping { $this->name02 = $name02; @@ -366,7 +366,7 @@ public function setName02($name02) * * @return string */ - public function getName02() + public function getName02(): string { return $this->name02; } @@ -378,7 +378,7 @@ public function getName02() * * @return Shipping */ - public function setKana01($kana01) + public function setKana01($kana01): Shipping { $this->kana01 = $kana01; @@ -390,7 +390,7 @@ public function setKana01($kana01) * * @return string */ - public function getKana01() + public function getKana01(): string { return $this->kana01; } @@ -402,7 +402,7 @@ public function getKana01() * * @return Shipping */ - public function setKana02($kana02) + public function setKana02($kana02): Shipping { $this->kana02 = $kana02; @@ -414,7 +414,7 @@ public function setKana02($kana02) * * @return string */ - public function getKana02() + public function getKana02(): string { return $this->kana02; } @@ -426,7 +426,7 @@ public function getKana02() * * @return Shipping */ - public function setCompanyName($companyName = null) + public function setCompanyName($companyName = null): Shipping { $this->company_name = $companyName; @@ -438,7 +438,7 @@ public function setCompanyName($companyName = null) * * @return string|null */ - public function getCompanyName() + public function getCompanyName(): ?string { return $this->company_name; } @@ -450,7 +450,7 @@ public function getCompanyName() * * @return Shipping */ - public function setPhoneNumber($phone_number = null) + public function setPhoneNumber($phone_number = null): Shipping { $this->phone_number = $phone_number; @@ -462,7 +462,7 @@ public function setPhoneNumber($phone_number = null) * * @return string|null */ - public function getPhoneNumber() + public function getPhoneNumber(): ?string { return $this->phone_number; } @@ -474,7 +474,7 @@ public function getPhoneNumber() * * @return Shipping */ - public function setPostalCode($postal_code = null) + public function setPostalCode($postal_code = null): Shipping { $this->postal_code = $postal_code; @@ -486,7 +486,7 @@ public function setPostalCode($postal_code = null) * * @return string|null */ - public function getPostalCode() + public function getPostalCode(): ?string { return $this->postal_code; } @@ -498,7 +498,7 @@ public function getPostalCode() * * @return Shipping */ - public function setAddr01($addr01 = null) + public function setAddr01($addr01 = null): Shipping { $this->addr01 = $addr01; @@ -510,7 +510,7 @@ public function setAddr01($addr01 = null) * * @return string|null */ - public function getAddr01() + public function getAddr01(): ?string { return $this->addr01; } @@ -522,7 +522,7 @@ public function getAddr01() * * @return Shipping */ - public function setAddr02($addr02 = null) + public function setAddr02($addr02 = null): Shipping { $this->addr02 = $addr02; @@ -534,7 +534,7 @@ public function setAddr02($addr02 = null) * * @return string|null */ - public function getAddr02() + public function getAddr02(): ?string { return $this->addr02; } @@ -546,7 +546,7 @@ public function getAddr02() * * @return Shipping */ - public function setShippingDeliveryName($shippingDeliveryName = null) + public function setShippingDeliveryName($shippingDeliveryName = null): Shipping { $this->shipping_delivery_name = $shippingDeliveryName; @@ -558,7 +558,7 @@ public function setShippingDeliveryName($shippingDeliveryName = null) * * @return string|null */ - public function getShippingDeliveryName() + public function getShippingDeliveryName(): ?string { return $this->shipping_delivery_name; } @@ -570,7 +570,7 @@ public function getShippingDeliveryName() * * @return Shipping */ - public function setShippingDeliveryTime($shippingDeliveryTime = null) + public function setShippingDeliveryTime($shippingDeliveryTime = null): Shipping { $this->shipping_delivery_time = $shippingDeliveryTime; @@ -582,7 +582,7 @@ public function setShippingDeliveryTime($shippingDeliveryTime = null) * * @return string|null */ - public function getShippingDeliveryTime() + public function getShippingDeliveryTime(): ?string { return $this->shipping_delivery_time; } @@ -594,7 +594,7 @@ public function getShippingDeliveryTime() * * @return Shipping */ - public function setShippingDeliveryDate($shippingDeliveryDate = null) + public function setShippingDeliveryDate($shippingDeliveryDate = null): Shipping { $this->shipping_delivery_date = $shippingDeliveryDate; @@ -606,7 +606,7 @@ public function setShippingDeliveryDate($shippingDeliveryDate = null) * * @return \DateTime|null */ - public function getShippingDeliveryDate() + public function getShippingDeliveryDate(): ?\DateTime { return $this->shipping_delivery_date; } @@ -618,7 +618,7 @@ public function getShippingDeliveryDate() * * @return Shipping */ - public function setShippingDate($shippingDate = null) + public function setShippingDate($shippingDate = null): Shipping { $this->shipping_date = $shippingDate; @@ -630,7 +630,7 @@ public function setShippingDate($shippingDate = null) * * @return \DateTime|null */ - public function getShippingDate() + public function getShippingDate(): ?\DateTime { return $this->shipping_date; } @@ -642,7 +642,7 @@ public function getShippingDate() * * @return Shipping */ - public function setSortNo($sortNo = null) + public function setSortNo($sortNo = null): Shipping { $this->sort_no = $sortNo; @@ -654,7 +654,7 @@ public function setSortNo($sortNo = null) * * @return int|null */ - public function getSortNo() + public function getSortNo(): ?int { return $this->sort_no; } @@ -666,7 +666,7 @@ public function getSortNo() * * @return Shipping */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Shipping { $this->create_date = $createDate; @@ -676,9 +676,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -690,7 +690,7 @@ public function getCreateDate() * * @return Shipping */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Shipping { $this->update_date = $updateDate; @@ -700,9 +700,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -714,7 +714,7 @@ public function getUpdateDate() * * @return Shipping */ - public function setMailSendDate($mailSendDate) + public function setMailSendDate($mailSendDate): Shipping { $this->mail_send_date = $mailSendDate; @@ -724,9 +724,9 @@ public function setMailSendDate($mailSendDate) /** * Get mailSendDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getMailSendDate() + public function getMailSendDate(): ?\DateTime { return $this->mail_send_date; } @@ -738,7 +738,7 @@ public function getMailSendDate() * * @return Shipping */ - public function addOrderItem(OrderItem $OrderItem) + public function addOrderItem(OrderItem $OrderItem): Shipping { $this->OrderItems[] = $OrderItem; @@ -752,7 +752,7 @@ public function addOrderItem(OrderItem $OrderItem) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeOrderItem(OrderItem $OrderItem) + public function removeOrderItem(OrderItem $OrderItem): bool { return $this->OrderItems->removeElement($OrderItem); } @@ -762,7 +762,7 @@ public function removeOrderItem(OrderItem $OrderItem) * * @return ItemCollection */ - public function getOrderItems() + public function getOrderItems(): ItemCollection { return (new ItemCollection($this->OrderItems))->sort(); } @@ -772,7 +772,7 @@ public function getOrderItems() * * @return OrderItem[] */ - public function getProductOrderItems() + public function getProductOrderItems(): array { $sio = new OrderItemCollection($this->OrderItems->toArray()); @@ -786,7 +786,7 @@ public function getProductOrderItems() * * @return Shipping */ - public function setCountry(?Master\Country $country = null) + public function setCountry(?Master\Country $country = null): Shipping { $this->Country = $country; @@ -798,7 +798,7 @@ public function setCountry(?Master\Country $country = null) * * @return Master\Country|null */ - public function getCountry() + public function getCountry(): ?Master\Country { return $this->Country; } @@ -810,7 +810,7 @@ public function getCountry() * * @return Shipping */ - public function setPref(?Master\Pref $pref = null) + public function setPref(?Master\Pref $pref = null): Shipping { $this->Pref = $pref; @@ -822,7 +822,7 @@ public function setPref(?Master\Pref $pref = null) * * @return Master\Pref|null */ - public function getPref() + public function getPref(): ?Master\Pref { return $this->Pref; } @@ -834,7 +834,7 @@ public function getPref() * * @return Shipping */ - public function setDelivery(?Delivery $delivery = null) + public function setDelivery(?Delivery $delivery = null): Shipping { $this->Delivery = $delivery; @@ -846,7 +846,7 @@ public function setDelivery(?Delivery $delivery = null) * * @return Delivery|null */ - public function getDelivery() + public function getDelivery(): ?Delivery { return $this->Delivery; } @@ -856,7 +856,7 @@ public function getDelivery() * * @return ProductClass */ - public function getProductClassOfTemp() + public function getProductClassOfTemp(): ProductClass { return $this->ProductClassOfTemp; } @@ -868,7 +868,7 @@ public function getProductClassOfTemp() * * @return $this */ - public function setProductClassOfTemp(ProductClass $ProductClassOfTemp) + public function setProductClassOfTemp(ProductClass $ProductClassOfTemp): static { $this->ProductClassOfTemp = $ProductClassOfTemp; @@ -882,7 +882,7 @@ public function setProductClassOfTemp(ProductClass $ProductClassOfTemp) * * @return $this */ - public function setOrder(Order $Order) + public function setOrder(Order $Order): static { $this->Order = $Order; @@ -894,7 +894,7 @@ public function setOrder(Order $Order) * * @return Order */ - public function getOrder() + public function getOrder(): Order { return $this->Order; } @@ -906,7 +906,7 @@ public function getOrder() * * @return Shipping */ - public function setTrackingNumber($trackingNumber) + public function setTrackingNumber($trackingNumber): Shipping { $this->tracking_number = $trackingNumber; @@ -916,9 +916,9 @@ public function setTrackingNumber($trackingNumber) /** * Get trackingNumber * - * @return string + * @return string|null */ - public function getTrackingNumber() + public function getTrackingNumber(): ?string { return $this->tracking_number; } @@ -930,7 +930,7 @@ public function getTrackingNumber() * * @return Shipping */ - public function setNote($note = null) + public function setNote($note = null): Shipping { $this->note = $note; @@ -942,7 +942,7 @@ public function setNote($note = null) * * @return string|null */ - public function getNote() + public function getNote(): ?string { return $this->note; } @@ -952,7 +952,7 @@ public function getNote() * * @return bool */ - public function isShipped() + public function isShipped(): bool { return !is_null($this->shipping_date); } @@ -964,7 +964,7 @@ public function isShipped() * * @return Shipping */ - public function setTimeId($timeId) + public function setTimeId($timeId): Shipping { $this->time_id = $timeId; @@ -976,7 +976,7 @@ public function setTimeId($timeId) * * @return int|null */ - public function getTimeId() + public function getTimeId(): ?int { return $this->time_id; } @@ -988,7 +988,7 @@ public function getTimeId() * * @return Shipping */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): Shipping { $this->Creator = $creator; @@ -1000,7 +1000,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } diff --git a/src/Eccube/Entity/Tag.php b/src/Eccube/Entity/Tag.php index 044a8cc33ec..336f763d682 100644 --- a/src/Eccube/Entity/Tag.php +++ b/src/Eccube/Entity/Tag.php @@ -39,7 +39,7 @@ class Tag extends AbstractEntity implements \Stringable #[\Override] public function __toString(): string { - return (string) $this->getName(); + return $this->getName() ?? ''; } /** @@ -89,7 +89,7 @@ public function __construct() * * @return $this */ - public function setId($id) + public function setId($id): static { $this->id = $id; @@ -99,9 +99,9 @@ public function setId($id) /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -113,7 +113,7 @@ public function getId() * * @return $this */ - public function setName($name) + public function setName($name): static { $this->name = $name; @@ -123,9 +123,9 @@ public function setName($name) /** * Get name. * - * @return string + * @return string|null */ - public function getName() + public function getName(): ?string { return $this->name; } @@ -137,7 +137,7 @@ public function getName() * * @return $this */ - public function setSortNo($sort_no) + public function setSortNo($sort_no): static { $this->sort_no = $sort_no; @@ -149,7 +149,7 @@ public function setSortNo($sort_no) * * @return int */ - public function getSortNo() + public function getSortNo(): int { return $this->sort_no; } @@ -161,7 +161,7 @@ public function getSortNo() * * @return Tag */ - public function addProductTag(ProductTag $productTag) + public function addProductTag(ProductTag $productTag): Tag { $this->ProductTag[] = $productTag; @@ -175,7 +175,7 @@ public function addProductTag(ProductTag $productTag) * * @return bool TRUE if this collection contained the specified element, FALSE otherwise. */ - public function removeProductTag(ProductTag $productTag) + public function removeProductTag(ProductTag $productTag): bool { return $this->ProductTag->removeElement($productTag); } @@ -185,7 +185,7 @@ public function removeProductTag(ProductTag $productTag) * * @return \Doctrine\Common\Collections\Collection */ - public function getProductTag() + public function getProductTag(): \Doctrine\Common\Collections\Collection { return $this->ProductTag; } diff --git a/src/Eccube/Entity/TaxRule.php b/src/Eccube/Entity/TaxRule.php index 0c6ea6cb32f..7e22b19ea22 100644 --- a/src/Eccube/Entity/TaxRule.php +++ b/src/Eccube/Entity/TaxRule.php @@ -46,7 +46,7 @@ class TaxRule extends AbstractEntity * * @return bool */ - public function isDefaultTaxRule() + public function isDefaultTaxRule(): bool { return self::DEFAULT_TAX_RULE_ID === $this->getId(); } @@ -58,7 +58,7 @@ public function isDefaultTaxRule() * * @return TaxRule */ - public function setSortNo($sortNo) + public function setSortNo($sortNo): TaxRule { $this->sort_no = $sortNo; @@ -70,7 +70,7 @@ public function setSortNo($sortNo) * * @return int */ - public function getSortNo() + public function getSortNo(): int { return $this->sort_no; } @@ -198,9 +198,9 @@ public function getSortNo() /** * Get id. * - * @return int + * @return int|null */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -212,7 +212,7 @@ public function getId() * * @return TaxRule */ - public function setTaxRate($taxRate) + public function setTaxRate($taxRate): TaxRule { $this->tax_rate = $taxRate; @@ -224,7 +224,7 @@ public function setTaxRate($taxRate) * * @return string */ - public function getTaxRate() + public function getTaxRate(): string { return $this->tax_rate; } @@ -236,7 +236,7 @@ public function getTaxRate() * * @return TaxRule */ - public function setTaxAdjust($taxAdjust) + public function setTaxAdjust($taxAdjust): TaxRule { $this->tax_adjust = $taxAdjust; @@ -248,7 +248,7 @@ public function setTaxAdjust($taxAdjust) * * @return string */ - public function getTaxAdjust() + public function getTaxAdjust(): string { return $this->tax_adjust; } @@ -260,7 +260,7 @@ public function getTaxAdjust() * * @return TaxRule */ - public function setApplyDate($applyDate) + public function setApplyDate($applyDate): TaxRule { $this->apply_date = $applyDate; @@ -270,9 +270,9 @@ public function setApplyDate($applyDate) /** * Get applyDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getApplyDate() + public function getApplyDate(): ?\DateTime { return $this->apply_date; } @@ -284,7 +284,7 @@ public function getApplyDate() * * @return TaxRule */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): TaxRule { $this->create_date = $createDate; @@ -294,9 +294,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -308,7 +308,7 @@ public function getCreateDate() * * @return TaxRule */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): TaxRule { $this->update_date = $updateDate; @@ -318,9 +318,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -332,7 +332,7 @@ public function getUpdateDate() * * @return TaxRule */ - public function setProductClass(?ProductClass $productClass = null) + public function setProductClass(?ProductClass $productClass = null): TaxRule { $this->ProductClass = $productClass; @@ -344,7 +344,7 @@ public function setProductClass(?ProductClass $productClass = null) * * @return ProductClass|null */ - public function getProductClass() + public function getProductClass(): ?ProductClass { return $this->ProductClass; } @@ -356,7 +356,7 @@ public function getProductClass() * * @return TaxRule */ - public function setCreator(?Member $creator = null) + public function setCreator(?Member $creator = null): TaxRule { $this->Creator = $creator; @@ -368,7 +368,7 @@ public function setCreator(?Member $creator = null) * * @return Member|null */ - public function getCreator() + public function getCreator(): ?Member { return $this->Creator; } @@ -380,7 +380,7 @@ public function getCreator() * * @return TaxRule */ - public function setCountry(?Master\Country $country = null) + public function setCountry(?Master\Country $country = null): TaxRule { $this->Country = $country; @@ -392,7 +392,7 @@ public function setCountry(?Master\Country $country = null) * * @return Master\Country|null */ - public function getCountry() + public function getCountry(): ?Master\Country { return $this->Country; } @@ -404,7 +404,7 @@ public function getCountry() * * @return TaxRule */ - public function setPref(?Master\Pref $pref = null) + public function setPref(?Master\Pref $pref = null): TaxRule { $this->Pref = $pref; @@ -416,7 +416,7 @@ public function setPref(?Master\Pref $pref = null) * * @return Master\Pref|null */ - public function getPref() + public function getPref(): ?Master\Pref { return $this->Pref; } @@ -428,7 +428,7 @@ public function getPref() * * @return TaxRule */ - public function setProduct(?Product $product = null) + public function setProduct(?Product $product = null): TaxRule { $this->Product = $product; @@ -440,7 +440,7 @@ public function setProduct(?Product $product = null) * * @return Product|null */ - public function getProduct() + public function getProduct(): ?Product { return $this->Product; } @@ -450,7 +450,7 @@ public function getProduct() * * @return TaxRule */ - public function setRoundingType(?Master\RoundingType $RoundingType = null) + public function setRoundingType(?Master\RoundingType $RoundingType = null): TaxRule { $this->RoundingType = $RoundingType; @@ -462,7 +462,7 @@ public function setRoundingType(?Master\RoundingType $RoundingType = null) * * @return Master\RoundingType|null */ - public function getRoundingType() + public function getRoundingType(): ?Master\RoundingType { return $this->RoundingType; } @@ -486,7 +486,7 @@ public function getRoundingType() * * @return int */ - public function compareTo(TaxRule $Target) + public function compareTo(TaxRule $Target): int { if ($this->isProductTaxRule() && !$Target->isProductTaxRule()) { return -1; @@ -517,7 +517,7 @@ public function compareTo(TaxRule $Target) * * @return bool 商品別税率が適用されている場合 true */ - public function isProductTaxRule() + public function isProductTaxRule(): bool { return $this->getProductClass() !== null || $this->getProduct() !== null; } diff --git a/src/Eccube/Entity/Template.php b/src/Eccube/Entity/Template.php index 6bdfe30b693..5c18f04f753 100644 --- a/src/Eccube/Entity/Template.php +++ b/src/Eccube/Entity/Template.php @@ -39,7 +39,7 @@ class Template extends AbstractEntity implements \Stringable /** * @return bool */ - public function isDefaultTemplate() + public function isDefaultTemplate(): bool { return self::DEFAULT_TEMPLATE_CODE === $this->getCode(); } @@ -50,7 +50,7 @@ public function isDefaultTemplate() #[\Override] public function __toString(): string { - return (string) $this->getName(); + return $this->getName(); } /** @@ -111,7 +111,7 @@ public function __toString(): string * * @return int */ - public function getId() + public function getId(): ?int { return $this->id; } @@ -123,7 +123,7 @@ public function getId() * * @return Template */ - public function setCode($code) + public function setCode($code): Template { $this->code = $code; @@ -135,7 +135,7 @@ public function setCode($code) * * @return string */ - public function getCode() + public function getCode(): string { return $this->code; } @@ -147,7 +147,7 @@ public function getCode() * * @return Template */ - public function setName($name) + public function setName($name): Template { $this->name = $name; @@ -159,7 +159,7 @@ public function setName($name) * * @return string */ - public function getName() + public function getName(): string { return $this->name; } @@ -171,7 +171,7 @@ public function getName() * * @return Template */ - public function setCreateDate($createDate) + public function setCreateDate($createDate): Template { $this->create_date = $createDate; @@ -181,9 +181,9 @@ public function setCreateDate($createDate) /** * Get createDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getCreateDate() + public function getCreateDate(): ?\DateTime { return $this->create_date; } @@ -195,7 +195,7 @@ public function getCreateDate() * * @return Template */ - public function setUpdateDate($updateDate) + public function setUpdateDate($updateDate): Template { $this->update_date = $updateDate; @@ -205,9 +205,9 @@ public function setUpdateDate($updateDate) /** * Get updateDate. * - * @return \DateTime + * @return \DateTime|null */ - public function getUpdateDate() + public function getUpdateDate(): ?\DateTime { return $this->update_date; } @@ -219,7 +219,7 @@ public function getUpdateDate() * * @return Template */ - public function setDeviceType(?Master\DeviceType $deviceType = null) + public function setDeviceType(?Master\DeviceType $deviceType = null): Template { $this->DeviceType = $deviceType; @@ -231,7 +231,7 @@ public function setDeviceType(?Master\DeviceType $deviceType = null) * * @return Master\DeviceType|null */ - public function getDeviceType() + public function getDeviceType(): ?Master\DeviceType { return $this->DeviceType; } diff --git a/src/Eccube/Entity/TradeLaw.php b/src/Eccube/Entity/TradeLaw.php index 090d9aed4cc..884b334386f 100644 --- a/src/Eccube/Entity/TradeLaw.php +++ b/src/Eccube/Entity/TradeLaw.php @@ -76,7 +76,7 @@ class TradeLaw extends AbstractEntity implements \Stringable #[\Override] public function __toString(): string { - return (string) $this->getName(); + return $this->getName() ?? ''; } /** @@ -94,7 +94,7 @@ public function setId(int $id): TradeLaw /** * @return int */ - public function getId(): int + public function getId(): ?int { return $this->id; } @@ -112,7 +112,7 @@ public function setName(?string $name): TradeLaw } /** - * @return string + * @return string|null */ public function getName(): ?string { @@ -132,7 +132,7 @@ public function setDescription(?string $description): TradeLaw } /** - * @return string + * @return string|null */ public function getDescription(): ?string { diff --git a/src/Eccube/Event/EventArgs.php b/src/Eccube/Event/EventArgs.php index 6bd387c9312..104b04108ba 100644 --- a/src/Eccube/Event/EventArgs.php +++ b/src/Eccube/Event/EventArgs.php @@ -45,15 +45,15 @@ public function __construct(array $arguments = [], ?Request $request = null) * * @return void */ - public function setRequest(Request $request) + public function setRequest(Request $request): void { $this->request = $request; } /** - * @return Request + * @return Request|null */ - public function getRequest() + public function getRequest(): ?Request { return $this->request; } @@ -63,7 +63,7 @@ public function getRequest() * * @return void */ - public function setResponse(Response $response) + public function setResponse(Response $response): void { $this->response = $response; } @@ -71,7 +71,7 @@ public function setResponse(Response $response) /** * @return Response|null */ - public function getResponse() + public function getResponse(): ?Response { return $this->response; } @@ -79,7 +79,7 @@ public function getResponse() /** * @return bool */ - public function hasResponse() + public function hasResponse(): bool { return $this->response instanceof Response; } diff --git a/src/Eccube/Event/TemplateEvent.php b/src/Eccube/Event/TemplateEvent.php index 5aabfc8ca00..0b190eb5d45 100644 --- a/src/Eccube/Event/TemplateEvent.php +++ b/src/Eccube/Event/TemplateEvent.php @@ -68,9 +68,9 @@ public function __construct($view, $source, array $parameters = [], ?Response $r } /** - * @return string + * @return string|null */ - public function getView() + public function getView(): ?string { return $this->view; } @@ -80,15 +80,15 @@ public function getView() * * @return void */ - public function setView($view) + public function setView($view): void { $this->view = $view; } /** - * @return string + * @return string|null */ - public function getSource() + public function getSource(): ?string { return $this->source; } @@ -98,7 +98,7 @@ public function getSource() * * @return void */ - public function setSource($source) + public function setSource($source): void { $this->source = $source; } @@ -108,7 +108,7 @@ public function setSource($source) * * @return mixed */ - public function getParameter($key) + public function getParameter($key): mixed { return $this->parameters[$key]; } @@ -119,7 +119,7 @@ public function getParameter($key) * * @return void */ - public function setParameter($key, $value) + public function setParameter($key, $value): void { $this->parameters[$key] = $value; } @@ -129,7 +129,7 @@ public function setParameter($key, $value) * * @return bool */ - public function hasParameter($key) + public function hasParameter($key): bool { return isset($this->parameters[$key]); } @@ -137,7 +137,7 @@ public function hasParameter($key) /** * @return array */ - public function getParameters() + public function getParameters(): array { return $this->parameters; } @@ -147,7 +147,7 @@ public function getParameters() * * @return void */ - public function setParameters($parameters) + public function setParameters($parameters): void { $this->parameters = $parameters; } @@ -155,7 +155,7 @@ public function setParameters($parameters) /** * @return Response|null */ - public function getResponse() + public function getResponse(): ?Response { return $this->response; } @@ -165,7 +165,7 @@ public function getResponse() * * @return void */ - public function setResponse($response) + public function setResponse($response): void { $this->response = $response; } @@ -181,7 +181,7 @@ public function setResponse($response) * * @return $this */ - public function addAsset($asset, $include = true) + public function addAsset($asset, $include = true): static { $this->assets[$asset] = $include; @@ -200,7 +200,7 @@ public function addAsset($asset, $include = true) * * @return $this */ - public function addSnippet($snippet, $include = true) + public function addSnippet($snippet, $include = true): static { $this->snippets[$snippet] = $include; diff --git a/src/Eccube/EventListener/ExceptionListener.php b/src/Eccube/EventListener/ExceptionListener.php index 5513dca19ac..50563aaaa47 100644 --- a/src/Eccube/EventListener/ExceptionListener.php +++ b/src/Eccube/EventListener/ExceptionListener.php @@ -46,7 +46,7 @@ public function __construct(\Twig\Environment $twig, Context $requestContext) * * @return void */ - public function onKernelException(ExceptionEvent $event) + public function onKernelException(ExceptionEvent $event): void { $title = trans('exception.error_title'); $message = trans('exception.error_message'); @@ -132,7 +132,7 @@ public function onKernelException(ExceptionEvent $event) * @return array> The event names to listen to */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ KernelEvents::EXCEPTION => ['onKernelException'], diff --git a/src/Eccube/EventListener/ForwardOnlyListener.php b/src/Eccube/EventListener/ForwardOnlyListener.php index 153fb517ecb..9b59e51ba58 100644 --- a/src/Eccube/EventListener/ForwardOnlyListener.php +++ b/src/Eccube/EventListener/ForwardOnlyListener.php @@ -36,7 +36,7 @@ class ForwardOnlyListener implements EventSubscriberInterface * @throws \ReflectionException * @throws AccessDeniedHttpException */ - public function onController(ControllerEvent $event) + public function onController(ControllerEvent $event): void { if (!$event->isMainRequest()) { return; @@ -69,7 +69,7 @@ public function onController(ControllerEvent $event) * @return array */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ KernelEvents::CONTROLLER => 'onController', diff --git a/src/Eccube/EventListener/IpAddrListener.php b/src/Eccube/EventListener/IpAddrListener.php index ab38d1523a0..a1a83b568a5 100644 --- a/src/Eccube/EventListener/IpAddrListener.php +++ b/src/Eccube/EventListener/IpAddrListener.php @@ -45,7 +45,7 @@ public function __construct(EccubeConfig $eccubeConfig, Context $requestContext) * * @throws AccessDeniedHttpException|\Exception */ - public function onKernelRequest(RequestEvent $event) + public function onKernelRequest(RequestEvent $event): void { if (!$event->isMainRequest()) { return; @@ -89,7 +89,7 @@ public function onKernelRequest(RequestEvent $event) * * @return bool */ - private function isClientIpInList($hostList, $clientIp) + private function isClientIpInList($hostList, $clientIp): bool { log_debug('Host List: '.implode(',', $hostList)); if ($hostList) { @@ -107,7 +107,7 @@ private function isClientIpInList($hostList, $clientIp) * @return array> */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ 'kernel.request' => ['onKernelRequest', 512], diff --git a/src/Eccube/EventListener/LogListener.php b/src/Eccube/EventListener/LogListener.php index 59ff64c6e50..82854681550 100644 --- a/src/Eccube/EventListener/LogListener.php +++ b/src/Eccube/EventListener/LogListener.php @@ -42,7 +42,7 @@ public function __construct(LoggerInterface $logger) * {@inheritdoc} */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ KernelEvents::REQUEST => [ @@ -67,7 +67,7 @@ public static function getSubscribedEvents() * * @return void */ - public function onKernelRequestEarly(RequestEvent $event) + public function onKernelRequestEarly(RequestEvent $event): void { if (!$event->isMainRequest()) { return; @@ -81,7 +81,7 @@ public function onKernelRequestEarly(RequestEvent $event) * * @return void */ - public function onKernelRequest(RequestEvent $event) + public function onKernelRequest(RequestEvent $event): void { if (!$event->isMainRequest()) { return; @@ -96,9 +96,9 @@ public function onKernelRequest(RequestEvent $event) * * @param \Symfony\Component\HttpFoundation\Request $request * - * @return string + * @return string|null */ - private function getRoute($request) + private function getRoute($request): ?string { return $request->attributes->get('_route'); } @@ -108,7 +108,7 @@ private function getRoute($request) * * @return void */ - public function onKernelController(ControllerEvent $event) + public function onKernelController(ControllerEvent $event): void { if (!$event->isMainRequest()) { return; @@ -123,7 +123,7 @@ public function onKernelController(ControllerEvent $event) * * @return void */ - public function onKernelResponse(ResponseEvent $event) + public function onKernelResponse(ResponseEvent $event): void { if (!$event->isMainRequest()) { return; @@ -138,7 +138,7 @@ public function onKernelResponse(ResponseEvent $event) * * @return void */ - public function onKernelTerminate(TerminateEvent $event) + public function onKernelTerminate(TerminateEvent $event): void { $route = $this->getRoute($event->getRequest()); $this->logger->debug('PROCESS END', [$route]); @@ -149,7 +149,7 @@ public function onKernelTerminate(TerminateEvent $event) * * @return void */ - public function onKernelException(ExceptionEvent $event) + public function onKernelException(ExceptionEvent $event): void { $e = $event->getThrowable(); if ($e instanceof HttpExceptionInterface && $e->getStatusCode() < 500) { diff --git a/src/Eccube/EventListener/LoginHistoryListener.php b/src/Eccube/EventListener/LoginHistoryListener.php index 833627bebef..39daa475ba0 100644 --- a/src/Eccube/EventListener/LoginHistoryListener.php +++ b/src/Eccube/EventListener/LoginHistoryListener.php @@ -71,7 +71,7 @@ public function __construct( * @return array */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ SecurityEvents::INTERACTIVE_LOGIN => 'onInteractiveLogin', @@ -84,7 +84,7 @@ public static function getSubscribedEvents() * * @return void */ - public function onInteractiveLogin(InteractiveLoginEvent $event) + public function onInteractiveLogin(InteractiveLoginEvent $event): void { $request = $event->getRequest(); $user = $event @@ -114,7 +114,7 @@ public function onInteractiveLogin(InteractiveLoginEvent $event) * * @return void */ - public function onAuthenticationFailure(LoginFailureEvent $event) + public function onAuthenticationFailure(LoginFailureEvent $event): void { $request = $this->requestStack->getCurrentRequest(); diff --git a/src/Eccube/EventListener/MaintenanceListener.php b/src/Eccube/EventListener/MaintenanceListener.php index d1fbc02e5dd..cdc677d9d5e 100644 --- a/src/Eccube/EventListener/MaintenanceListener.php +++ b/src/Eccube/EventListener/MaintenanceListener.php @@ -36,7 +36,7 @@ public function __construct(Context $requestContext, SystemService $systemServic } #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ KernelEvents::RESPONSE => ['onResponse'], @@ -48,7 +48,7 @@ public static function getSubscribedEvents() * * @return void */ - public function onResponse(ResponseEvent $event) + public function onResponse(ResponseEvent $event): void { $response = $event->getResponse(); diff --git a/src/Eccube/EventListener/MobileTemplatePathListener.php b/src/Eccube/EventListener/MobileTemplatePathListener.php index 735c574ee45..79f0e6de700 100644 --- a/src/Eccube/EventListener/MobileTemplatePathListener.php +++ b/src/Eccube/EventListener/MobileTemplatePathListener.php @@ -55,7 +55,7 @@ public function __construct(Context $context, Environment $twig, MobileDetect $d * * @return void */ - public function onKernelRequest(RequestEvent $event) + public function onKernelRequest(RequestEvent $event): void { if (!$event->isMainRequest()) { return; @@ -92,7 +92,7 @@ public function onKernelRequest(RequestEvent $event) * @return array> */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ 'kernel.request' => ['onKernelRequest', 512], diff --git a/src/Eccube/EventListener/RateLimiterListener.php b/src/Eccube/EventListener/RateLimiterListener.php index 49504843cb2..51c17ee4c59 100644 --- a/src/Eccube/EventListener/RateLimiterListener.php +++ b/src/Eccube/EventListener/RateLimiterListener.php @@ -46,7 +46,7 @@ public function __construct(ContainerInterface $locator, EccubeConfig $eccubeCon * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ - public function onController(ControllerEvent $event) + public function onController(ControllerEvent $event): void { if (!$event->isMainRequest()) { return; @@ -108,7 +108,7 @@ public function onController(ControllerEvent $event) * {@inheritdoc} */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ KernelEvents::CONTROLLER => ['onController', 0], diff --git a/src/Eccube/EventListener/RestrictFileUploadListener.php b/src/Eccube/EventListener/RestrictFileUploadListener.php index 0d53bd91bcb..8231f03d26a 100644 --- a/src/Eccube/EventListener/RestrictFileUploadListener.php +++ b/src/Eccube/EventListener/RestrictFileUploadListener.php @@ -42,7 +42,7 @@ public function __construct(EccubeConfig $eccubeConfig, Context $requestContext) * * @return void */ - public function onKernelRequest(RequestEvent $event) + public function onKernelRequest(RequestEvent $event): void { if (!$event->isMainRequest()) { return; @@ -60,7 +60,7 @@ public function onKernelRequest(RequestEvent $event) } #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ 'kernel.request' => ['onKernelRequest', 7], // RouterListener より必ず後で実行する diff --git a/src/Eccube/EventListener/SecurityListener.php b/src/Eccube/EventListener/SecurityListener.php index 78d3cc57998..eca9821cc30 100644 --- a/src/Eccube/EventListener/SecurityListener.php +++ b/src/Eccube/EventListener/SecurityListener.php @@ -64,7 +64,7 @@ public function __construct( * * @return void */ - public function onInteractiveLogin(InteractiveLoginEvent $event) + public function onInteractiveLogin(InteractiveLoginEvent $event): void { $user = $event ->getAuthenticationToken() @@ -92,7 +92,7 @@ public function onInteractiveLogin(InteractiveLoginEvent $event) * * @return void */ - public function onAuthenticationFailure(LoginFailureEvent $event) + public function onAuthenticationFailure(LoginFailureEvent $event): void { $request = $this->requestStack->getCurrentRequest(); $request->getSession()->set('_security.login_memory', (bool) $request->request->get('login_memory', 0)); @@ -117,7 +117,7 @@ public function onAuthenticationFailure(LoginFailureEvent $event) * @return array The event names to listen to */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ SecurityEvents::INTERACTIVE_LOGIN => 'onInteractiveLogin', diff --git a/src/Eccube/EventListener/TransactionListener.php b/src/Eccube/EventListener/TransactionListener.php index 30a7a7f745f..675d6b5736f 100644 --- a/src/Eccube/EventListener/TransactionListener.php +++ b/src/Eccube/EventListener/TransactionListener.php @@ -55,7 +55,7 @@ public function __construct(EntityManagerInterface $em, $isEnabled = true) * * @return void */ - public function disable() + public function disable(): void { $this->isEnabled = false; } @@ -67,7 +67,7 @@ public function disable() * * @return void */ - public function onKernelRequest(RequestEvent $event) + public function onKernelRequest(RequestEvent $event): void { if (!$this->isEnabled) { log_debug('Transaction Listener is disabled.'); @@ -97,7 +97,7 @@ public function onKernelRequest(RequestEvent $event) * * @return void */ - public function onKernelException(ExceptionEvent $event) + public function onKernelException(ExceptionEvent $event): void { if (!$this->isEnabled) { log_debug('Transaction Listener is disabled.'); @@ -128,7 +128,7 @@ public function onKernelException(ExceptionEvent $event) * * @return void */ - public function onKernelTerminate(TerminateEvent $event) + public function onKernelTerminate(TerminateEvent $event): void { if (!$this->isEnabled) { log_debug('Transaction Listener is disabled.'); @@ -158,7 +158,7 @@ public function onKernelTerminate(TerminateEvent $event) * @return array */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ KernelEvents::REQUEST => 'onKernelRequest', diff --git a/src/Eccube/EventListener/TwigInitializeListener.php b/src/Eccube/EventListener/TwigInitializeListener.php index bac9ec0476e..4f490277917 100644 --- a/src/Eccube/EventListener/TwigInitializeListener.php +++ b/src/Eccube/EventListener/TwigInitializeListener.php @@ -150,7 +150,7 @@ public function __construct( * @throws NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - public function onKernelRequest(RequestEvent $event) + public function onKernelRequest(RequestEvent $event): void { if ($this->initialized) { return; @@ -174,7 +174,7 @@ public function onKernelRequest(RequestEvent $event) * * @throws \Doctrine\ORM\NonUniqueResultException */ - public function setFrontVariables(RequestEvent $event) + public function setFrontVariables(RequestEvent $event): void { $request = $event->getRequest(); /** @var \Symfony\Component\HttpFoundation\ParameterBag $attributes */ @@ -251,7 +251,7 @@ public function setFrontVariables(RequestEvent $event) * * @return void */ - public function setAdminGlobals(RequestEvent $event) + public function setAdminGlobals(RequestEvent $event): void { // メニュー表示用配列. $menus = []; @@ -280,7 +280,7 @@ public function setAdminGlobals(RequestEvent $event) * * @return array> */ - private function getDisplayEccubeNav($parentNav, $AuthorityRoles, $baseUrl) + private function getDisplayEccubeNav($parentNav, $AuthorityRoles, $baseUrl): array { $restrictUrls = $this->eccubeConfig['eccube_restrict_file_upload_urls']; @@ -319,7 +319,7 @@ private function getDisplayEccubeNav($parentNav, $AuthorityRoles, $baseUrl) * {@inheritdoc} */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ KernelEvents::REQUEST => [ diff --git a/src/Eccube/EventListener/TwoFactorAuthListener.php b/src/Eccube/EventListener/TwoFactorAuthListener.php index b2cdbdcadd8..1afc596ffac 100644 --- a/src/Eccube/EventListener/TwoFactorAuthListener.php +++ b/src/Eccube/EventListener/TwoFactorAuthListener.php @@ -73,7 +73,7 @@ public function __construct( * * @return void */ - public function onKernelController(ControllerArgumentsEvent $event) + public function onKernelController(ControllerArgumentsEvent $event): void { if (!$event->isMainRequest()) { return; @@ -117,7 +117,7 @@ public function onKernelController(ControllerArgumentsEvent $event) * @return array> */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ KernelEvents::CONTROLLER_ARGUMENTS => ['onKernelController', 7], diff --git a/src/Eccube/Exception/PluginApiException.php b/src/Eccube/Exception/PluginApiException.php index e65f5520ebd..01bccd810b7 100644 --- a/src/Eccube/Exception/PluginApiException.php +++ b/src/Eccube/Exception/PluginApiException.php @@ -36,7 +36,7 @@ public function __construct($curlInfo) * * @return string */ - private static function getResponseErrorMessage($info) + private static function getResponseErrorMessage($info): string { if (!empty($info)) { $messageId = 'admin.store.package.api.'.$info['http_code'].'.error'; @@ -56,7 +56,7 @@ private static function getResponseErrorMessage($info) /** * @return array|null> */ - public function __debugInfo() + public function __debugInfo(): array { return [ 'curlInfo' => $this->curlInfo, diff --git a/src/Eccube/Form/DataTransformer/EntityToIdTransformer.php b/src/Eccube/Form/DataTransformer/EntityToIdTransformer.php index 935281e6860..7294d0ab937 100644 --- a/src/Eccube/Form/DataTransformer/EntityToIdTransformer.php +++ b/src/Eccube/Form/DataTransformer/EntityToIdTransformer.php @@ -50,7 +50,7 @@ public function __construct(ObjectManager $om, $className) * @return string|int|null */ #[\Override] - public function transform($entity) + public function transform($entity): string|int|null { if (null === $entity) { return ''; @@ -65,7 +65,7 @@ public function transform($entity) * @return T|null */ #[\Override] - public function reverseTransform($id) + public function reverseTransform($id): ?object { if ('' === $id || null === $id) { return null; diff --git a/src/Eccube/Form/EventListener/ConvertKanaListener.php b/src/Eccube/Form/EventListener/ConvertKanaListener.php index 54feadae322..b19450220d0 100644 --- a/src/Eccube/Form/EventListener/ConvertKanaListener.php +++ b/src/Eccube/Form/EventListener/ConvertKanaListener.php @@ -40,7 +40,7 @@ public function __construct($option = 'a', $encoding = 'utf-8') } #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ FormEvents::PRE_SUBMIT => 'onPreSubmit', @@ -52,7 +52,7 @@ public static function getSubscribedEvents() * * @return void */ - public function onPreSubmit(FormEvent $event) + public function onPreSubmit(FormEvent $event): void { $data = $event->getData(); diff --git a/src/Eccube/Form/EventListener/TruncateHyphenListener.php b/src/Eccube/Form/EventListener/TruncateHyphenListener.php index 27f75755d06..84f71ade9a5 100644 --- a/src/Eccube/Form/EventListener/TruncateHyphenListener.php +++ b/src/Eccube/Form/EventListener/TruncateHyphenListener.php @@ -23,7 +23,7 @@ class TruncateHyphenListener implements EventSubscriberInterface * @return array */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ FormEvents::PRE_SUBMIT => 'onPreSubmit', @@ -35,7 +35,7 @@ public static function getSubscribedEvents() * * @return void */ - public function onPreSubmit(FormEvent $event) + public function onPreSubmit(FormEvent $event): void { $data = $event->getData(); if (is_string($data)) { diff --git a/src/Eccube/Form/Extension/DoctrineOrmExtension.php b/src/Eccube/Form/Extension/DoctrineOrmExtension.php index b61c4094167..54d444cb256 100644 --- a/src/Eccube/Form/Extension/DoctrineOrmExtension.php +++ b/src/Eccube/Form/Extension/DoctrineOrmExtension.php @@ -56,7 +56,7 @@ public function __construct(EntityManagerInterface $em, Reader $reader) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->addEventListener( FormEvents::PRE_SET_DATA, @@ -104,7 +104,7 @@ function (FormEvent $event) { * @return void */ #[\Override] - public function buildView(FormView $view, FormInterface $form, array $options) + public function buildView(FormView $view, FormInterface $form, array $options): void { $options = $form->getConfig()->getOption('eccube_form_options'); @@ -129,7 +129,7 @@ public function buildView(FormView $view, FormInterface $form, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefault( 'eccube_form_options', diff --git a/src/Eccube/Form/Extension/HTMLPurifierTextTypeExtension.php b/src/Eccube/Form/Extension/HTMLPurifierTextTypeExtension.php index 0b23d9449c8..89268d339bc 100644 --- a/src/Eccube/Form/Extension/HTMLPurifierTextTypeExtension.php +++ b/src/Eccube/Form/Extension/HTMLPurifierTextTypeExtension.php @@ -38,7 +38,7 @@ public function __construct(Context $context) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { if ($this->context->isFront()) { $resolver->setDefault('purify_html', true); @@ -69,7 +69,7 @@ public static function getExtendedTypes(): iterable * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { if ($this->context->isFront() && $options['purify_html']) { $builder->addEventSubscriber( diff --git a/src/Eccube/Form/Extension/HelpTypeExtension.php b/src/Eccube/Form/Extension/HelpTypeExtension.php index 4273cc7d0b1..01a518efb29 100644 --- a/src/Eccube/Form/Extension/HelpTypeExtension.php +++ b/src/Eccube/Form/Extension/HelpTypeExtension.php @@ -35,7 +35,7 @@ class HelpTypeExtension extends AbstractTypeExtension * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->setAttribute('help', $options['help']); } @@ -50,7 +50,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function buildView(FormView $view, FormInterface $form, array $options) + public function buildView(FormView $view, FormInterface $form, array $options): void { $view->vars['help'] = $form->getConfig()->getAttribute('help'); } @@ -63,7 +63,7 @@ public function buildView(FormView $view, FormInterface $form, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'help' => null, @@ -73,7 +73,7 @@ public function configureOptions(OptionsResolver $resolver) /** * @return string */ - public function getExtendedType() + public function getExtendedType(): string { return FormType::class; } diff --git a/src/Eccube/Form/Type/AddCartType.php b/src/Eccube/Form/Type/AddCartType.php index b78658bfb60..ab9be5d1e00 100644 --- a/src/Eccube/Form/Type/AddCartType.php +++ b/src/Eccube/Form/Type/AddCartType.php @@ -73,7 +73,7 @@ public function __construct(ManagerRegistry $doctrine, EccubeConfig $config) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { /** @var \Eccube\Entity\Product $Product */ $Product = $options['product']; @@ -169,7 +169,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setRequired('product'); $resolver->setDefaults([ @@ -190,7 +190,7 @@ public function configureOptions(OptionsResolver $resolver) * @return void */ #[\Override] - public function finishView(FormView $view, FormInterface $form, array $options) + public function finishView(FormView $view, FormInterface $form, array $options): void { if ($options['id_add_product_id']) { foreach ($view->vars['form']->children as $child) { @@ -203,7 +203,7 @@ public function finishView(FormView $view, FormInterface $form, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'add_cart'; } diff --git a/src/Eccube/Form/Type/AddressType.php b/src/Eccube/Form/Type/AddressType.php index 0d77e758c94..8e6783afefa 100644 --- a/src/Eccube/Form/Type/AddressType.php +++ b/src/Eccube/Form/Type/AddressType.php @@ -51,7 +51,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $options['pref_options']['required'] = $options['required']; $options['addr01_options']['required'] = $options['required']; @@ -97,7 +97,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function buildView(FormView $view, FormInterface $form, array $options) + public function buildView(FormView $view, FormInterface $form, array $options): void { $builder = $form->getConfig(); $view->vars['pref_name'] = $builder->getAttribute('pref_name'); @@ -113,7 +113,7 @@ public function buildView(FormView $view, FormInterface $form, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'options' => [], @@ -146,7 +146,7 @@ public function configureOptions(OptionsResolver $resolver) } #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'address'; } diff --git a/src/Eccube/Form/Type/Admin/AuthenticationType.php b/src/Eccube/Form/Type/Admin/AuthenticationType.php index 04e78705280..1624aa9d68f 100644 --- a/src/Eccube/Form/Type/Admin/AuthenticationType.php +++ b/src/Eccube/Form/Type/Admin/AuthenticationType.php @@ -47,7 +47,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->add( 'authentication_key', TextType::class, @@ -78,7 +78,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => BaseInfo::class, @@ -89,7 +89,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_authentication'; } diff --git a/src/Eccube/Form/Type/Admin/AuthorityRoleType.php b/src/Eccube/Form/Type/Admin/AuthorityRoleType.php index 30335abb481..a156d7a7820 100644 --- a/src/Eccube/Form/Type/Admin/AuthorityRoleType.php +++ b/src/Eccube/Form/Type/Admin/AuthorityRoleType.php @@ -38,7 +38,7 @@ public function __construct() * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('Authority', EntityType::class, [ @@ -80,7 +80,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => \Eccube\Entity\AuthorityRole::class, @@ -91,7 +91,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_authority_role'; } diff --git a/src/Eccube/Form/Type/Admin/BlockType.php b/src/Eccube/Form/Type/Admin/BlockType.php index 6b9e2e8d00a..3d6170792ae 100644 --- a/src/Eccube/Form/Type/Admin/BlockType.php +++ b/src/Eccube/Form/Type/Admin/BlockType.php @@ -61,7 +61,7 @@ public function __construct(EntityManagerInterface $entityManager, EccubeConfig * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', TextType::class, [ @@ -137,7 +137,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => Block::class, @@ -148,7 +148,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'block'; } diff --git a/src/Eccube/Form/Type/Admin/CalendarType.php b/src/Eccube/Form/Type/Admin/CalendarType.php index 883bb4ed32b..0a3739bc77c 100644 --- a/src/Eccube/Form/Type/Admin/CalendarType.php +++ b/src/Eccube/Form/Type/Admin/CalendarType.php @@ -66,7 +66,7 @@ public function __construct(EccubeConfig $eccubeConfig, ValidatorInterface $vali * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('title', TextType::class, [ @@ -144,7 +144,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => Calendar::class, @@ -155,7 +155,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'calendar'; } diff --git a/src/Eccube/Form/Type/Admin/CategoryType.php b/src/Eccube/Form/Type/Admin/CategoryType.php index a2d3b713fdf..a90c1f19b62 100644 --- a/src/Eccube/Form/Type/Admin/CategoryType.php +++ b/src/Eccube/Form/Type/Admin/CategoryType.php @@ -46,7 +46,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', TextType::class, [ @@ -68,7 +68,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => \Eccube\Entity\Category::class, @@ -79,7 +79,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_category'; } diff --git a/src/Eccube/Form/Type/Admin/ChangePasswordType.php b/src/Eccube/Form/Type/Admin/ChangePasswordType.php index 61f88c044af..fce64ddd6d0 100644 --- a/src/Eccube/Form/Type/Admin/ChangePasswordType.php +++ b/src/Eccube/Form/Type/Admin/ChangePasswordType.php @@ -48,7 +48,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('current_password', PasswordType::class, [ @@ -88,7 +88,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { } @@ -96,7 +96,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_change_password'; } diff --git a/src/Eccube/Form/Type/Admin/ClassCategoryType.php b/src/Eccube/Form/Type/Admin/ClassCategoryType.php index ad4db822b2e..83eefcadf1c 100644 --- a/src/Eccube/Form/Type/Admin/ClassCategoryType.php +++ b/src/Eccube/Form/Type/Admin/ClassCategoryType.php @@ -42,7 +42,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', TextType::class, [ @@ -79,7 +79,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => \Eccube\Entity\ClassCategory::class, @@ -90,7 +90,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_class_category'; } diff --git a/src/Eccube/Form/Type/Admin/ClassNameType.php b/src/Eccube/Form/Type/Admin/ClassNameType.php index 467d49f60b5..0bf4da2151b 100644 --- a/src/Eccube/Form/Type/Admin/ClassNameType.php +++ b/src/Eccube/Form/Type/Admin/ClassNameType.php @@ -48,7 +48,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', TextType::class, [ @@ -78,7 +78,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => \Eccube\Entity\ClassName::class, @@ -89,7 +89,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_class_name'; } diff --git a/src/Eccube/Form/Type/Admin/CsvImportType.php b/src/Eccube/Form/Type/Admin/CsvImportType.php index d6deb8aea41..17c9885caa7 100644 --- a/src/Eccube/Form/Type/Admin/CsvImportType.php +++ b/src/Eccube/Form/Type/Admin/CsvImportType.php @@ -47,7 +47,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('import_file', FileType::class, [ @@ -77,7 +77,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_csv_import'; } diff --git a/src/Eccube/Form/Type/Admin/CustomerType.php b/src/Eccube/Form/Type/Admin/CustomerType.php index 012365ece5c..c0fc30feec5 100644 --- a/src/Eccube/Form/Type/Admin/CustomerType.php +++ b/src/Eccube/Form/Type/Admin/CustomerType.php @@ -64,7 +64,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', NameType::class, [ @@ -182,7 +182,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => Customer::class, @@ -193,7 +193,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_customer'; } diff --git a/src/Eccube/Form/Type/Admin/DeliveryFeeType.php b/src/Eccube/Form/Type/Admin/DeliveryFeeType.php index 10b390cf194..0da292f69df 100644 --- a/src/Eccube/Form/Type/Admin/DeliveryFeeType.php +++ b/src/Eccube/Form/Type/Admin/DeliveryFeeType.php @@ -29,7 +29,7 @@ class DeliveryFeeType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('fee', PriceType::class, [ @@ -46,7 +46,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => \Eccube\Entity\DeliveryFee::class, @@ -57,7 +57,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'delivery_fee'; } diff --git a/src/Eccube/Form/Type/Admin/DeliveryTimeType.php b/src/Eccube/Form/Type/Admin/DeliveryTimeType.php index 149586a96c2..8965d55f45f 100644 --- a/src/Eccube/Form/Type/Admin/DeliveryTimeType.php +++ b/src/Eccube/Form/Type/Admin/DeliveryTimeType.php @@ -36,7 +36,7 @@ class DeliveryTimeType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('delivery_time', TextType::class, [ @@ -76,7 +76,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => DeliveryTime::class, @@ -92,7 +92,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'delivery_time'; } diff --git a/src/Eccube/Form/Type/Admin/DeliveryType.php b/src/Eccube/Form/Type/Admin/DeliveryType.php index 2d7570047a8..85ad8067405 100644 --- a/src/Eccube/Form/Type/Admin/DeliveryType.php +++ b/src/Eccube/Form/Type/Admin/DeliveryType.php @@ -47,7 +47,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', TextType::class, [ @@ -126,7 +126,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => \Eccube\Entity\Delivery::class, @@ -137,7 +137,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'delivery'; } diff --git a/src/Eccube/Form/Type/Admin/LayoutType.php b/src/Eccube/Form/Type/Admin/LayoutType.php index a51a2b7e170..419eddb26c0 100644 --- a/src/Eccube/Form/Type/Admin/LayoutType.php +++ b/src/Eccube/Form/Type/Admin/LayoutType.php @@ -37,7 +37,7 @@ class LayoutType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $layout_id = $options['layout_id']; @@ -84,7 +84,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => \Eccube\Entity\Layout::class, @@ -96,7 +96,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_layout'; } diff --git a/src/Eccube/Form/Type/Admin/LogType.php b/src/Eccube/Form/Type/Admin/LogType.php index 713b8f70fef..a529fc7095c 100644 --- a/src/Eccube/Form/Type/Admin/LogType.php +++ b/src/Eccube/Form/Type/Admin/LogType.php @@ -56,7 +56,7 @@ public function __construct(EccubeConfig $eccubeConfig, KernelInterface $kernel) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $files = []; $finder = new Finder(); @@ -99,7 +99,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_system_log'; } diff --git a/src/Eccube/Form/Type/Admin/LoginType.php b/src/Eccube/Form/Type/Admin/LoginType.php index 46bf80aed8b..b88c2dca8f1 100644 --- a/src/Eccube/Form/Type/Admin/LoginType.php +++ b/src/Eccube/Form/Type/Admin/LoginType.php @@ -51,7 +51,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->add('login_id', TextType::class, [ 'attr' => [ @@ -80,7 +80,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'csrf_protection' => false, @@ -91,7 +91,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_login'; } diff --git a/src/Eccube/Form/Type/Admin/MailType.php b/src/Eccube/Form/Type/Admin/MailType.php index 7afde92026d..d150e84ccf2 100644 --- a/src/Eccube/Form/Type/Admin/MailType.php +++ b/src/Eccube/Form/Type/Admin/MailType.php @@ -49,7 +49,7 @@ public function __construct(MailTemplateRepository $mailTemplateRepository, Eccu * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('template', MailTemplateType::class, [ @@ -120,7 +120,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => MailTemplate::class, @@ -131,7 +131,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'mail'; } diff --git a/src/Eccube/Form/Type/Admin/MainEditType.php b/src/Eccube/Form/Type/Admin/MainEditType.php index 5d85bd32dde..1a6a3c57fc4 100644 --- a/src/Eccube/Form/Type/Admin/MainEditType.php +++ b/src/Eccube/Form/Type/Admin/MainEditType.php @@ -75,7 +75,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', TextType::class, [ @@ -294,7 +294,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => Page::class, @@ -305,7 +305,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'main_edit'; } diff --git a/src/Eccube/Form/Type/Admin/MasterdataDataType.php b/src/Eccube/Form/Type/Admin/MasterdataDataType.php index 25c7945e5d5..096c867546e 100644 --- a/src/Eccube/Form/Type/Admin/MasterdataDataType.php +++ b/src/Eccube/Form/Type/Admin/MasterdataDataType.php @@ -51,7 +51,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('id', TextType::class, [ @@ -82,7 +82,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_system_masterdata_data'; } diff --git a/src/Eccube/Form/Type/Admin/MasterdataEditType.php b/src/Eccube/Form/Type/Admin/MasterdataEditType.php index 31bef732472..2dab2457f6b 100644 --- a/src/Eccube/Form/Type/Admin/MasterdataEditType.php +++ b/src/Eccube/Form/Type/Admin/MasterdataEditType.php @@ -32,7 +32,7 @@ class MasterdataEditType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('data', CollectionType::class, [ @@ -75,7 +75,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_system_masterdata_edit'; } diff --git a/src/Eccube/Form/Type/Admin/MasterdataType.php b/src/Eccube/Form/Type/Admin/MasterdataType.php index f1e17a1c84b..d7cc8cfe46c 100644 --- a/src/Eccube/Form/Type/Admin/MasterdataType.php +++ b/src/Eccube/Form/Type/Admin/MasterdataType.php @@ -54,7 +54,7 @@ public function __construct(EntityManagerInterface $entityManager) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $masterdata = []; /** @var MappingDriver $mappingDriver */ @@ -105,7 +105,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_system_masterdata'; } diff --git a/src/Eccube/Form/Type/Admin/MemberType.php b/src/Eccube/Form/Type/Admin/MemberType.php index 1c629d2b970..206399f7e37 100755 --- a/src/Eccube/Form/Type/Admin/MemberType.php +++ b/src/Eccube/Form/Type/Admin/MemberType.php @@ -65,7 +65,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', TextType::class, [ @@ -182,7 +182,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => Member::class, @@ -193,7 +193,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_member'; } diff --git a/src/Eccube/Form/Type/Admin/NewsType.php b/src/Eccube/Form/Type/Admin/NewsType.php index 1567c00abe7..503b80059e8 100644 --- a/src/Eccube/Form/Type/Admin/NewsType.php +++ b/src/Eccube/Form/Type/Admin/NewsType.php @@ -46,7 +46,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('publish_date', DateTimeType::class, [ @@ -107,7 +107,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => News::class, @@ -118,7 +118,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_news'; } diff --git a/src/Eccube/Form/Type/Admin/OrderItemType.php b/src/Eccube/Form/Type/Admin/OrderItemType.php index 4a801f8ec15..08746c3b94e 100644 --- a/src/Eccube/Form/Type/Admin/OrderItemType.php +++ b/src/Eccube/Form/Type/Admin/OrderItemType.php @@ -127,7 +127,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('product_name', TextType::class, [ @@ -311,7 +311,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => OrderItem::class, @@ -322,7 +322,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'order_item'; } @@ -333,7 +333,7 @@ public function getBlockPrefix() * * @return void */ - protected function addErrorsIfExists(FormInterface $form, ConstraintViolationListInterface $errors) + protected function addErrorsIfExists(FormInterface $form, ConstraintViolationListInterface $errors): void { if (count($errors) < 1) { return; diff --git a/src/Eccube/Form/Type/Admin/OrderMailType.php b/src/Eccube/Form/Type/Admin/OrderMailType.php index 1e26e0cb5b9..97527879147 100644 --- a/src/Eccube/Form/Type/Admin/OrderMailType.php +++ b/src/Eccube/Form/Type/Admin/OrderMailType.php @@ -50,7 +50,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('template', MailTemplateType::class, [ @@ -82,7 +82,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_order_mail'; } diff --git a/src/Eccube/Form/Type/Admin/OrderPdfType.php b/src/Eccube/Form/Type/Admin/OrderPdfType.php index e353089a7a1..9caef486c5e 100644 --- a/src/Eccube/Form/Type/Admin/OrderPdfType.php +++ b/src/Eccube/Form/Type/Admin/OrderPdfType.php @@ -58,7 +58,7 @@ public function __construct(EccubeConfig $eccubeConfig, EntityManagerInterface $ * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $config = $this->eccubeConfig; $builder @@ -185,7 +185,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * * @return string */ - public function getName() + public function getName(): string { return 'admin_order_pdf'; } diff --git a/src/Eccube/Form/Type/Admin/OrderStatusSettingType.php b/src/Eccube/Form/Type/Admin/OrderStatusSettingType.php index eacac910608..8fef917dc31 100644 --- a/src/Eccube/Form/Type/Admin/OrderStatusSettingType.php +++ b/src/Eccube/Form/Type/Admin/OrderStatusSettingType.php @@ -63,7 +63,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', TextType::class, [ @@ -120,7 +120,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => OrderStatus::class, diff --git a/src/Eccube/Form/Type/Admin/OrderType.php b/src/Eccube/Form/Type/Admin/OrderType.php index d02b1df7959..a277f62dd2c 100644 --- a/src/Eccube/Form/Type/Admin/OrderType.php +++ b/src/Eccube/Form/Type/Admin/OrderType.php @@ -94,7 +94,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', NameType::class, [ @@ -264,7 +264,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => Order::class, @@ -275,7 +275,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'order'; } @@ -287,7 +287,7 @@ public function getBlockPrefix() * * @return void */ - public function sortOrderItems(FormEvent $event) + public function sortOrderItems(FormEvent $event): void { /** @var Order|null $Order */ $Order = $event->getData(); @@ -310,7 +310,7 @@ public function sortOrderItems(FormEvent $event) * * @return void */ - public function addOrderStatusForm(FormEvent $event) + public function addOrderStatusForm(FormEvent $event): void { /** @var Order|null $Order */ $Order = $event->getData(); @@ -355,7 +355,7 @@ public function addOrderStatusForm(FormEvent $event) * * @return void */ - public function addShippingForm(FormEvent $event) + public function addShippingForm(FormEvent $event): void { /** @var Order|null $Order */ $Order = $event->getData(); @@ -384,7 +384,7 @@ public function addShippingForm(FormEvent $event) * * @return void */ - public function copyFields(FormEvent $event) + public function copyFields(FormEvent $event): void { /** @var Order $Order */ $Order = $event->getData(); @@ -422,7 +422,7 @@ public function copyFields(FormEvent $event) * * @return void */ - public function validateOrderStatus(FormEvent $event) + public function validateOrderStatus(FormEvent $event): void { /** @var Order $Order */ $Order = $event->getData(); @@ -459,7 +459,7 @@ public function validateOrderStatus(FormEvent $event) * * @return void */ - public function validateOrderItems(FormEvent $event) + public function validateOrderItems(FormEvent $event): void { /** @var Order $Order */ $Order = $event->getData(); @@ -486,7 +486,7 @@ public function validateOrderItems(FormEvent $event) * * @return void */ - public function associateOrderAndShipping(FormEvent $event) + public function associateOrderAndShipping(FormEvent $event): void { /** @var Order $Order */ $Order = $event->getData(); diff --git a/src/Eccube/Form/Type/Admin/PageType.php b/src/Eccube/Form/Type/Admin/PageType.php index 6d8be6bd1b7..c1122510530 100644 --- a/src/Eccube/Form/Type/Admin/PageType.php +++ b/src/Eccube/Form/Type/Admin/PageType.php @@ -29,7 +29,7 @@ class PageType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('layout', EntityType::class, [ @@ -49,7 +49,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_page'; } diff --git a/src/Eccube/Form/Type/Admin/PaymentRegisterType.php b/src/Eccube/Form/Type/Admin/PaymentRegisterType.php index 84e1d0fc2f9..815ae0c9c9a 100644 --- a/src/Eccube/Form/Type/Admin/PaymentRegisterType.php +++ b/src/Eccube/Form/Type/Admin/PaymentRegisterType.php @@ -52,7 +52,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('method', TextType::class, [ @@ -117,7 +117,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => \Eccube\Entity\Payment::class, @@ -128,7 +128,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'payment_register'; } diff --git a/src/Eccube/Form/Type/Admin/PluginLocalInstallType.php b/src/Eccube/Form/Type/Admin/PluginLocalInstallType.php index 595b7ec30a6..7cd2f14ac65 100644 --- a/src/Eccube/Form/Type/Admin/PluginLocalInstallType.php +++ b/src/Eccube/Form/Type/Admin/PluginLocalInstallType.php @@ -29,7 +29,7 @@ class PluginLocalInstallType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('plugin_archive', FileType::class, [ @@ -50,7 +50,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'plugin_local_install'; } diff --git a/src/Eccube/Form/Type/Admin/PluginManagementType.php b/src/Eccube/Form/Type/Admin/PluginManagementType.php index e366af013f4..17991c52f37 100644 --- a/src/Eccube/Form/Type/Admin/PluginManagementType.php +++ b/src/Eccube/Form/Type/Admin/PluginManagementType.php @@ -35,7 +35,7 @@ public function __construct() * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $plugin_id = $options['plugin_id']; @@ -64,7 +64,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'plugin_management'; } @@ -77,7 +77,7 @@ public function getBlockPrefix() * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setRequired(['plugin_id']); } diff --git a/src/Eccube/Form/Type/Admin/ProductClassEditType.php b/src/Eccube/Form/Type/Admin/ProductClassEditType.php index e0fac5b612e..80041f688b8 100644 --- a/src/Eccube/Form/Type/Admin/ProductClassEditType.php +++ b/src/Eccube/Form/Type/Admin/ProductClassEditType.php @@ -88,7 +88,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('checked', CheckboxType::class, [ @@ -162,7 +162,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => ProductClass::class, @@ -176,7 +176,7 @@ public function configureOptions(OptionsResolver $resolver) * * @return void */ - protected function setTaxRate(FormBuilderInterface $builder) + protected function setTaxRate(FormBuilderInterface $builder): void { if (!$this->baseInfoRepository->get()->isOptionProductTaxRule()) { return; @@ -200,7 +200,7 @@ protected function setTaxRate(FormBuilderInterface $builder) * * @return void */ - protected function setCheckbox(FormBuilderInterface $builder) + protected function setCheckbox(FormBuilderInterface $builder): void { $builder->addEventListener(FormEvents::POST_SET_DATA, function (FormEvent $event) { $data = $event->getData(); @@ -225,7 +225,7 @@ protected function setCheckbox(FormBuilderInterface $builder) * * @return void */ - protected function addValidations(FormBuilderInterface $builder) + protected function addValidations(FormBuilderInterface $builder): void { $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { $form = $event->getForm(); @@ -297,7 +297,7 @@ protected function addValidations(FormBuilderInterface $builder) * * @return void */ - protected function addErrors($key, FormInterface $form, ConstraintViolationListInterface $errors) + protected function addErrors($key, FormInterface $form, ConstraintViolationListInterface $errors): void { foreach ($errors as $error) { $form[$key]->addError(new FormError($error->getMessage())); diff --git a/src/Eccube/Form/Type/Admin/ProductClassMatrixType.php b/src/Eccube/Form/Type/Admin/ProductClassMatrixType.php index a4985046a6d..c69805eebe3 100644 --- a/src/Eccube/Form/Type/Admin/ProductClassMatrixType.php +++ b/src/Eccube/Form/Type/Admin/ProductClassMatrixType.php @@ -115,7 +115,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'product_classes_exist' => false, diff --git a/src/Eccube/Form/Type/Admin/ProductClassType.php b/src/Eccube/Form/Type/Admin/ProductClassType.php index 2ef3ff9d0e1..ace70b317df 100644 --- a/src/Eccube/Form/Type/Admin/ProductClassType.php +++ b/src/Eccube/Form/Type/Admin/ProductClassType.php @@ -65,7 +65,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('code', TextType::class, [ @@ -161,7 +161,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => \Eccube\Entity\ProductClass::class, @@ -172,7 +172,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_product_class'; } diff --git a/src/Eccube/Form/Type/Admin/ProductTag.php b/src/Eccube/Form/Type/Admin/ProductTag.php index 25c9d903862..5a01c3157f1 100644 --- a/src/Eccube/Form/Type/Admin/ProductTag.php +++ b/src/Eccube/Form/Type/Admin/ProductTag.php @@ -45,7 +45,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', TextType::class, [ @@ -62,7 +62,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_product_tag'; } diff --git a/src/Eccube/Form/Type/Admin/ProductType.php b/src/Eccube/Form/Type/Admin/ProductType.php index ccc4ffe4a5e..12180b7f22e 100644 --- a/src/Eccube/Form/Type/Admin/ProductType.php +++ b/src/Eccube/Form/Type/Admin/ProductType.php @@ -72,7 +72,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder // 商品規格情報 @@ -209,7 +209,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * * @return void */ - private function validateFilePath($form, $dirs) + private function validateFilePath($form, $dirs): void { foreach ($form->getData() as $fileName) { if (str_contains((string) $fileName, '..')) { @@ -236,7 +236,7 @@ private function validateFilePath($form, $dirs) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { } @@ -244,7 +244,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_product'; } diff --git a/src/Eccube/Form/Type/Admin/SearchCustomerType.php b/src/Eccube/Form/Type/Admin/SearchCustomerType.php index 29367e99e83..da1baed5e8f 100644 --- a/src/Eccube/Form/Type/Admin/SearchCustomerType.php +++ b/src/Eccube/Form/Type/Admin/SearchCustomerType.php @@ -70,7 +70,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $months = range(1, 12); $builder @@ -445,7 +445,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_search_customer'; } diff --git a/src/Eccube/Form/Type/Admin/SearchLoginHistoryType.php b/src/Eccube/Form/Type/Admin/SearchLoginHistoryType.php index d48ba6c840a..7262aceb241 100644 --- a/src/Eccube/Form/Type/Admin/SearchLoginHistoryType.php +++ b/src/Eccube/Form/Type/Admin/SearchLoginHistoryType.php @@ -46,7 +46,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder // ログインID・IPアドレス @@ -118,7 +118,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_search_login_history'; } diff --git a/src/Eccube/Form/Type/Admin/SearchOrderType.php b/src/Eccube/Form/Type/Admin/SearchOrderType.php index a27ed2b2fbc..ae741c376c8 100644 --- a/src/Eccube/Form/Type/Admin/SearchOrderType.php +++ b/src/Eccube/Form/Type/Admin/SearchOrderType.php @@ -52,7 +52,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder // 受注ID・注文者名・注文者(フリガナ)・注文者会社名 @@ -472,7 +472,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_search_order'; } diff --git a/src/Eccube/Form/Type/Admin/SearchPluginApiType.php b/src/Eccube/Form/Type/Admin/SearchPluginApiType.php index 52dd852877b..e2b405f51e1 100644 --- a/src/Eccube/Form/Type/Admin/SearchPluginApiType.php +++ b/src/Eccube/Form/Type/Admin/SearchPluginApiType.php @@ -32,7 +32,7 @@ class SearchPluginApiType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $category = $options['category']; // Todo: constant for the API key @@ -90,7 +90,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'category' => [], @@ -101,7 +101,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'search_plugin'; } diff --git a/src/Eccube/Form/Type/Admin/SearchProductType.php b/src/Eccube/Form/Type/Admin/SearchProductType.php index 3c7d4b98223..79de42e96f5 100644 --- a/src/Eccube/Form/Type/Admin/SearchProductType.php +++ b/src/Eccube/Form/Type/Admin/SearchProductType.php @@ -78,7 +78,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('id', TextType::class, [ @@ -308,7 +308,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_search_product'; } diff --git a/src/Eccube/Form/Type/Admin/SecurityType.php b/src/Eccube/Form/Type/Admin/SecurityType.php index 62a32068ccc..7a08470ef20 100644 --- a/src/Eccube/Form/Type/Admin/SecurityType.php +++ b/src/Eccube/Form/Type/Admin/SecurityType.php @@ -73,7 +73,7 @@ public function __construct(EccubeConfig $eccubeConfig, ValidatorInterface $vali * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $allowHosts = $this->eccubeConfig->get('eccube_admin_allow_hosts'); $allowHosts = implode("\n", $allowHosts); @@ -266,7 +266,7 @@ private function getRouteCollection(): string * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_security'; } diff --git a/src/Eccube/Form/Type/Admin/ShippingType.php b/src/Eccube/Form/Type/Admin/ShippingType.php index 2affaa6b063..3f2ed04432e 100644 --- a/src/Eccube/Form/Type/Admin/ShippingType.php +++ b/src/Eccube/Form/Type/Admin/ShippingType.php @@ -93,7 +93,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', NameType::class, [ @@ -352,7 +352,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => Shipping::class, @@ -363,7 +363,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'shipping'; } diff --git a/src/Eccube/Form/Type/Admin/ShopMasterType.php b/src/Eccube/Form/Type/Admin/ShopMasterType.php index 2a5efe6aff8..ad49de9759a 100644 --- a/src/Eccube/Form/Type/Admin/ShopMasterType.php +++ b/src/Eccube/Form/Type/Admin/ShopMasterType.php @@ -60,7 +60,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('company_name', TextType::class, [ @@ -269,7 +269,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => \Eccube\Entity\BaseInfo::class, @@ -280,7 +280,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'shop_master'; } diff --git a/src/Eccube/Form/Type/Admin/TagType.php b/src/Eccube/Form/Type/Admin/TagType.php index b4a984f3391..d894a6aa810 100644 --- a/src/Eccube/Form/Type/Admin/TagType.php +++ b/src/Eccube/Form/Type/Admin/TagType.php @@ -35,7 +35,7 @@ public function __construct() * {@inheritdoc} */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', TextType::class, [ @@ -53,7 +53,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => \Eccube\Entity\Tag::class, @@ -64,7 +64,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_tag'; } diff --git a/src/Eccube/Form/Type/Admin/TaxRuleType.php b/src/Eccube/Form/Type/Admin/TaxRuleType.php index 72f2bf0ca7c..7194eecdea7 100644 --- a/src/Eccube/Form/Type/Admin/TaxRuleType.php +++ b/src/Eccube/Form/Type/Admin/TaxRuleType.php @@ -50,7 +50,7 @@ public function __construct(TaxRuleRepository $taxRuleRepository) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('tax_rate', IntegerType::class, [ @@ -111,7 +111,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => TaxRule::class, @@ -122,7 +122,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'tax_rule'; } diff --git a/src/Eccube/Form/Type/Admin/TemplateType.php b/src/Eccube/Form/Type/Admin/TemplateType.php index 10fcf352e42..b35786e0be6 100644 --- a/src/Eccube/Form/Type/Admin/TemplateType.php +++ b/src/Eccube/Form/Type/Admin/TemplateType.php @@ -42,7 +42,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('code', TextType::class, [ @@ -87,7 +87,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => \Eccube\Entity\Template::class, @@ -98,7 +98,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_template'; } diff --git a/src/Eccube/Form/Type/Admin/TradeLawType.php b/src/Eccube/Form/Type/Admin/TradeLawType.php index 24b78bd1f62..d0286fa5c99 100644 --- a/src/Eccube/Form/Type/Admin/TradeLawType.php +++ b/src/Eccube/Form/Type/Admin/TradeLawType.php @@ -44,7 +44,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', TextType::class, [ @@ -79,7 +79,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => TradeLaw::class, diff --git a/src/Eccube/Form/Type/Admin/TwoFactorAuthType.php b/src/Eccube/Form/Type/Admin/TwoFactorAuthType.php index 698237eb223..8fa85c12938 100644 --- a/src/Eccube/Form/Type/Admin/TwoFactorAuthType.php +++ b/src/Eccube/Form/Type/Admin/TwoFactorAuthType.php @@ -30,7 +30,7 @@ class TwoFactorAuthType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add( @@ -62,7 +62,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'admin_two_factor_auth'; } diff --git a/src/Eccube/Form/Type/Front/ContactType.php b/src/Eccube/Form/Type/Front/ContactType.php index 856e4d96fde..33c2a6c1404 100644 --- a/src/Eccube/Form/Type/Front/ContactType.php +++ b/src/Eccube/Form/Type/Front/ContactType.php @@ -52,7 +52,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', NameType::class, [ @@ -90,7 +90,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'contact'; } diff --git a/src/Eccube/Form/Type/Front/CustomerAddressType.php b/src/Eccube/Form/Type/Front/CustomerAddressType.php index 6ae5822cf0a..65bdd9004ec 100644 --- a/src/Eccube/Form/Type/Front/CustomerAddressType.php +++ b/src/Eccube/Form/Type/Front/CustomerAddressType.php @@ -49,7 +49,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', NameType::class, [ @@ -81,7 +81,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => \Eccube\Entity\CustomerAddress::class, @@ -92,7 +92,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'customer_address'; } diff --git a/src/Eccube/Form/Type/Front/CustomerLoginType.php b/src/Eccube/Form/Type/Front/CustomerLoginType.php index 5897cccda94..42feedca01b 100644 --- a/src/Eccube/Form/Type/Front/CustomerLoginType.php +++ b/src/Eccube/Form/Type/Front/CustomerLoginType.php @@ -50,7 +50,7 @@ public function __construct(AuthenticationUtils $authenticationUtils, EccubeConf * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->add('login_email', EmailType::class, [ 'attr' => [ @@ -79,7 +79,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'customer_login'; } diff --git a/src/Eccube/Form/Type/Front/EntryType.php b/src/Eccube/Form/Type/Front/EntryType.php index ae909b3e336..e4836835f28 100644 --- a/src/Eccube/Form/Type/Front/EntryType.php +++ b/src/Eccube/Form/Type/Front/EntryType.php @@ -61,7 +61,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', NameType::class, [ @@ -138,7 +138,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => Customer::class, @@ -149,7 +149,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { // todo entry,mypageで共有されているので名前を変更する return 'entry'; diff --git a/src/Eccube/Form/Type/Front/ForgotType.php b/src/Eccube/Form/Type/Front/ForgotType.php index 98ae7d226ec..b05a9d35bfd 100644 --- a/src/Eccube/Form/Type/Front/ForgotType.php +++ b/src/Eccube/Form/Type/Front/ForgotType.php @@ -49,7 +49,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->add('login_email', EmailType::class, [ 'attr' => [ @@ -66,7 +66,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'forgot'; } diff --git a/src/Eccube/Form/Type/Front/NonMemberType.php b/src/Eccube/Form/Type/Front/NonMemberType.php index 5c0b20ea6ec..7f7abe2c927 100644 --- a/src/Eccube/Form/Type/Front/NonMemberType.php +++ b/src/Eccube/Form/Type/Front/NonMemberType.php @@ -51,7 +51,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('name', NameType::class, [ @@ -84,7 +84,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'nonmember'; } diff --git a/src/Eccube/Form/Type/Front/PasswordResetType.php b/src/Eccube/Form/Type/Front/PasswordResetType.php index 3b577e40a5a..ef4ebe51526 100644 --- a/src/Eccube/Form/Type/Front/PasswordResetType.php +++ b/src/Eccube/Form/Type/Front/PasswordResetType.php @@ -50,7 +50,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->add('login_email', EmailType::class, [ 'attr' => [ @@ -74,7 +74,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'forgot_reset'; } diff --git a/src/Eccube/Form/Type/Front/ShoppingShippingType.php b/src/Eccube/Form/Type/Front/ShoppingShippingType.php index 113bf6f0c0f..e16a774dd72 100644 --- a/src/Eccube/Form/Type/Front/ShoppingShippingType.php +++ b/src/Eccube/Form/Type/Front/ShoppingShippingType.php @@ -29,7 +29,7 @@ class ShoppingShippingType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { } @@ -41,7 +41,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => CustomerAddress::class, @@ -52,7 +52,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return CustomerAddressType::class; } @@ -61,7 +61,7 @@ public function getParent() * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'shopping_shipping'; } diff --git a/src/Eccube/Form/Type/Install/Step1Type.php b/src/Eccube/Form/Type/Install/Step1Type.php index e1b412f6bdf..fe09f886f92 100644 --- a/src/Eccube/Form/Type/Install/Step1Type.php +++ b/src/Eccube/Form/Type/Install/Step1Type.php @@ -28,7 +28,7 @@ class Step1Type extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('agree', CheckboxType::class, [ @@ -41,7 +41,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'install_step1'; } diff --git a/src/Eccube/Form/Type/Install/Step3Type.php b/src/Eccube/Form/Type/Install/Step3Type.php index fea9cd5386a..33f3df9c24d 100644 --- a/src/Eccube/Form/Type/Install/Step3Type.php +++ b/src/Eccube/Form/Type/Install/Step3Type.php @@ -56,7 +56,7 @@ public function __construct(ValidatorInterface $validator, EccubeConfig $eccubeC * @throws \Exception */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('shop_name', TextType::class, [ @@ -174,7 +174,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'install_step3'; } diff --git a/src/Eccube/Form/Type/Install/Step4Type.php b/src/Eccube/Form/Type/Install/Step4Type.php index 80d5916d06b..40767dedfb6 100644 --- a/src/Eccube/Form/Type/Install/Step4Type.php +++ b/src/Eccube/Form/Type/Install/Step4Type.php @@ -53,7 +53,7 @@ public function __construct( * @throws \Exception */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $database = []; if (extension_loaded('pdo_pgsql')) { @@ -135,7 +135,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'install_step4'; } @@ -147,7 +147,7 @@ public function getBlockPrefix() * * @return void */ - public function validate($data, ExecutionContext $context, $param = null) + public function validate($data, ExecutionContext $context, $param = null): void { $parameters = $this->requestStack->getCurrentRequest()->get('install_step4'); if ($parameters['database'] != 'pdo_sqlite') { diff --git a/src/Eccube/Form/Type/Install/Step5Type.php b/src/Eccube/Form/Type/Install/Step5Type.php index 3da036f4b7e..3adcce949f0 100644 --- a/src/Eccube/Form/Type/Install/Step5Type.php +++ b/src/Eccube/Form/Type/Install/Step5Type.php @@ -28,7 +28,7 @@ class Step5Type extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('no_update', CheckboxType::class, [ @@ -42,7 +42,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'install_step5'; } diff --git a/src/Eccube/Form/Type/KanaType.php b/src/Eccube/Form/Type/KanaType.php index bf2417c8eae..12eeaca8c39 100644 --- a/src/Eccube/Form/Type/KanaType.php +++ b/src/Eccube/Form/Type/KanaType.php @@ -45,7 +45,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { // ひらがなをカタカナに変換する // 引数はmb_convert_kanaのもの @@ -60,7 +60,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'lastname_options' => [ @@ -98,7 +98,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return NameType::class; } @@ -107,7 +107,7 @@ public function getParent() * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'kana'; } diff --git a/src/Eccube/Form/Type/Master/CategoryType.php b/src/Eccube/Form/Type/Master/CategoryType.php index d61fcfba12c..d75f144acb8 100644 --- a/src/Eccube/Form/Type/Master/CategoryType.php +++ b/src/Eccube/Form/Type/Master/CategoryType.php @@ -28,7 +28,7 @@ class CategoryType extends AbstractType * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => \Eccube\Entity\Category::class, @@ -42,13 +42,13 @@ public function configureOptions(OptionsResolver $resolver) } #[\Override] - public function getParent() + public function getParent(): ?string { return MasterType::class; } #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'category'; } diff --git a/src/Eccube/Form/Type/Master/CsvType.php b/src/Eccube/Form/Type/Master/CsvType.php index 8f8763dcadb..62771ca6267 100644 --- a/src/Eccube/Form/Type/Master/CsvType.php +++ b/src/Eccube/Form/Type/Master/CsvType.php @@ -27,7 +27,7 @@ class CsvType extends AbstractType * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => \Eccube\Entity\Master\CsvType::class, @@ -41,7 +41,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'csv_type'; } @@ -50,7 +50,7 @@ public function getBlockPrefix() * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return MasterType::class; } diff --git a/src/Eccube/Form/Type/Master/CustomerStatusType.php b/src/Eccube/Form/Type/Master/CustomerStatusType.php index 05733da9b4d..a39fb20f37a 100644 --- a/src/Eccube/Form/Type/Master/CustomerStatusType.php +++ b/src/Eccube/Form/Type/Master/CustomerStatusType.php @@ -29,7 +29,7 @@ class CustomerStatusType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { // todo ??? $options['sex_options']['required'] = $options['required']; @@ -43,7 +43,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => \Eccube\Entity\Master\CustomerStatus::class, @@ -52,13 +52,13 @@ public function configureOptions(OptionsResolver $resolver) } #[\Override] - public function getParent() + public function getParent(): ?string { return MasterType::class; } #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'customer_status'; } diff --git a/src/Eccube/Form/Type/Master/DeliveryDurationType.php b/src/Eccube/Form/Type/Master/DeliveryDurationType.php index 43d27f87528..cd99166e210 100644 --- a/src/Eccube/Form/Type/Master/DeliveryDurationType.php +++ b/src/Eccube/Form/Type/Master/DeliveryDurationType.php @@ -31,7 +31,7 @@ class DeliveryDurationType extends AbstractType * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => \Eccube\Entity\DeliveryDuration::class, @@ -50,7 +50,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'delivery_duration'; } @@ -59,7 +59,7 @@ public function getBlockPrefix() * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return EntityType::class; } diff --git a/src/Eccube/Form/Type/Master/DeviceTypeType.php b/src/Eccube/Form/Type/Master/DeviceTypeType.php index 635cc177456..45af8521cd0 100644 --- a/src/Eccube/Form/Type/Master/DeviceTypeType.php +++ b/src/Eccube/Form/Type/Master/DeviceTypeType.php @@ -28,7 +28,7 @@ class DeviceTypeType extends AbstractType * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => DeviceType::class, @@ -41,7 +41,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return MasterType::class; } @@ -50,7 +50,7 @@ public function getParent() * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'device_type'; } diff --git a/src/Eccube/Form/Type/Master/JobType.php b/src/Eccube/Form/Type/Master/JobType.php index ea2b2a2cb21..99c0a705aba 100644 --- a/src/Eccube/Form/Type/Master/JobType.php +++ b/src/Eccube/Form/Type/Master/JobType.php @@ -27,7 +27,7 @@ class JobType extends AbstractType * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => \Eccube\Entity\Master\Job::class, @@ -39,7 +39,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'job'; } @@ -48,7 +48,7 @@ public function getBlockPrefix() * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return MasterType::class; } diff --git a/src/Eccube/Form/Type/Master/LoginHistoryStatusType.php b/src/Eccube/Form/Type/Master/LoginHistoryStatusType.php index c1484dbd6da..a2a5c87e7c3 100644 --- a/src/Eccube/Form/Type/Master/LoginHistoryStatusType.php +++ b/src/Eccube/Form/Type/Master/LoginHistoryStatusType.php @@ -27,7 +27,7 @@ class LoginHistoryStatusType extends AbstractType * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => \Eccube\Entity\Master\LoginHistoryStatus::class, @@ -39,7 +39,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return MasterType::class; } @@ -48,7 +48,7 @@ public function getParent() * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'login_history_status'; } diff --git a/src/Eccube/Form/Type/Master/MailTemplateType.php b/src/Eccube/Form/Type/Master/MailTemplateType.php index ff25ac625b1..e09ee12b424 100644 --- a/src/Eccube/Form/Type/Master/MailTemplateType.php +++ b/src/Eccube/Form/Type/Master/MailTemplateType.php @@ -31,7 +31,7 @@ class MailTemplateType extends AbstractType * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => \Eccube\Entity\MailTemplate::class, @@ -50,7 +50,7 @@ public function configureOptions(OptionsResolver $resolver) * @return string */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'mail_template'; } @@ -61,7 +61,7 @@ public function getBlockPrefix() * @return string */ #[\Override] - public function getParent() + public function getParent(): string { return MasterType::class; } diff --git a/src/Eccube/Form/Type/Master/OrderStatusType.php b/src/Eccube/Form/Type/Master/OrderStatusType.php index 26fa85ef468..eb367ea48f6 100644 --- a/src/Eccube/Form/Type/Master/OrderStatusType.php +++ b/src/Eccube/Form/Type/Master/OrderStatusType.php @@ -48,7 +48,7 @@ public function __construct(OrderRepository $orderRepository) * @return void */ #[\Override] - public function buildView(FormView $view, FormInterface $form, array $options) + public function buildView(FormView $view, FormInterface $form, array $options): void { /** @var OrderStatus[] $OrderStatuses */ $OrderStatuses = $options['choice_loader']->loadChoiceList()->getChoices(); @@ -73,7 +73,7 @@ public function buildView(FormView $view, FormInterface $form, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => OrderStatus::class, @@ -86,7 +86,7 @@ public function configureOptions(OptionsResolver $resolver) * @return string */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'order_status'; } @@ -97,7 +97,7 @@ public function getBlockPrefix() * @return string */ #[\Override] - public function getParent() + public function getParent(): string { return MasterType::class; } diff --git a/src/Eccube/Form/Type/Master/PageMaxType.php b/src/Eccube/Form/Type/Master/PageMaxType.php index fe110c340f3..15a5774892a 100644 --- a/src/Eccube/Form/Type/Master/PageMaxType.php +++ b/src/Eccube/Form/Type/Master/PageMaxType.php @@ -32,7 +32,7 @@ class PageMaxType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { $options = $event->getForm()->getConfig()->getOptions(); @@ -59,7 +59,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => PageMax::class, @@ -72,7 +72,7 @@ public function configureOptions(OptionsResolver $resolver) * @return string */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'page_max'; } @@ -81,7 +81,7 @@ public function getBlockPrefix() * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return MasterType::class; } diff --git a/src/Eccube/Form/Type/Master/PaymentType.php b/src/Eccube/Form/Type/Master/PaymentType.php index e8593a3d534..41be2cf6bc9 100644 --- a/src/Eccube/Form/Type/Master/PaymentType.php +++ b/src/Eccube/Form/Type/Master/PaymentType.php @@ -28,7 +28,7 @@ class PaymentType extends AbstractType * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => \Eccube\Entity\Payment::class, @@ -48,7 +48,7 @@ public function configureOptions(OptionsResolver $resolver) * @return string */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'payment'; } @@ -59,7 +59,7 @@ public function getBlockPrefix() * @return string */ #[\Override] - public function getParent() + public function getParent(): string { return MasterType::class; } diff --git a/src/Eccube/Form/Type/Master/PrefType.php b/src/Eccube/Form/Type/Master/PrefType.php index c02673ad08f..15a52fa1b34 100644 --- a/src/Eccube/Form/Type/Master/PrefType.php +++ b/src/Eccube/Form/Type/Master/PrefType.php @@ -30,7 +30,7 @@ class PrefType extends AbstractType * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => \Eccube\Entity\Master\Pref::class, @@ -44,7 +44,7 @@ public function configureOptions(OptionsResolver $resolver) * @return string */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'pref'; } @@ -55,7 +55,7 @@ public function getBlockPrefix() * @return string */ #[\Override] - public function getParent() + public function getParent(): string { return MasterType::class; } diff --git a/src/Eccube/Form/Type/Master/ProductListMaxType.php b/src/Eccube/Form/Type/Master/ProductListMaxType.php index 529ff3f3b14..2c4918d0d64 100644 --- a/src/Eccube/Form/Type/Master/ProductListMaxType.php +++ b/src/Eccube/Form/Type/Master/ProductListMaxType.php @@ -32,7 +32,7 @@ class ProductListMaxType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { $options = $event->getForm()->getConfig()->getOptions(); @@ -50,7 +50,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => ProductListMax::class, @@ -61,7 +61,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'product_list_max'; } @@ -70,7 +70,7 @@ public function getBlockPrefix() * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return MasterType::class; } diff --git a/src/Eccube/Form/Type/Master/ProductListOrderByType.php b/src/Eccube/Form/Type/Master/ProductListOrderByType.php index 5f5534450dd..6c7bb95e706 100644 --- a/src/Eccube/Form/Type/Master/ProductListOrderByType.php +++ b/src/Eccube/Form/Type/Master/ProductListOrderByType.php @@ -32,7 +32,7 @@ class ProductListOrderByType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { $options = $event->getForm()->getConfig()->getOptions(); @@ -50,7 +50,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => ProductListOrderBy::class, @@ -63,7 +63,7 @@ public function configureOptions(OptionsResolver $resolver) * @return string */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'product_list_order_by'; } @@ -74,7 +74,7 @@ public function getBlockPrefix() * @return string */ #[\Override] - public function getParent() + public function getParent(): string { return MasterType::class; } diff --git a/src/Eccube/Form/Type/Master/ProductStatusType.php b/src/Eccube/Form/Type/Master/ProductStatusType.php index 6a1346936ac..a95ac941237 100644 --- a/src/Eccube/Form/Type/Master/ProductStatusType.php +++ b/src/Eccube/Form/Type/Master/ProductStatusType.php @@ -27,7 +27,7 @@ class ProductStatusType extends AbstractType * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => \Eccube\Entity\Master\ProductStatus::class, @@ -39,7 +39,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return MasterType::class; } @@ -48,7 +48,7 @@ public function getParent() * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'product_status'; } diff --git a/src/Eccube/Form/Type/Master/RoundingTypeType.php b/src/Eccube/Form/Type/Master/RoundingTypeType.php index 6290828fbd9..69925d32be4 100644 --- a/src/Eccube/Form/Type/Master/RoundingTypeType.php +++ b/src/Eccube/Form/Type/Master/RoundingTypeType.php @@ -27,7 +27,7 @@ class RoundingTypeType extends AbstractType * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => \Eccube\Entity\Master\RoundingType::class, @@ -39,7 +39,7 @@ public function configureOptions(OptionsResolver $resolver) * @return string */ #[\Override] - public function getParent() + public function getParent(): string { return MasterType::class; } @@ -48,7 +48,7 @@ public function getParent() * @return string */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'rounding_type'; } diff --git a/src/Eccube/Form/Type/Master/SaleTypeType.php b/src/Eccube/Form/Type/Master/SaleTypeType.php index 6cdb9d2bb64..e74dae1f211 100644 --- a/src/Eccube/Form/Type/Master/SaleTypeType.php +++ b/src/Eccube/Form/Type/Master/SaleTypeType.php @@ -30,7 +30,7 @@ class SaleTypeType extends AbstractType * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => \Eccube\Entity\Master\SaleType::class, @@ -42,7 +42,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'sale_type'; } @@ -51,7 +51,7 @@ public function getBlockPrefix() * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return MasterType::class; } diff --git a/src/Eccube/Form/Type/Master/SexType.php b/src/Eccube/Form/Type/Master/SexType.php index bd9d75d2e01..1a3c6f181a4 100644 --- a/src/Eccube/Form/Type/Master/SexType.php +++ b/src/Eccube/Form/Type/Master/SexType.php @@ -29,7 +29,7 @@ class SexType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $options['sex_options']['required'] = $options['required']; } @@ -42,7 +42,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'class' => \Eccube\Entity\Master\Sex::class, @@ -52,13 +52,13 @@ public function configureOptions(OptionsResolver $resolver) } #[\Override] - public function getParent() + public function getParent(): ?string { return MasterType::class; } #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'sex'; } diff --git a/src/Eccube/Form/Type/MasterType.php b/src/Eccube/Form/Type/MasterType.php index 9c789907acc..cf86813f61f 100644 --- a/src/Eccube/Form/Type/MasterType.php +++ b/src/Eccube/Form/Type/MasterType.php @@ -28,7 +28,7 @@ class MasterType extends AbstractType * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'multiple' => false, @@ -48,7 +48,7 @@ public function configureOptions(OptionsResolver $resolver) * @return string */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'master'; } @@ -59,7 +59,7 @@ public function getBlockPrefix() * @return string */ #[\Override] - public function getParent() + public function getParent(): string { return EntityType::class; } diff --git a/src/Eccube/Form/Type/NameType.php b/src/Eccube/Form/Type/NameType.php index 4410e1059e5..b03025b9fc3 100644 --- a/src/Eccube/Form/Type/NameType.php +++ b/src/Eccube/Form/Type/NameType.php @@ -49,7 +49,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $options['lastname_options']['required'] = $options['required']; $options['firstname_options']['required'] = $options['required']; @@ -95,7 +95,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function buildView(FormView $view, FormInterface $form, array $options) + public function buildView(FormView $view, FormInterface $form, array $options): void { $builder = $form->getConfig(); $view->vars['lastname_name'] = $builder->getAttribute('lastname_name'); @@ -110,7 +110,7 @@ public function buildView(FormView $view, FormInterface $form, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'options' => [], @@ -154,7 +154,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'name'; } diff --git a/src/Eccube/Form/Type/PhoneNumberType.php b/src/Eccube/Form/Type/PhoneNumberType.php index ae0bb05b026..6a241692f38 100644 --- a/src/Eccube/Form/Type/PhoneNumberType.php +++ b/src/Eccube/Form/Type/PhoneNumberType.php @@ -49,7 +49,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { // 全角英数を事前に半角にする $builder->addEventSubscriber(new \Eccube\Form\EventListener\ConvertKanaListener()); @@ -64,7 +64,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setNormalizer('constraints', function ($options, $value) { $constraints = []; @@ -97,7 +97,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return TelType::class; } @@ -106,7 +106,7 @@ public function getParent() * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'phone_number'; } diff --git a/src/Eccube/Form/Type/PostalType.php b/src/Eccube/Form/Type/PostalType.php index bc87cb06cba..9ddeac4cc10 100644 --- a/src/Eccube/Form/Type/PostalType.php +++ b/src/Eccube/Form/Type/PostalType.php @@ -49,7 +49,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->addEventSubscriber(new \Eccube\Form\EventListener\ConvertKanaListener()); $builder->addEventSubscriber(new \Eccube\Form\EventListener\TruncateHyphenListener()); @@ -63,7 +63,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setNormalizer('constraints', function ($options, $value) { $constraints = []; @@ -98,7 +98,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return TelType::class; } @@ -107,7 +107,7 @@ public function getParent() * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'postal'; } diff --git a/src/Eccube/Form/Type/PriceType.php b/src/Eccube/Form/Type/PriceType.php index 0203afceceb..78546d7b363 100644 --- a/src/Eccube/Form/Type/PriceType.php +++ b/src/Eccube/Form/Type/PriceType.php @@ -47,7 +47,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $currency = $this->eccubeConfig->get('currency'); $scale = Currencies::getFractionDigits($currency); @@ -88,7 +88,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return MoneyType::class; } @@ -97,7 +97,7 @@ public function getParent() * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'price'; } diff --git a/src/Eccube/Form/Type/RepeatedEmailType.php b/src/Eccube/Form/Type/RepeatedEmailType.php index 6733ba442f1..08945be6aa0 100644 --- a/src/Eccube/Form/Type/RepeatedEmailType.php +++ b/src/Eccube/Form/Type/RepeatedEmailType.php @@ -47,7 +47,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'entry_type' => EmailType::class, @@ -84,7 +84,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return RepeatedType::class; } @@ -93,7 +93,7 @@ public function getParent() * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'repeated_email'; } diff --git a/src/Eccube/Form/Type/RepeatedPasswordType.php b/src/Eccube/Form/Type/RepeatedPasswordType.php index a090ff1c124..b14f3e5c9c2 100644 --- a/src/Eccube/Form/Type/RepeatedPasswordType.php +++ b/src/Eccube/Form/Type/RepeatedPasswordType.php @@ -48,7 +48,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'type' => TextType::class, // type password だと入力欄を空にされてしまうので、widgetで対応 @@ -89,7 +89,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getParent() + public function getParent(): ?string { return RepeatedType::class; } @@ -98,7 +98,7 @@ public function getParent() * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'repeated_password'; } diff --git a/src/Eccube/Form/Type/SearchProductBlockType.php b/src/Eccube/Form/Type/SearchProductBlockType.php index 36450f6c086..82bc75d6e43 100644 --- a/src/Eccube/Form/Type/SearchProductBlockType.php +++ b/src/Eccube/Form/Type/SearchProductBlockType.php @@ -41,7 +41,7 @@ public function __construct(CategoryRepository $categoryRepository) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $Categories = $this->categoryRepository ->getList(null, true); @@ -70,7 +70,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'csrf_protection' => false, @@ -82,7 +82,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'search_product_block'; } diff --git a/src/Eccube/Form/Type/SearchProductType.php b/src/Eccube/Form/Type/SearchProductType.php index 4da30f5864a..0d1e5c06780 100644 --- a/src/Eccube/Form/Type/SearchProductType.php +++ b/src/Eccube/Form/Type/SearchProductType.php @@ -58,7 +58,7 @@ public function __construct(CategoryRepository $categoryRepository, EntityManage * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $Categories = $this->categoryRepository ->getList(null, true); @@ -98,7 +98,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'csrf_protection' => false, @@ -110,7 +110,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'search_product'; } diff --git a/src/Eccube/Form/Type/ShippingMultipleItemType.php b/src/Eccube/Form/Type/ShippingMultipleItemType.php index 18a819fec03..0e7174d7511 100644 --- a/src/Eccube/Form/Type/ShippingMultipleItemType.php +++ b/src/Eccube/Form/Type/ShippingMultipleItemType.php @@ -102,7 +102,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('quantity', IntegerType::class, [ @@ -190,7 +190,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'shipping_multiple_item'; } diff --git a/src/Eccube/Form/Type/ShippingMultipleType.php b/src/Eccube/Form/Type/ShippingMultipleType.php index c6705192819..cdb79ec9468 100644 --- a/src/Eccube/Form/Type/ShippingMultipleType.php +++ b/src/Eccube/Form/Type/ShippingMultipleType.php @@ -45,7 +45,7 @@ public function __construct(ShippingRepository $shippingRepository) * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->addEventListener(FormEvents::POST_SET_DATA, function ($event) { @@ -79,7 +79,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'shipping_multiple'; } diff --git a/src/Eccube/Form/Type/Shopping/CustomerAddressType.php b/src/Eccube/Form/Type/Shopping/CustomerAddressType.php index 51888bed70a..9afb2647ac2 100644 --- a/src/Eccube/Form/Type/Shopping/CustomerAddressType.php +++ b/src/Eccube/Form/Type/Shopping/CustomerAddressType.php @@ -33,7 +33,7 @@ class CustomerAddressType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { // 会員住所とお届け先住所をマージして選択肢を作成 /** @var Customer $Customer */ @@ -69,7 +69,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults(['customer' => null, 'shipping' => null]); } diff --git a/src/Eccube/Form/Type/Shopping/OrderItemType.php b/src/Eccube/Form/Type/Shopping/OrderItemType.php index bf7fae854a8..5811753a7f2 100644 --- a/src/Eccube/Form/Type/Shopping/OrderItemType.php +++ b/src/Eccube/Form/Type/Shopping/OrderItemType.php @@ -32,7 +32,7 @@ public function __construct() * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { } @@ -44,7 +44,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults( [ @@ -57,7 +57,7 @@ public function configureOptions(OptionsResolver $resolver) * @return string */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return '_shopping_order_item'; } diff --git a/src/Eccube/Form/Type/Shopping/OrderType.php b/src/Eccube/Form/Type/Shopping/OrderType.php index 663908a8ef4..7777dba8bf3 100644 --- a/src/Eccube/Form/Type/Shopping/OrderType.php +++ b/src/Eccube/Form/Type/Shopping/OrderType.php @@ -96,7 +96,7 @@ public function __construct( * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { // ShoppingController::checkoutから呼ばれる場合は, フォーム項目の定義をスキップする. if ($options['skip_add_form']) { @@ -193,7 +193,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults( [ @@ -204,7 +204,7 @@ public function configureOptions(OptionsResolver $resolver) } #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return '_shopping_order'; } @@ -216,7 +216,7 @@ public function getBlockPrefix() * * @return void */ - private function addPaymentForm(FormInterface $form, array $choices, ?Payment $data = null) + private function addPaymentForm(FormInterface $form, array $choices, ?Payment $data = null): void { $message = trans('front.shopping.payment_method_unselected'); @@ -246,7 +246,7 @@ private function addPaymentForm(FormInterface $form, array $choices, ?Payment $d * * @return Delivery[] */ - private function getDeliveries(Order $Order) + private function getDeliveries(Order $Order): array { $Deliveries = []; foreach ($Order->getShippings() as $Shipping) { @@ -267,7 +267,7 @@ private function getDeliveries(Order $Order) * * @return ArrayCollection */ - private function getPayments($Deliveries) + private function getPayments($Deliveries): ArrayCollection { $PaymentsByDeliveries = []; foreach ($Deliveries as $Delivery) { @@ -307,7 +307,7 @@ private function getPayments($Deliveries) * * @return Payment[] */ - private function filterPayments(ArrayCollection $Payments, $total) + private function filterPayments(ArrayCollection $Payments, $total): array { $PaymentArrays = $Payments->filter(function (Payment $Payment) use ($total) { $charge = $Payment->getCharge(); diff --git a/src/Eccube/Form/Type/Shopping/ShippingType.php b/src/Eccube/Form/Type/Shopping/ShippingType.php index ecf82a595b6..92f0506b842 100644 --- a/src/Eccube/Form/Type/Shopping/ShippingType.php +++ b/src/Eccube/Form/Type/Shopping/ShippingType.php @@ -69,7 +69,7 @@ public function __construct(EccubeConfig $eccubeConfig, DeliveryRepository $deli * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add( @@ -283,7 +283,7 @@ function (FormEvent $event) { * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults( [ @@ -293,7 +293,7 @@ public function configureOptions(OptionsResolver $resolver) } #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return '_shopping_shipping'; } diff --git a/src/Eccube/Form/Type/ShoppingMultipleType.php b/src/Eccube/Form/Type/ShoppingMultipleType.php index 5c285b9550c..a486b36da97 100644 --- a/src/Eccube/Form/Type/ShoppingMultipleType.php +++ b/src/Eccube/Form/Type/ShoppingMultipleType.php @@ -30,7 +30,7 @@ class ShoppingMultipleType extends AbstractType * @return void */ #[\Override] - public function buildForm(FormBuilderInterface $builder, array $options) + public function buildForm(FormBuilderInterface $builder, array $options): void { $deliveries = $options['deliveries']; $delivery = $options['delivery']; @@ -65,7 +65,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'deliveries' => [], @@ -78,7 +78,7 @@ public function configureOptions(OptionsResolver $resolver) * {@inheritdoc} */ #[\Override] - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'shopping_multiple'; } diff --git a/src/Eccube/Form/Type/ToggleSwitchType.php b/src/Eccube/Form/Type/ToggleSwitchType.php index 76de2a71025..a1c7866fa03 100644 --- a/src/Eccube/Form/Type/ToggleSwitchType.php +++ b/src/Eccube/Form/Type/ToggleSwitchType.php @@ -31,7 +31,7 @@ class ToggleSwitchType extends AbstractType * @return void */ #[\Override] - public function buildView(FormView $view, FormInterface $form, array $options) + public function buildView(FormView $view, FormInterface $form, array $options): void { $view->vars['label_on'] = $options['label_on']; $view->vars['label_off'] = $options['label_off']; @@ -45,7 +45,7 @@ public function buildView(FormView $view, FormInterface $form, array $options) * @return void */ #[\Override] - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'label' => false, @@ -58,7 +58,7 @@ public function configureOptions(OptionsResolver $resolver) * @return string */ #[\Override] - public function getParent() + public function getParent(): string { return CheckboxType::class; } diff --git a/src/Eccube/Form/Validator/EmailValidator.php b/src/Eccube/Form/Validator/EmailValidator.php index 28587a33255..f690dc1cd4d 100644 --- a/src/Eccube/Form/Validator/EmailValidator.php +++ b/src/Eccube/Form/Validator/EmailValidator.php @@ -39,7 +39,7 @@ class EmailValidator extends ConstraintValidator * @throws \Symfony\Component\Form\Exception\UnexpectedTypeException */ #[\Override] - public function validate($value, Constraint $constraint) + public function validate($value, Constraint $constraint): void { if (!$constraint instanceof Email) { throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Email'); diff --git a/src/Eccube/Form/Validator/TwigLintValidator.php b/src/Eccube/Form/Validator/TwigLintValidator.php index 024d8fac3ed..c7122e78bb8 100644 --- a/src/Eccube/Form/Validator/TwigLintValidator.php +++ b/src/Eccube/Form/Validator/TwigLintValidator.php @@ -43,7 +43,7 @@ public function __construct(\Twig\Environment $twig) * @return void */ #[\Override] - public function validate($value, Constraint $constraint) + public function validate($value, Constraint $constraint): void { // valueがnullの場合は "Template is not defined"のエラーが投げられるので, 空文字でチェックする. if (is_null($value)) { diff --git a/src/Eccube/Kernel.php b/src/Eccube/Kernel.php index 9cdf425bb08..b91519b2554 100644 --- a/src/Eccube/Kernel.php +++ b/src/Eccube/Kernel.php @@ -132,7 +132,7 @@ public function registerBundles(): iterable * @return void */ #[\Override] - public function boot() + public function boot(): void { // Symfonyがsrc/Eccube/Entity以下を読み込む前にapp/proxy/entity以下をロードする // $this->loadEntityProxies(); @@ -173,7 +173,7 @@ public function boot() * * @throws \Exception */ - protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader) + protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void { $confDir = $this->getProjectDir().'/app/config/eccube'; $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob'); @@ -199,7 +199,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa * * @return void */ - protected function configureRoutes(RoutingConfigurator $routes) + protected function configureRoutes(RoutingConfigurator $routes): void { $container = $this->getContainer(); @@ -245,7 +245,7 @@ protected function configureRoutes(RoutingConfigurator $routes) * @return void */ #[\Override] - protected function build(ContainerBuilder $container) + protected function build(ContainerBuilder $container): void { $this->addEntityExtensionPass($container); @@ -308,7 +308,7 @@ protected function build(ContainerBuilder $container) * * @return void */ - protected function addEntityExtensionPass(ContainerBuilder $container) + protected function addEntityExtensionPass(ContainerBuilder $container): void { $projectDir = $container->getParameter('kernel.project_dir'); @@ -352,7 +352,7 @@ protected function addEntityExtensionPass(ContainerBuilder $container) /** * @return void */ - protected function loadEntityProxies() + protected function loadEntityProxies(): void { // see https://github.com/EC-CUBE/ec-cube/issues/4727 // キャッシュクリアなど、コード内でコマンドを利用している場合に2回実行されてしまう diff --git a/src/Eccube/Log/Logger.php b/src/Eccube/Log/Logger.php index b3d12569a04..2034bd95847 100644 --- a/src/Eccube/Log/Logger.php +++ b/src/Eccube/Log/Logger.php @@ -61,7 +61,7 @@ public function __construct( * @return void */ #[\Override] - public function log($level, $message, array $context = []) + public function log($level, $message, array $context = []): void { if ($this->context->isAdmin()) { $this->adminLogger->log($level, $message, $context); diff --git a/src/Eccube/Log/Processor/SessionProcessor.php b/src/Eccube/Log/Processor/SessionProcessor.php index 69068fe91cf..f376fc2fd47 100644 --- a/src/Eccube/Log/Processor/SessionProcessor.php +++ b/src/Eccube/Log/Processor/SessionProcessor.php @@ -33,7 +33,7 @@ public function __construct(Session $session) * * @return array> */ - public function __invoke(array $records) + public function __invoke(array $records): array { $records['extra']['session_id'] = 'N/A'; diff --git a/src/Eccube/Log/Processor/TokenProcessor.php b/src/Eccube/Log/Processor/TokenProcessor.php index f5dc8d1aeb7..50f97cfbd57 100644 --- a/src/Eccube/Log/Processor/TokenProcessor.php +++ b/src/Eccube/Log/Processor/TokenProcessor.php @@ -34,7 +34,7 @@ public function __construct(TokenStorageInterface $tokenStorage) * * @return array> */ - public function __invoke(array $records) + public function __invoke(array $records): array { $records['extra']['user_id'] = 'N/A'; diff --git a/src/Eccube/Plugin/AbstractPluginManager.php b/src/Eccube/Plugin/AbstractPluginManager.php index 5796821fa7c..23a97c56c3c 100644 --- a/src/Eccube/Plugin/AbstractPluginManager.php +++ b/src/Eccube/Plugin/AbstractPluginManager.php @@ -43,7 +43,7 @@ abstract class AbstractPluginManager * * @return void */ - public function migration(Connection $connection, $pluginCode, $version = null, $migrationFilePath = null) + public function migration(Connection $connection, $pluginCode, $version = null, $migrationFilePath = null): void { if (null === $migrationFilePath) { $migrationFilePath = __DIR__.'/../../../app/Plugin/'.$pluginCode.'/DoctrineMigrations'; @@ -91,7 +91,7 @@ public function migration(Connection $connection, $pluginCode, $version = null, * * @return void */ - public function install(array $meta, ContainerInterface $container) + public function install(array $meta, ContainerInterface $container): void { // quiet. } @@ -104,7 +104,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 { // quiet. } @@ -117,7 +117,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 { // quiet. } @@ -130,7 +130,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 { // quiet. } @@ -143,7 +143,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 { // quiet. } diff --git a/src/Eccube/Repository/AbstractRepository.php b/src/Eccube/Repository/AbstractRepository.php index 46828d1cab4..046a58323f9 100644 --- a/src/Eccube/Repository/AbstractRepository.php +++ b/src/Eccube/Repository/AbstractRepository.php @@ -43,7 +43,7 @@ abstract class AbstractRepository extends ServiceEntityRepository * * @return void */ - public function delete($entity) + public function delete($entity): void { $this->getEntityManager()->remove($entity); } @@ -55,7 +55,7 @@ public function delete($entity) * * @return void */ - public function save($entity) + public function save($entity): void { $this->getEntityManager()->persist($entity); } @@ -63,7 +63,7 @@ public function save($entity) /** * @return int|string|null */ - protected function getCacheLifetime() + protected function getCacheLifetime(): int|string|null { if ($this->eccubeConfig !== null) { return $this->eccubeConfig['eccube_result_cache_lifetime']; @@ -77,7 +77,7 @@ protected function getCacheLifetime() * * @return bool */ - protected function isPostgreSQL() + protected function isPostgreSQL(): bool { return 'postgresql' == $this->getEntityManager()->getConnection()->getDatabasePlatform()->getName(); } @@ -87,7 +87,7 @@ protected function isPostgreSQL() * * @return bool */ - protected function isMySQL() + protected function isMySQL(): bool { return 'mysql' == $this->getEntityManager()->getConnection()->getDatabasePlatform()->getName(); } diff --git a/src/Eccube/Repository/AuthorityRoleRepository.php b/src/Eccube/Repository/AuthorityRoleRepository.php index 39e59158c93..c7c230847cd 100644 --- a/src/Eccube/Repository/AuthorityRoleRepository.php +++ b/src/Eccube/Repository/AuthorityRoleRepository.php @@ -36,7 +36,7 @@ public function __construct(RegistryInterface $registry) * * @return array */ - public function findAllSort() + public function findAllSort(): array { return $this->findBy([], ['Authority' => 'ASC', 'deny_url' => 'ASC']); } diff --git a/src/Eccube/Repository/BaseInfoRepository.php b/src/Eccube/Repository/BaseInfoRepository.php index 1bec549c886..fdf2089d05e 100644 --- a/src/Eccube/Repository/BaseInfoRepository.php +++ b/src/Eccube/Repository/BaseInfoRepository.php @@ -41,7 +41,7 @@ public function __construct(RegistryInterface $registry) * * @return BaseInfo */ - public function get($id = 1) + public function get($id = 1): BaseInfo { $BaseInfo = $this->find($id); diff --git a/src/Eccube/Repository/BlockPositionRepository.php b/src/Eccube/Repository/BlockPositionRepository.php index 10f4325e5ca..dbb30d60e84 100644 --- a/src/Eccube/Repository/BlockPositionRepository.php +++ b/src/Eccube/Repository/BlockPositionRepository.php @@ -55,7 +55,7 @@ public function __construct(BlockRepository $blockRepository, RegistryInterface * * @return void */ - public function register($data, $Blocks, $UnusedBlocks, $Layout) + public function register($data, $Blocks, $UnusedBlocks, $Layout): void { $em = $this->getEntityManager(); diff --git a/src/Eccube/Repository/BlockRepository.php b/src/Eccube/Repository/BlockRepository.php index ad91c546e48..b57e0625108 100644 --- a/src/Eccube/Repository/BlockRepository.php +++ b/src/Eccube/Repository/BlockRepository.php @@ -52,7 +52,7 @@ public function __construct( * * @return Block */ - public function newBlock($DeviceType) + public function newBlock($DeviceType): Block { $Block = new Block(); $Block @@ -68,15 +68,16 @@ public function newBlock($DeviceType) * * @param DeviceType $DeviceType * - * @return \Symfony\Component\HttpFoundation\Request|null + * @return Block[] */ - public function getList($DeviceType) + public function getList($DeviceType): array { $qb = $this->createQueryBuilder('b') ->orderBy('b.id', 'DESC') ->where('b.DeviceType = :DeviceType') ->setParameter('DeviceType', $DeviceType); + /** @var Block[] $Blocks */ $Blocks = $qb ->getQuery() ->getResult(); @@ -91,7 +92,7 @@ public function getList($DeviceType) * * @return array|null */ - public function getUnusedBlocks($Blocks) + public function getUnusedBlocks($Blocks): ?array { $UnusedBlocks = $this->createQueryBuilder('b') ->select('b') diff --git a/src/Eccube/Repository/CalendarRepository.php b/src/Eccube/Repository/CalendarRepository.php index 9aa74b59c8e..f5dfad650eb 100644 --- a/src/Eccube/Repository/CalendarRepository.php +++ b/src/Eccube/Repository/CalendarRepository.php @@ -45,7 +45,7 @@ public function __construct(RegistryInterface $registry) * * @throws \Exception */ - public function get($id = 1) + public function get($id = 1): Calendar { $calendar = $this->find($id); @@ -61,7 +61,7 @@ public function get($id = 1) * * @return array|null */ - public function getListOrderByIdDesc() + public function getListOrderByIdDesc(): ?array { $qb = $this->createQueryBuilder('c') ->orderBy('c.id', 'DESC'); @@ -79,7 +79,7 @@ public function getListOrderByIdDesc() * * @return array|null */ - public function getHolidayList(Carbon $startDate, Carbon $endDate) + public function getHolidayList(Carbon $startDate, Carbon $endDate): ?array { $qb = $this->createQueryBuilder('c') ->orderBy('c.id', 'DESC') @@ -106,7 +106,7 @@ public function getHolidayList(Carbon $startDate, Carbon $endDate) * @throws OptimisticLockException */ #[\Override] - public function delete($Calendar) + public function delete($Calendar): void { if (!$Calendar instanceof Calendar) { $Calendar = $this->find($Calendar); diff --git a/src/Eccube/Repository/CategoryRepository.php b/src/Eccube/Repository/CategoryRepository.php index 987300731ee..90d87c1437e 100644 --- a/src/Eccube/Repository/CategoryRepository.php +++ b/src/Eccube/Repository/CategoryRepository.php @@ -55,7 +55,7 @@ public function __construct( * * @return int 全カテゴリの合計数 */ - public function getTotalCount() + public function getTotalCount(): int { return $this ->createQueryBuilder('c') @@ -74,7 +74,7 @@ public function getTotalCount() * * @return Category[] カテゴリの配列 */ - public function getList(?Category $Parent = null, $flat = false) + public function getList(?Category $Parent = null, $flat = false): array { $qb = $this->createQueryBuilder('c1') ->select('c1, c2, c3, c4, c5') @@ -119,7 +119,7 @@ public function getList(?Category $Parent = null, $flat = false) * @throws NonUniqueResultException */ #[\Override] - public function save($Category) + public function save($Category): void { if (!$Category->getId()) { $Parent = $Category->getParent(); @@ -160,7 +160,7 @@ public function save($Category) * @throws DriverException SQLiteの場合, 外部キー制約違反が発生すると, DriverExceptionをthrowします. */ #[\Override] - public function delete($Category) + public function delete($Category): void { $this ->createQueryBuilder('c') diff --git a/src/Eccube/Repository/ClassCategoryRepository.php b/src/Eccube/Repository/ClassCategoryRepository.php index 48c651e3848..56832ae4a1b 100644 --- a/src/Eccube/Repository/ClassCategoryRepository.php +++ b/src/Eccube/Repository/ClassCategoryRepository.php @@ -48,7 +48,7 @@ public function __construct( * * @return array 規格カテゴリの配列 */ - public function getList(?\Eccube\Entity\ClassName $ClassName = null) + public function getList(?\Eccube\Entity\ClassName $ClassName = null): array { $qb = $this->createQueryBuilder('cc') ->orderBy('cc.sort_no', 'DESC'); // TODO ClassName ごとにソートした方が良いかも @@ -72,7 +72,7 @@ public function getList(?\Eccube\Entity\ClassName $ClassName = null) * @throws NonUniqueResultException */ #[\Override] - public function save($ClassCategory) + public function save($ClassCategory): void { if (!$ClassCategory->getId()) { $ClassName = $ClassCategory->getClassName(); @@ -103,7 +103,7 @@ public function save($ClassCategory) * @throws DriverException SQLiteの場合, 外部キー制約違反が発生すると, DriverExceptionをthrowします. */ #[\Override] - public function delete($ClassCategory) + public function delete($ClassCategory): void { $this->createQueryBuilder('cc') ->update() @@ -126,7 +126,7 @@ public function delete($ClassCategory) * * @return void */ - public function toggleVisibility($ClassCategory) + public function toggleVisibility($ClassCategory): void { if ($ClassCategory->isVisible()) { $ClassCategory->setVisible(false); diff --git a/src/Eccube/Repository/ClassNameRepository.php b/src/Eccube/Repository/ClassNameRepository.php index 6592e6003e0..630de8a33a8 100644 --- a/src/Eccube/Repository/ClassNameRepository.php +++ b/src/Eccube/Repository/ClassNameRepository.php @@ -45,7 +45,7 @@ public function __construct(RegistryInterface $registry) * * @return array 規格の配列 */ - public function getList() + public function getList(): array { $qb = $this->createQueryBuilder('cn') ->orderBy('cn.sort_no', 'DESC'); @@ -66,7 +66,7 @@ public function getList() * @throws NonUniqueResultException */ #[\Override] - public function save($ClassName) + public function save($ClassName): void { if (!$ClassName->getId()) { $sortNo = $this->createQueryBuilder('cn') @@ -92,7 +92,7 @@ public function save($ClassName) * @throws DriverException SQLiteの場合, 外部キー制約違反が発生すると, DriverExceptionをthrowします. */ #[\Override] - public function delete($ClassName) + public function delete($ClassName): void { $sortNo = $ClassName->getSortNo(); $this->createQueryBuilder('cn') diff --git a/src/Eccube/Repository/CustomerAddressRepository.php b/src/Eccube/Repository/CustomerAddressRepository.php index 0baeccc0580..c03da230a1f 100644 --- a/src/Eccube/Repository/CustomerAddressRepository.php +++ b/src/Eccube/Repository/CustomerAddressRepository.php @@ -44,7 +44,7 @@ public function __construct(RegistryInterface $registry) * @return void */ #[\Override] - public function delete($CustomerAddress) + public function delete($CustomerAddress): void { $em = $this->getEntityManager(); $em->remove($CustomerAddress); diff --git a/src/Eccube/Repository/CustomerFavoriteProductRepository.php b/src/Eccube/Repository/CustomerFavoriteProductRepository.php index 8bd9d036779..963a675e4fb 100644 --- a/src/Eccube/Repository/CustomerFavoriteProductRepository.php +++ b/src/Eccube/Repository/CustomerFavoriteProductRepository.php @@ -38,7 +38,7 @@ public function __construct(RegistryInterface $registry) * * @return void */ - public function addFavorite(\Eccube\Entity\Customer $Customer, \Eccube\Entity\Product $Product) + public function addFavorite(\Eccube\Entity\Customer $Customer, \Eccube\Entity\Product $Product): void { if ($this->isFavorite($Customer, $Product)) { return; @@ -59,7 +59,7 @@ public function addFavorite(\Eccube\Entity\Customer $Customer, \Eccube\Entity\Pr * * @return bool */ - public function isFavorite(\Eccube\Entity\Customer $Customer, \Eccube\Entity\Product $Product) + public function isFavorite(\Eccube\Entity\Customer $Customer, \Eccube\Entity\Product $Product): bool { $qb = $this->createQueryBuilder('cf') ->select('COUNT(cf.Product)') @@ -80,7 +80,7 @@ public function isFavorite(\Eccube\Entity\Customer $Customer, \Eccube\Entity\Pro * * @return QueryBuilder */ - public function getQueryBuilderByCustomer(\Eccube\Entity\Customer $Customer) + public function getQueryBuilderByCustomer(\Eccube\Entity\Customer $Customer): QueryBuilder { $qb = $this->createQueryBuilder('cfp') ->select('cfp, p') @@ -102,7 +102,7 @@ public function getQueryBuilderByCustomer(\Eccube\Entity\Customer $Customer) * @return void */ #[\Override] - public function delete($CustomerFavoriteProduct) + public function delete($CustomerFavoriteProduct): void { $em = $this->getEntityManager(); $em->remove($CustomerFavoriteProduct); diff --git a/src/Eccube/Repository/CustomerRepository.php b/src/Eccube/Repository/CustomerRepository.php index 864125ea799..365065f6ab3 100644 --- a/src/Eccube/Repository/CustomerRepository.php +++ b/src/Eccube/Repository/CustomerRepository.php @@ -88,7 +88,7 @@ public function __construct( /** * @return Customer */ - public function newCustomer() + public function newCustomer(): Customer { $CustomerStatus = $this->getEntityManager() ->find(CustomerStatus::class, CustomerStatus::PROVISIONAL); @@ -137,7 +137,7 @@ public function newCustomer() * * @throws Exception */ - public function getQueryBuilderBySearchData($searchData) + public function getQueryBuilderBySearchData($searchData): QueryBuilder { $qb = $this->createQueryBuilder('c') ->select('c'); @@ -340,7 +340,7 @@ public function getQueryBuilderBySearchData($searchData) * * @return string */ - public function getUniqueSecretKey() + public function getUniqueSecretKey(): string { do { $key = StringUtil::random(32); @@ -355,7 +355,7 @@ public function getUniqueSecretKey() * * @return string */ - public function getUniqueResetKey() + public function getUniqueResetKey(): string { do { $key = StringUtil::random(32); @@ -372,7 +372,7 @@ public function getUniqueResetKey() * * @return Customer|null 見つからない場合はnullを返す. */ - public function getProvisionalCustomerBySecretKey($secretKey) + public function getProvisionalCustomerBySecretKey($secretKey): ?Customer { return $this->findOneBy([ 'secret_key' => $secretKey, @@ -387,7 +387,7 @@ public function getProvisionalCustomerBySecretKey($secretKey) * * @return Customer|null 見つからない場合はnullを返す. */ - public function getRegularCustomerByEmail($email) + public function getRegularCustomerByEmail($email): ?Customer { return $this->findOneBy([ 'email' => $email, @@ -403,7 +403,7 @@ public function getRegularCustomerByEmail($email) * * @return Customer|null 見つからない場合はnullを返す. */ - public function getRegularCustomerByResetKey($resetKey, $email = null) + public function getRegularCustomerByResetKey($resetKey, $email = null): ?Customer { $qb = $this->createQueryBuilder('c') ->where('c.reset_key = :reset_key AND c.Status = :status AND c.reset_expire >= :reset_expire') @@ -427,7 +427,7 @@ public function getRegularCustomerByResetKey($resetKey, $email = null) * * @return string */ - public function getResetPassword() + public function getResetPassword(): string { return StringUtil::random(8); } @@ -440,7 +440,7 @@ public function getResetPassword() * * @return array */ - public function getNonWithdrawingCustomers(array $criteria = []) + public function getNonWithdrawingCustomers(array $criteria = []): array { $criteria['Status'] = [ CustomerStatus::PROVISIONAL, diff --git a/src/Eccube/Repository/DeliveryRepository.php b/src/Eccube/Repository/DeliveryRepository.php index ae3c14bc18d..ed03c44b007 100644 --- a/src/Eccube/Repository/DeliveryRepository.php +++ b/src/Eccube/Repository/DeliveryRepository.php @@ -40,7 +40,7 @@ public function __construct(RegistryInterface $registry) * * @return array */ - public function getDeliveries($saleTypes) + public function getDeliveries($saleTypes): array { $deliveries = $this->createQueryBuilder('d') ->where('d.SaleType in (:saleTypes)') @@ -62,7 +62,7 @@ public function getDeliveries($saleTypes) * * @return array */ - public function findAllowedDeliveries($saleTypes, $payments) + public function findAllowedDeliveries($saleTypes, $payments): array { $d = $this->getDeliveries($saleTypes); $arr = []; diff --git a/src/Eccube/Repository/LayoutRepository.php b/src/Eccube/Repository/LayoutRepository.php index 6c9bc905aa3..1db76a42508 100644 --- a/src/Eccube/Repository/LayoutRepository.php +++ b/src/Eccube/Repository/LayoutRepository.php @@ -35,11 +35,11 @@ public function __construct(RegistryInterface $registry) /** * @param int|string $id * - * @return float|int|mixed|string|null + * @return Layout|null * * @throws \Doctrine\ORM\NonUniqueResultException */ - public function get($id) + public function get($id): ?Layout { try { $Layout = $this->createQueryBuilder('l') diff --git a/src/Eccube/Repository/LoginHistoryRepository.php b/src/Eccube/Repository/LoginHistoryRepository.php index 710f8448e6c..1e6607170cc 100644 --- a/src/Eccube/Repository/LoginHistoryRepository.php +++ b/src/Eccube/Repository/LoginHistoryRepository.php @@ -49,7 +49,7 @@ public function __construct( * * @return \Doctrine\ORM\QueryBuilder */ - public function getQueryBuilderBySearchDataForAdmin($searchData) + public function getQueryBuilderBySearchDataForAdmin($searchData): \Doctrine\ORM\QueryBuilder { $qb = $this->createQueryBuilder('lh') ->select('lh'); diff --git a/src/Eccube/Repository/MailHistoryRepository.php b/src/Eccube/Repository/MailHistoryRepository.php index 6b0ade196e7..c254566bb7d 100644 --- a/src/Eccube/Repository/MailHistoryRepository.php +++ b/src/Eccube/Repository/MailHistoryRepository.php @@ -49,7 +49,7 @@ public function __construct(RegistryInterface $registry) * @throws NoResultException * @throws NonUniqueResultException */ - public function getByCustomerAndId(Customer $Customer, $id) + public function getByCustomerAndId(Customer $Customer, $id): MailHistory { $qb = $this->createQueryBuilder('mh') ->leftJoin('mh.Order', 'o') diff --git a/src/Eccube/Repository/Master/OrderStatusRepository.php b/src/Eccube/Repository/Master/OrderStatusRepository.php index 50e053399dc..e06848e9d9d 100644 --- a/src/Eccube/Repository/Master/OrderStatusRepository.php +++ b/src/Eccube/Repository/Master/OrderStatusRepository.php @@ -53,7 +53,7 @@ public function __construct(RegistryInterface $registry) * * @see EntityRepository::findBy() */ - public function findNotContainsBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) + public function findNotContainsBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { $qb = $this->createQueryBuilder('o'); @@ -87,7 +87,7 @@ public function findNotContainsBy(array $criteria, ?array $orderBy = null, $limi * * @return array> */ - public function findAllArray() + public function findAllArray(): array { $query = $this ->getEntityManager() diff --git a/src/Eccube/Repository/MemberRepository.php b/src/Eccube/Repository/MemberRepository.php index 72c56cf5758..8e731a21805 100644 --- a/src/Eccube/Repository/MemberRepository.php +++ b/src/Eccube/Repository/MemberRepository.php @@ -42,7 +42,7 @@ public function __construct(RegistryInterface $registry) * * @throws \Exception 更新対象のユーザより上位のユーザが存在しない場合. */ - public function up(Member $Member) + public function up(Member $Member): void { $sortNo = $Member->getSortNo(); $Member2 = $this->findOneBy(['sort_no' => $sortNo + 1]); @@ -69,7 +69,7 @@ public function up(Member $Member) * * @throws \Exception 更新対象のユーザより下位のユーザが存在しない場合. */ - public function down(Member $Member) + public function down(Member $Member): void { $sortNo = $Member->getSortNo(); $Member2 = $this->findOneBy(['sort_no' => $sortNo - 1]); @@ -98,7 +98,7 @@ public function down(Member $Member) * @throws NonUniqueResultException */ #[\Override] - public function save($Member) + public function save($Member): void { if (!$Member->getId()) { $sortNo = $this->createQueryBuilder('m') @@ -122,7 +122,7 @@ public function save($Member) * @return void */ #[\Override] - public function delete($Member) + public function delete($Member): void { $this->createQueryBuilder('m') ->update() diff --git a/src/Eccube/Repository/NewsRepository.php b/src/Eccube/Repository/NewsRepository.php index de4343fa5c2..ba96f369a76 100644 --- a/src/Eccube/Repository/NewsRepository.php +++ b/src/Eccube/Repository/NewsRepository.php @@ -41,7 +41,7 @@ public function __construct(RegistryInterface $registry) * @return void */ #[\Override] - public function save($News) + public function save($News): void { $em = $this->getEntityManager(); $em->persist($News); @@ -56,7 +56,7 @@ public function save($News) * @return void */ #[\Override] - public function delete($News) + public function delete($News): void { $em = $this->getEntityManager(); $em->remove($News); @@ -66,7 +66,7 @@ public function delete($News) /** * @return \Doctrine\ORM\QueryBuilder */ - public function getQueryBuilderAll() + public function getQueryBuilderAll(): \Doctrine\ORM\QueryBuilder { $qb = $this->createQueryBuilder('n'); $qb->orderBy('n.publish_date', 'DESC') @@ -78,7 +78,7 @@ public function getQueryBuilderAll() /** * @return ArrayCollection */ - public function getList() + public function getList(): ArrayCollection { // second level cacheを効かせるためfindByで取得 $Results = $this->findBy(['visible' => true], ['publish_date' => 'DESC', 'id' => 'DESC']); diff --git a/src/Eccube/Repository/OrderPdfRepository.php b/src/Eccube/Repository/OrderPdfRepository.php index c0199b3cfbc..375eda085ce 100644 --- a/src/Eccube/Repository/OrderPdfRepository.php +++ b/src/Eccube/Repository/OrderPdfRepository.php @@ -37,11 +37,9 @@ public function __construct(RegistryInterface $registry) * Save admin history. * * @param AbstractEntity|array $arrData - * - * @return bool */ #[\Override] - public function save($arrData) + public function save($arrData): void { /** * @var Member $Member @@ -64,7 +62,5 @@ public function save($arrData) ->setVisible(true); $this->getEntityManager()->persist($OrderPdf); $this->getEntityManager()->flush(); - - return true; } } diff --git a/src/Eccube/Repository/OrderRepository.php b/src/Eccube/Repository/OrderRepository.php index 9f7d58f4e3b..e11fdef9834 100644 --- a/src/Eccube/Repository/OrderRepository.php +++ b/src/Eccube/Repository/OrderRepository.php @@ -63,7 +63,7 @@ public function __construct(RegistryInterface $registry, Queries $queries) * * @return void */ - public function changeStatus($orderId, OrderStatus $Status) + public function changeStatus($orderId, OrderStatus $Status): void { $Order = $this ->find($orderId) @@ -124,7 +124,7 @@ public function changeStatus($orderId, OrderStatus $Status) * * @return QueryBuilder */ - public function getQueryBuilderBySearchDataForAdmin($searchData) + public function getQueryBuilderBySearchDataForAdmin($searchData): QueryBuilder { $qb = $this->createQueryBuilder('o') ->select('o, s') @@ -421,7 +421,7 @@ public function getQueryBuilderBySearchDataForAdmin($searchData) * * @return QueryBuilder */ - public function getQueryBuilderByCustomer(Customer $Customer) + public function getQueryBuilderByCustomer(Customer $Customer): QueryBuilder { $qb = $this->createQueryBuilder('o') ->where('o.Customer = :Customer') @@ -443,7 +443,7 @@ public function getQueryBuilderByCustomer(Customer $Customer) * @throws NoResultException * @throws NonUniqueResultException */ - public function countByOrderStatus($OrderStatusOrId) + public function countByOrderStatus($OrderStatusOrId): int { return (int) $this->createQueryBuilder('o') ->select('COALESCE(COUNT(o.id), 0)') @@ -463,7 +463,7 @@ public function countByOrderStatus($OrderStatusOrId) * * @throws NonUniqueResultException */ - public function updateOrderSummary(Customer $Customer, array $OrderStatuses = [OrderStatus::NEW, OrderStatus::PAID, OrderStatus::DELIVERED, OrderStatus::IN_PROGRESS]) + public function updateOrderSummary(Customer $Customer, array $OrderStatuses = [OrderStatus::NEW, OrderStatus::PAID, OrderStatus::DELIVERED, OrderStatus::IN_PROGRESS]): void { try { $result = $this->createQueryBuilder('o') diff --git a/src/Eccube/Repository/PageRepository.php b/src/Eccube/Repository/PageRepository.php index a2e11cfaecf..0d0f9b49464 100644 --- a/src/Eccube/Repository/PageRepository.php +++ b/src/Eccube/Repository/PageRepository.php @@ -74,7 +74,7 @@ public function __construct(RegistryInterface $registry, EccubeConfig $eccubeCon * * @return Page */ - public function getPageByRoute($route) + public function getPageByRoute($route): Page { $qb = $this->createQueryBuilder('p'); @@ -103,7 +103,7 @@ public function getPageByRoute($route) * @throws NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - public function getByUrl($url) + public function getByUrl($url): Page { $qb = $this->createQueryBuilder('p'); $Page = $qb->select('p') @@ -119,7 +119,7 @@ public function getByUrl($url) /** * @return Page */ - public function newPage() + public function newPage(): Page { $Page = new Page(); $Page->setEditType(Page::EDIT_TYPE_USER); @@ -137,7 +137,7 @@ public function newPage() * * @return array ページ属性の配列 */ - public function getPageList($where = null, $parameters = []) + public function getPageList($where = null, $parameters = []): array { $qb = $this->createQueryBuilder('p') ->andWhere('p.id <> 0') diff --git a/src/Eccube/Repository/PaymentRepository.php b/src/Eccube/Repository/PaymentRepository.php index d075df55883..c07e679dfc8 100644 --- a/src/Eccube/Repository/PaymentRepository.php +++ b/src/Eccube/Repository/PaymentRepository.php @@ -41,7 +41,7 @@ public function __construct(RegistryInterface $registry) /** * @return array> */ - public function findAllArray() + public function findAllArray(): array { $query = $this ->getEntityManager() @@ -61,7 +61,7 @@ public function findAllArray() * * @return array */ - public function findPayments($delivery, $returnType = false) + public function findPayments($delivery, $returnType = false): array { $query = $this->createQueryBuilder('p') ->innerJoin(\Eccube\Entity\PaymentOption::class, 'po', 'WITH', 'po.payment_id = p.id') @@ -89,7 +89,7 @@ public function findPayments($delivery, $returnType = false) * * @return array */ - public function findAllowedPayments($deliveries, $returnType = false) + public function findAllowedPayments($deliveries, $returnType = false): array { $payments = []; $saleTypes = []; diff --git a/src/Eccube/Repository/PluginRepository.php b/src/Eccube/Repository/PluginRepository.php index 5394a4b4d66..803a25b334c 100644 --- a/src/Eccube/Repository/PluginRepository.php +++ b/src/Eccube/Repository/PluginRepository.php @@ -34,7 +34,7 @@ public function __construct(RegistryInterface $registry) /** * @return array */ - public function findAllEnabled() + public function findAllEnabled(): array { return $this->findBy(['enabled' => '1']); } @@ -48,7 +48,7 @@ public function findAllEnabled() * * @return Plugin|null */ - public function findByCode($code) + public function findByCode($code): ?Plugin { $qb = $this->createQueryBuilder('p') ->where('LOWER(p.code) = :code') diff --git a/src/Eccube/Repository/ProductRepository.php b/src/Eccube/Repository/ProductRepository.php index 8231a5d601e..2e50f7c7cae 100644 --- a/src/Eccube/Repository/ProductRepository.php +++ b/src/Eccube/Repository/ProductRepository.php @@ -74,7 +74,7 @@ public function __construct( * * @return Product|null */ - public function findWithSortedClassCategories($productId) + public function findWithSortedClassCategories($productId): ?Product { $qb = $this->createQueryBuilder('p'); $qb->addSelect(['pc', 'cc1', 'cc2', 'pi', 'pt']) @@ -105,7 +105,7 @@ public function findWithSortedClassCategories($productId) * * @return ArrayCollection|array|null */ - public function findProductsWithSortedClassCategories(array $ids, $indexBy = null) + public function findProductsWithSortedClassCategories(array $ids, $indexBy = null): ArrayCollection|array|null { if (count($ids) < 1) { return []; @@ -147,7 +147,7 @@ public function findProductsWithSortedClassCategories(array $ids, $indexBy = nul * * @return \Doctrine\ORM\QueryBuilder */ - public function getQueryBuilderBySearchData($searchData) + public function getQueryBuilderBySearchData($searchData): \Doctrine\ORM\QueryBuilder { $qb = $this->createQueryBuilder('p') ->andWhere('p.Status = 1'); @@ -248,7 +248,7 @@ public function getQueryBuilderBySearchData($searchData) * * @return \Doctrine\ORM\QueryBuilder */ - public function getQueryBuilderBySearchDataForAdmin($searchData) + public function getQueryBuilderBySearchDataForAdmin($searchData): \Doctrine\ORM\QueryBuilder { $qb = $this->createQueryBuilder('p') ->addSelect('pc', 'pi', 'tr', 'ps') diff --git a/src/Eccube/Repository/ShippingRepository.php b/src/Eccube/Repository/ShippingRepository.php index bac2f57a613..8acd9d10914 100644 --- a/src/Eccube/Repository/ShippingRepository.php +++ b/src/Eccube/Repository/ShippingRepository.php @@ -39,7 +39,7 @@ public function __construct(RegistryInterface $registry) * * @return Shipping[] */ - public function findShippingsProduct($Order, $productClass) + public function findShippingsProduct($Order, $productClass): array { $shippings = $this->createQueryBuilder('s') ->innerJoin(\Eccube\Entity\OrderItem::class, 'si', 'WITH', 'si.Shipping = s.id') diff --git a/src/Eccube/Repository/TagRepository.php b/src/Eccube/Repository/TagRepository.php index 7f14cf50657..994ce6a5f85 100644 --- a/src/Eccube/Repository/TagRepository.php +++ b/src/Eccube/Repository/TagRepository.php @@ -37,7 +37,7 @@ public function __construct(RegistryInterface $registry) * @param Tag $tag タグ */ #[\Override] - public function save($tag) + public function save($tag): void { if (!$tag->getId()) { $sortNoTop = $this->findOneBy([], ['sort_no' => 'DESC']); @@ -59,7 +59,7 @@ public function save($tag) * * @return Tag[] タグの配列 */ - public function getList() + public function getList(): array { $qb = $this->createQueryBuilder('t')->orderBy('t.sort_no', 'DESC'); @@ -72,7 +72,7 @@ public function getList() * @param Tag $Tag 削除対象のタグ */ #[\Override] - public function delete($Tag) + public function delete($Tag): void { $em = $this->getEntityManager(); $em->beginTransaction(); diff --git a/src/Eccube/Repository/TaxRuleRepository.php b/src/Eccube/Repository/TaxRuleRepository.php index 5c1cd4aee14..feebe7a7eb3 100644 --- a/src/Eccube/Repository/TaxRuleRepository.php +++ b/src/Eccube/Repository/TaxRuleRepository.php @@ -82,7 +82,7 @@ public function __construct( * * @return TaxRule */ - public function newTaxRule() + public function newTaxRule(): TaxRule { /** @var RoundingType $RoundingType */ $RoundingType = $this->getEntityManager()->getRepository(RoundingType::class)->find(RoundingType::ROUND); @@ -111,7 +111,7 @@ public function newTaxRule() * * @throws NoResultException */ - public function getByRule($Product = null, $ProductClass = null, $Pref = null, $Country = null) + public function getByRule($Product = null, $ProductClass = null, $Pref = null, $Country = null): TaxRule { // Pref Country 設定 if (!$Pref && !$Country && $this->tokenStorage->getToken() && $this->authorizationChecker->isGranted('ROLE_USER')) { @@ -253,7 +253,7 @@ public function getByRule($Product = null, $ProductClass = null, $Pref = null, $ * * @return TaxRule[]|null */ - public function getList() + public function getList(): ?array { $qb = $this->createQueryBuilder('t') ->orderBy('t.apply_date', 'DESC') @@ -273,7 +273,7 @@ public function getList() * @throws NoResultException */ #[\Override] - public function delete($TaxRule) + public function delete($TaxRule): void { if (!$TaxRule instanceof TaxRule) { $TaxRule = $this->find($TaxRule); @@ -294,7 +294,7 @@ public function delete($TaxRule) * * @return void */ - public function clearCache() + public function clearCache(): void { $this->rules = []; } diff --git a/src/Eccube/Request/Context.php b/src/Eccube/Request/Context.php index 0446441b006..1bda457af8a 100644 --- a/src/Eccube/Request/Context.php +++ b/src/Eccube/Request/Context.php @@ -47,7 +47,7 @@ public function __construct(RequestStack $requestStack, EccubeConfig $eccubeConf * * @return bool */ - public function isAdmin() + public function isAdmin(): bool { $request = $this->requestStack->getMainRequest(); @@ -67,7 +67,7 @@ public function isAdmin() * * @return bool */ - public function isFront() + public function isFront(): bool { $request = $this->requestStack->getMainRequest(); @@ -81,7 +81,7 @@ public function isFront() /** * @return UserInterface|null */ - public function getCurrentUser() + public function getCurrentUser(): ?UserInterface { $request = $this->requestStack->getMainRequest(); diff --git a/src/Eccube/Security/Core/Encoder/PasswordEncoder.php b/src/Eccube/Security/Core/Encoder/PasswordEncoder.php index f498dc5e6bc..dd9cdce31aa 100644 --- a/src/Eccube/Security/Core/Encoder/PasswordEncoder.php +++ b/src/Eccube/Security/Core/Encoder/PasswordEncoder.php @@ -46,7 +46,7 @@ public function __construct(EccubeConfig $eccubeConfig) * * @return void */ - public function setAuthMagic($authMagic) + public function setAuthMagic($authMagic): void { $this->auth_magic = $authMagic; } @@ -60,7 +60,7 @@ public function setAuthMagic($authMagic) * * @return bool true if the password is valid, false otherwise */ - public function isPasswordValid($encoded, $raw, $salt) + public function isPasswordValid($encoded, $raw, $salt): bool { if ($encoded == '') { return false; @@ -94,7 +94,7 @@ public function isPasswordValid($encoded, $raw, $salt) * * @return string The encoded password */ - public function encodePassword($raw, $salt) + public function encodePassword($raw, $salt): string { if ($salt == '') { $salt = $this->auth_magic; @@ -123,7 +123,7 @@ public function needsRehash(string $encoded): bool * * @return string */ - public function createSalt($length = 5) + public function createSalt($length = 5): string { return bin2hex(openssl_random_pseudo_bytes($length)); } diff --git a/src/Eccube/Security/Http/Authentication/EccubeLogoutSuccessHandler.php b/src/Eccube/Security/Http/Authentication/EccubeLogoutSuccessHandler.php index f0c27ed5425..da0dac07bd3 100644 --- a/src/Eccube/Security/Http/Authentication/EccubeLogoutSuccessHandler.php +++ b/src/Eccube/Security/Http/Authentication/EccubeLogoutSuccessHandler.php @@ -31,7 +31,7 @@ public function __construct(Context $context) /** * @return void */ - public function onLogout(LogoutEvent $event) + public function onLogout(LogoutEvent $event): void { if ($this->context->isAdmin()) { $response = $event->getResponse(); @@ -43,7 +43,7 @@ public function onLogout(LogoutEvent $event) * @return array */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [LogoutEvent::class => 'onLogout']; } diff --git a/src/Eccube/Service/Calculator/OrderItemCollection.php b/src/Eccube/Service/Calculator/OrderItemCollection.php index d9ab3e41560..3240b9630a9 100644 --- a/src/Eccube/Service/Calculator/OrderItemCollection.php +++ b/src/Eccube/Service/Calculator/OrderItemCollection.php @@ -45,7 +45,7 @@ public function __construct($OrderItems, $type = null) * * @return mixed|null */ - public function reduce(\Closure $func, $initial = null) + public function reduce(\Closure $func, $initial = null): mixed { return array_reduce($this->toArray(), $func, $initial); } @@ -55,7 +55,7 @@ public function reduce(\Closure $func, $initial = null) * * @return \Doctrine\Common\Collections\ArrayCollection */ - public function getProductClasses() + public function getProductClasses(): \Doctrine\Common\Collections\ArrayCollection { return $this->filter( function (ItemInterface $OrderItem) { @@ -66,7 +66,7 @@ function (ItemInterface $OrderItem) { /** * @return \Doctrine\Common\Collections\ArrayCollection */ - public function getDeliveryFees() + public function getDeliveryFees(): \Doctrine\Common\Collections\ArrayCollection { return $this->filter( function (ItemInterface $OrderItem) { @@ -77,7 +77,7 @@ function (ItemInterface $OrderItem) { /** * @return \Doctrine\Common\Collections\ArrayCollection */ - public function getCharges() + public function getCharges(): \Doctrine\Common\Collections\ArrayCollection { return $this->filter( function (ItemInterface $OrderItem) { @@ -88,7 +88,7 @@ function (ItemInterface $OrderItem) { /** * @return \Doctrine\Common\Collections\ArrayCollection */ - public function getDiscounts() + public function getDiscounts(): \Doctrine\Common\Collections\ArrayCollection { return $this->filter( function (ItemInterface $OrderItem) { @@ -105,7 +105,7 @@ function (ItemInterface $OrderItem) { * * @return bool */ - public function hasProductByName($productName) + public function hasProductByName($productName): bool { $OrderItems = $this->filter( function (ItemInterface $OrderItem) use ($productName) { @@ -123,7 +123,7 @@ function (ItemInterface $OrderItem) use ($productName) { * * @return bool */ - public function hasItemByOrderItemType($OrderItemType) + public function hasItemByOrderItemType($OrderItemType): bool { $filteredItems = $this->filter(function (ItemInterface $OrderItem) use ($OrderItemType) { /* @var OrderItem $OrderItem */ @@ -134,9 +134,9 @@ public function hasItemByOrderItemType($OrderItemType) } /** - * @return mixed|string + * @return string */ - public function getType() + public function getType(): string { return $this->type; } diff --git a/src/Eccube/Service/Cart/CartItemAllocator.php b/src/Eccube/Service/Cart/CartItemAllocator.php index 0235fa5c261..929414eb87f 100644 --- a/src/Eccube/Service/Cart/CartItemAllocator.php +++ b/src/Eccube/Service/Cart/CartItemAllocator.php @@ -27,5 +27,5 @@ interface CartItemAllocator * * @return string */ - public function allocate(CartItem $Item); + public function allocate(CartItem $Item): string; } diff --git a/src/Eccube/Service/Cart/CartItemComparator.php b/src/Eccube/Service/Cart/CartItemComparator.php index 0e827adc622..d1d4cadaf7e 100644 --- a/src/Eccube/Service/Cart/CartItemComparator.php +++ b/src/Eccube/Service/Cart/CartItemComparator.php @@ -26,5 +26,5 @@ interface CartItemComparator * * @return bool 同じ明細になる場合はtrue */ - public function compare(CartItem $item1, CartItem $item2); + public function compare(CartItem $item1, CartItem $item2): bool; } diff --git a/src/Eccube/Service/Cart/ProductClassComparator.php b/src/Eccube/Service/Cart/ProductClassComparator.php index 6bcba56f37b..d52aaa7d141 100644 --- a/src/Eccube/Service/Cart/ProductClassComparator.php +++ b/src/Eccube/Service/Cart/ProductClassComparator.php @@ -27,7 +27,7 @@ class ProductClassComparator implements CartItemComparator * @return bool 同じ明細になる場合はtrue */ #[\Override] - public function compare(CartItem $Item1, CartItem $Item2) + public function compare(CartItem $Item1, CartItem $Item2): bool { $ProductClass1 = $Item1->getProductClass(); $ProductClass2 = $Item2->getProductClass(); diff --git a/src/Eccube/Service/Cart/SaleTypeCartAllocator.php b/src/Eccube/Service/Cart/SaleTypeCartAllocator.php index 4f1a6b1ae9a..949d4eb5347 100644 --- a/src/Eccube/Service/Cart/SaleTypeCartAllocator.php +++ b/src/Eccube/Service/Cart/SaleTypeCartAllocator.php @@ -28,7 +28,7 @@ class SaleTypeCartAllocator implements CartItemAllocator * @return string */ #[\Override] - public function allocate(CartItem $Item) + public function allocate(CartItem $Item): string { $ProductClass = $Item->getProductClass(); if ($ProductClass && $ProductClass->getSaleType()) { diff --git a/src/Eccube/Service/CartService.php b/src/Eccube/Service/CartService.php index 5987dfb7871..e6def018eeb 100644 --- a/src/Eccube/Service/CartService.php +++ b/src/Eccube/Service/CartService.php @@ -123,7 +123,7 @@ public function __construct( * * @return Cart[] */ - public function getCarts($empty_delete = false) + public function getCarts($empty_delete = false): array { if (null !== $this->carts) { if ($empty_delete) { @@ -159,7 +159,7 @@ public function getCarts($empty_delete = false) * * @return Cart[] */ - public function getPersistedCarts() + public function getPersistedCarts(): array { return $this->cartRepository->findBy(['Customer' => $this->getUser()]); } @@ -169,7 +169,7 @@ public function getPersistedCarts() * * @return Cart[] */ - public function getSessionCarts() + public function getSessionCarts(): array { $cartKeys = $this->session->get('cart_keys', []); @@ -185,7 +185,7 @@ public function getSessionCarts() * * @return void */ - public function mergeFromPersistedCart() + public function mergeFromPersistedCart(): void { $persistedCarts = $this->getPersistedCarts(); $sessionCarts = $this->getSessionCarts(); @@ -211,7 +211,7 @@ public function mergeFromPersistedCart() /** * @return Cart|null */ - public function getCart() + public function getCart(): ?Cart { $Carts = $this->getCarts(); @@ -240,7 +240,7 @@ public function getCart() * * @return CartItem[] */ - protected function mergeAllCartItems($cartItems = []) + protected function mergeAllCartItems($cartItems = []): array { /** @var CartItem[] $allCartItems */ $allCartItems = []; @@ -258,7 +258,7 @@ protected function mergeAllCartItems($cartItems = []) * * @return array */ - protected function mergeCartItems($cartItems, $allCartItems) + protected function mergeCartItems($cartItems, $allCartItems): array { foreach ($cartItems as $item) { $itemExists = false; @@ -283,7 +283,7 @@ protected function mergeCartItems($cartItems, $allCartItems) * * @return void */ - protected function restoreCarts($cartItems) + protected function restoreCarts($cartItems): void { foreach ($this->getCarts() as $Cart) { foreach ($Cart->getCartItems() as $i) { @@ -338,7 +338,7 @@ protected function restoreCarts($cartItems) * * @return bool 商品を追加できた場合はtrue */ - public function addProduct($ProductClass, $quantity = '1') + public function addProduct($ProductClass, $quantity = '1'): bool { if (!$ProductClass instanceof ProductClass) { $ProductClassId = $ProductClass; @@ -375,7 +375,7 @@ public function addProduct($ProductClass, $quantity = '1') * * @return bool */ - public function removeProduct($ProductClass) + public function removeProduct($ProductClass): bool { if (!$ProductClass instanceof ProductClass) { $ProductClassId = $ProductClass; @@ -409,7 +409,7 @@ public function removeProduct($ProductClass) /** * @return void */ - public function save() + public function save(): void { $cartKeys = []; foreach ($this->carts as $Cart) { @@ -432,7 +432,7 @@ public function save() * * @return CartService */ - public function setPreOrderId($pre_order_id) + public function setPreOrderId($pre_order_id): CartService { $this->getCart()->setPreOrderId($pre_order_id); @@ -442,7 +442,7 @@ public function setPreOrderId($pre_order_id) /** * @return string|null */ - public function getPreOrderId() + public function getPreOrderId(): ?string { $Cart = $this->getCart(); if (!empty($Cart)) { @@ -455,7 +455,7 @@ public function getPreOrderId() /** * @return CartService */ - public function clear() + public function clear(): CartService { $Carts = $this->getCarts(); if (!empty($Carts)) { @@ -487,7 +487,7 @@ public function clear() * * @return void */ - public function setCartItemComparator($cartItemComparator) + public function setCartItemComparator($cartItemComparator): void { $this->cartItemComparator = $cartItemComparator; } @@ -499,7 +499,7 @@ public function setCartItemComparator($cartItemComparator) * * @return void */ - public function setPrimary($cartKey) + public function setPrimary($cartKey): void { $Carts = $this->getCarts(); $primary = $Carts[0]; @@ -519,17 +519,17 @@ public function setPrimary($cartKey) } /** - * @return \Symfony\Component\Security\Core\User\UserInterface|void|null + * @return \Symfony\Component\Security\Core\User\UserInterface|null */ - protected function getUser() + protected function getUser(): ?\Symfony\Component\Security\Core\User\UserInterface { if (null === $token = $this->tokenStorage->getToken()) { - return; + return null; } if (!is_object($user = $token->getUser())) { // e.g. anonymous authentication - return; + return null; } return $user; @@ -541,7 +541,7 @@ protected function getUser() * * @return string */ - protected function createCartKey($allocatedId, ?Customer $Customer = null) + protected function createCartKey($allocatedId, ?Customer $Customer = null): string { if ($Customer instanceof Customer) { return $Customer->getId().'_'.$allocatedId; diff --git a/src/Eccube/Service/Composer/ComposerApiService.php b/src/Eccube/Service/Composer/ComposerApiService.php index 2d72fda6ca6..27a867d9db8 100644 --- a/src/Eccube/Service/Composer/ComposerApiService.php +++ b/src/Eccube/Service/Composer/ComposerApiService.php @@ -80,7 +80,7 @@ public function __construct( * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - public function execInfo($pluginName, $version) + public function execInfo($pluginName, $version): array { $output = $this->runCommand([ 'command' => 'info', @@ -106,7 +106,7 @@ public function execInfo($pluginName, $version) * @throws \Doctrine\ORM\NonUniqueResultException */ #[\Override] - public function execRequire($packageName, $output = null, $from = null) + public function execRequire($packageName, $output = null, $from = null): string { $packageName = explode(' ', trim($packageName)); @@ -142,7 +142,7 @@ public function execRequire($packageName, $output = null, $from = null) * @throws \Doctrine\ORM\NonUniqueResultException */ #[\Override] - public function execRemove($packageName, $output = null) + public function execRemove($packageName, $output = null): string { $this->dropTableToExtra($packageName); @@ -178,7 +178,7 @@ public function execRemove($packageName, $output = null) * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - public function execUpdate($dryRun, $output = null) + public function execUpdate($dryRun, $output = null): void { $this->init(); $this->execConfig('allow-plugins.symfony/flex', ['false']); @@ -209,7 +209,7 @@ public function execUpdate($dryRun, $output = null) * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - public function execInstall($dryRun, $output = null) + public function execInstall($dryRun, $output = null): void { $this->init(); $this->execConfig('allow-plugins.symfony/flex', ['false']); @@ -271,14 +271,14 @@ public function foreachRequires($packageName, $version, $callback, $typeFilter = * @param string $key * @param string[]|null $value * - * @return array>|mixed + * @return array>|null * * @throws PluginException * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ #[\Override] - public function execConfig($key, $value = null) + public function execConfig($key, $value = null): ?array { $commands = [ 'command' => 'config', @@ -303,7 +303,7 @@ public function execConfig($key, $value = null) * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - public function getConfig() + public function getConfig(): array { $output = $this->runCommand([ 'command' => 'config', @@ -320,7 +320,7 @@ public function getConfig() * * @return void */ - public function setWorkingDir($workingDir) + public function setWorkingDir($workingDir): void { $this->workingDir = $workingDir; } @@ -339,7 +339,7 @@ public function setWorkingDir($workingDir) * @throws \Doctrine\ORM\NonUniqueResultException * @throws \Exception */ - public function runCommand($commands, $output = null, $init = true) + public function runCommand($commands, $output = null, $init = true): ?string { if ($init) { $this->init(); @@ -391,7 +391,7 @@ public function runCommand($commands, $output = null, $init = true) * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - private function init($BaseInfo = null, $packageName = [], $from = null) + private function init($BaseInfo = null, $packageName = [], $from = null): void { $BaseInfo = $BaseInfo ?: $this->baseInfoRepository->get(); @@ -450,7 +450,7 @@ function ($package) { /** * @return void */ - private function initConsole() + private function initConsole(): void { $consoleApplication = new Application(); $consoleApplication->resetComposer(); @@ -482,7 +482,7 @@ public function configureRepository(BaseInfo $BaseInfo): void * @throws \Doctrine\Persistence\Mapping\MappingException * @throws \ReflectionException */ - private function dropTableToExtra($packageNames) + private function dropTableToExtra($packageNames): void { $projectRoot = $this->eccubeConfig->get('kernel.project_dir'); diff --git a/src/Eccube/Service/Composer/ComposerProcessService.php b/src/Eccube/Service/Composer/ComposerProcessService.php index ba5c87e11ec..38851b813a7 100644 --- a/src/Eccube/Service/Composer/ComposerProcessService.php +++ b/src/Eccube/Service/Composer/ComposerProcessService.php @@ -61,7 +61,7 @@ public function __construct(EccubeConfig $eccubeConfig, EntityManagerInterface $ } #[\Override] - public function execRequire($packageName, $output = null) + public function execRequire($packageName, $output = null): string { return $this->runCommand([ 'eccube:composer:require', @@ -70,7 +70,7 @@ public function execRequire($packageName, $output = null) } #[\Override] - public function execRemove($packageName, $output = null) + public function execRemove($packageName, $output = null): string { return $this->runCommand([ 'eccube:composer:remove', @@ -87,7 +87,7 @@ public function execRemove($packageName, $output = null) * * @throws PluginException */ - public function runCommand($commands, $output = null, $init = true) + public function runCommand($commands, $output = null, $init = true): string { if ($init) { $this->init(); @@ -123,7 +123,7 @@ public function runCommand($commands, $output = null, $init = true) * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - private function init($BaseInfo = null) + private function init($BaseInfo = null): void { // /** // * Mysql lock in transaction @@ -146,10 +146,10 @@ private function init($BaseInfo = null) * @param string $key * @param string[]|null $value * - * @return array>|mixed + * @return array>|null */ #[\Override] - public function execConfig($key, $value = null) + public function execConfig($key, $value = null): ?array { return $this->composerApiService->execConfig($key, $value); } diff --git a/src/Eccube/Service/Composer/ComposerServiceFactory.php b/src/Eccube/Service/Composer/ComposerServiceFactory.php index 66f23807e65..bedc37a8f12 100644 --- a/src/Eccube/Service/Composer/ComposerServiceFactory.php +++ b/src/Eccube/Service/Composer/ComposerServiceFactory.php @@ -20,9 +20,9 @@ class ComposerServiceFactory /** * @param ContainerInterface $container * - * @return ComposerApiService|object|null + * @return ComposerApiService|null */ - public static function createService(ContainerInterface $container) + public static function createService(ContainerInterface $container): ?ComposerApiService { return $container->get(ComposerApiService::class); } diff --git a/src/Eccube/Service/Composer/ComposerServiceInterface.php b/src/Eccube/Service/Composer/ComposerServiceInterface.php index f96eec6dc28..d8f4261efd6 100644 --- a/src/Eccube/Service/Composer/ComposerServiceInterface.php +++ b/src/Eccube/Service/Composer/ComposerServiceInterface.php @@ -28,7 +28,7 @@ interface ComposerServiceInterface * * @return string */ - public function execRequire($packageName, $output = null); + public function execRequire($packageName, $output = null): string; /** * Run remove command @@ -38,22 +38,22 @@ public function execRequire($packageName, $output = null); * * @return string */ - public function execRemove($packageName, $output = null); + public function execRemove($packageName, $output = null): string; /** * @param string $key * @param string|null $value * - * @return mixed + * @return array>|null */ - public function execConfig($key, $value = null); + public function execConfig($key, $value = null): ?array; /** * @param BaseInfo $BaseInfo * * @return void */ - public function configureRepository(BaseInfo $BaseInfo); + public function configureRepository(BaseInfo $BaseInfo): void; /** * @param string $packageName @@ -64,5 +64,5 @@ public function configureRepository(BaseInfo $BaseInfo); * * @return void */ - public function foreachRequires($packageName, $version, $callback, $typeFilter = null, $level = 0); + public function foreachRequires($packageName, $version, $callback, $typeFilter = null, $level = 0): void; } diff --git a/src/Eccube/Service/Composer/OutputParser.php b/src/Eccube/Service/Composer/OutputParser.php index b653f16f56b..e34851815e6 100644 --- a/src/Eccube/Service/Composer/OutputParser.php +++ b/src/Eccube/Service/Composer/OutputParser.php @@ -25,7 +25,7 @@ class OutputParser * * @return array> */ - public static function parseRequire($output) + public static function parseRequire($output): array { $rowArray = explode(PHP_EOL, str_replace('\r\n', PHP_EOL, $output)); $installedLogs = array_filter( @@ -51,7 +51,7 @@ function ($line) { * * @return array|string> */ - public static function parseInfo($output) + public static function parseInfo($output): array { $rowArray = explode(PHP_EOL, str_replace('\r\n', PHP_EOL, $output)); $infoLogs = array_filter(array_map(function ($line) { @@ -74,9 +74,9 @@ public static function parseInfo($output) * * @param string $output * - * @return array|mixed + * @return array>|null */ - public static function parseConfig($output) + public static function parseConfig($output): ?array { $rowArray = explode(PHP_EOL, str_replace('\r\n', PHP_EOL, $output)); $rowArray = array_filter($rowArray, function ($line) { @@ -93,7 +93,7 @@ public static function parseConfig($output) * * @return array */ - public static function parseList($output) + public static function parseList($output): array { $rowArray = explode(PHP_EOL, str_replace('\r\n', PHP_EOL, $output)); $rawConfig = array_map(function ($line) { @@ -125,7 +125,7 @@ public static function parseList($output) * * @return array */ - private static function parseArrayInfoOutput($rowArray, $key) + private static function parseArrayInfoOutput($rowArray, $key): array { $result = []; $start = false; @@ -151,9 +151,9 @@ private static function parseArrayInfoOutput($rowArray, $key) * * @param string $output * - * @return array|mixed|string + * @return string|null */ - public static function parseComposerVersion($output) + public static function parseComposerVersion($output): ?string { $rowArray = explode(PHP_EOL, str_replace('\r\n', PHP_EOL, $output)); $rowArray = array_filter($rowArray, function ($line) { diff --git a/src/Eccube/Service/CsvExportService.php b/src/Eccube/Service/CsvExportService.php index 625fe65161a..9cbcf900c12 100644 --- a/src/Eccube/Service/CsvExportService.php +++ b/src/Eccube/Service/CsvExportService.php @@ -158,7 +158,7 @@ public function __construct( * * @return void */ - public function setConfig($config) + public function setConfig($config): void { $this->eccubeConfig = $config; } @@ -168,7 +168,7 @@ public function setConfig($config) * * @return void */ - public function setCsvRepository(CsvRepository $csvRepository) + public function setCsvRepository(CsvRepository $csvRepository): void { $this->csvRepository = $csvRepository; } @@ -178,7 +178,7 @@ public function setCsvRepository(CsvRepository $csvRepository) * * @return void */ - public function setCsvTypeRepository(CsvTypeRepository $csvTypeRepository) + public function setCsvTypeRepository(CsvTypeRepository $csvTypeRepository): void { $this->csvTypeRepository = $csvTypeRepository; } @@ -188,7 +188,7 @@ public function setCsvTypeRepository(CsvTypeRepository $csvTypeRepository) * * @return void */ - public function setOrderRepository(OrderRepository $orderRepository) + public function setOrderRepository(OrderRepository $orderRepository): void { $this->orderRepository = $orderRepository; } @@ -198,7 +198,7 @@ public function setOrderRepository(OrderRepository $orderRepository) * * @return void */ - public function setCustomerRepository(CustomerRepository $customerRepository) + public function setCustomerRepository(CustomerRepository $customerRepository): void { $this->customerRepository = $customerRepository; } @@ -208,7 +208,7 @@ public function setCustomerRepository(CustomerRepository $customerRepository) * * @return void */ - public function setProductRepository(ProductRepository $productRepository) + public function setProductRepository(ProductRepository $productRepository): void { $this->productRepository = $productRepository; } @@ -218,7 +218,7 @@ public function setProductRepository(ProductRepository $productRepository) * * @return void */ - public function setEntityManager(EntityManagerInterface $entityManager) + public function setEntityManager(EntityManagerInterface $entityManager): void { $this->entityManager = $entityManager; } @@ -226,7 +226,7 @@ public function setEntityManager(EntityManagerInterface $entityManager) /** * @return EntityManagerInterface */ - public function getEntityManager() + public function getEntityManager(): EntityManagerInterface { return $this->entityManager; } @@ -236,7 +236,7 @@ public function getEntityManager() * * @return void */ - public function setExportQueryBuilder(QueryBuilder $qb) + public function setExportQueryBuilder(QueryBuilder $qb): void { $this->qb = $qb; } @@ -248,7 +248,7 @@ public function setExportQueryBuilder(QueryBuilder $qb) * * @return void */ - public function initCsvType($CsvType) + public function initCsvType($CsvType): void { if ($CsvType instanceof CsvType) { $this->CsvType = $CsvType; @@ -269,7 +269,7 @@ public function initCsvType($CsvType) /** * @return Csv[] */ - public function getCsvs() + public function getCsvs(): array { return $this->Csvs; } @@ -280,7 +280,7 @@ public function getCsvs() * * @return void */ - public function exportHeader() + public function exportHeader(): void { if (is_null($this->CsvType) || is_null($this->Csvs)) { throw new \LogicException('init csv type incomplete.'); @@ -304,7 +304,7 @@ public function exportHeader() * * @return void */ - public function exportData(\Closure $closure) + public function exportData(\Closure $closure): void { if (is_null($this->qb) || is_null($this->entityManager)) { throw new \LogicException('query builder not set.'); @@ -340,7 +340,7 @@ public function exportData(\Closure $closure) * * @return string|null */ - public function getData(Csv $Csv, AbstractEntity $entity) + public function getData(Csv $Csv, AbstractEntity $entity): ?string { // エンティティ名が一致するかどうかチェック. $csvEntityName = str_replace('\\\\', '\\', $Csv->getEntityName()); @@ -385,7 +385,7 @@ public function getData(Csv $Csv, AbstractEntity $entity) * * @return \Closure */ - public function getConvertEncodingCallback() + public function getConvertEncodingCallback(): \Closure { $config = $this->eccubeConfig; @@ -399,7 +399,7 @@ public function getConvertEncodingCallback() /** * @return void */ - public function fopen() + public function fopen(): void { if (is_null($this->fp) || $this->closed) { $this->fp = fopen('php://output', 'w'); @@ -411,7 +411,7 @@ public function fopen() * * @return void */ - public function fputcsv($row) + public function fputcsv($row): void { if (is_null($this->convertEncodingCallBack)) { $this->convertEncodingCallBack = $this->getConvertEncodingCallback(); @@ -423,7 +423,7 @@ public function fputcsv($row) /** * @return void */ - public function fclose() + public function fclose(): void { if (!$this->closed) { fclose($this->fp); @@ -438,7 +438,7 @@ public function fclose() * * @return QueryBuilder */ - public function getOrderQueryBuilder(Request $request) + public function getOrderQueryBuilder(Request $request): QueryBuilder { $session = $request->getSession(); $builder = $this->formFactory @@ -462,7 +462,7 @@ public function getOrderQueryBuilder(Request $request) * * @return QueryBuilder */ - public function getCustomerQueryBuilder(Request $request) + public function getCustomerQueryBuilder(Request $request): QueryBuilder { $session = $request->getSession(); $builder = $this->formFactory @@ -486,7 +486,7 @@ public function getCustomerQueryBuilder(Request $request) * * @return QueryBuilder */ - public function getProductQueryBuilder(Request $request) + public function getProductQueryBuilder(Request $request): QueryBuilder { $session = $request->getSession(); $builder = $this->formFactory diff --git a/src/Eccube/Service/CsvImportService.php b/src/Eccube/Service/CsvImportService.php index 6c37d048f19..9d2f60956dd 100644 --- a/src/Eccube/Service/CsvImportService.php +++ b/src/Eccube/Service/CsvImportService.php @@ -141,7 +141,7 @@ public function __construct(\SplFileObject $file, $delimiter = ',', $enclosure = */ #[\ReturnTypeWillChange] #[\Override] - public function current() + public function current(): ?array { // If the CSV has no column headers just return the line if (empty($this->columnHeaders)) { @@ -175,7 +175,7 @@ public function current() * * @return array */ - public function getColumnHeaders() + public function getColumnHeaders(): array { return array_keys($this->columnHeaders); } @@ -187,7 +187,7 @@ public function getColumnHeaders() * * @return void */ - public function setColumnHeaders(array $columnHeaders) + public function setColumnHeaders(array $columnHeaders): void { $this->columnHeaders = array_count_values($columnHeaders); $this->headersCount = count($columnHeaders); @@ -206,7 +206,7 @@ public function setColumnHeaders(array $columnHeaders) * * @return bool */ - public function setHeaderRowNumber($rowNumber, $duplicates = null) + public function setHeaderRowNumber($rowNumber, $duplicates = null): bool { $this->duplicateHeadersFlag = $duplicates; $this->headerRowNumber = $rowNumber; @@ -231,7 +231,7 @@ public function setHeaderRowNumber($rowNumber, $duplicates = null) */ #[\ReturnTypeWillChange] #[\Override] - public function rewind() + public function rewind(): void { $this->file->rewind(); if (null !== $this->headerRowNumber) { @@ -244,7 +244,7 @@ public function rewind() */ #[\ReturnTypeWillChange] #[\Override] - public function count() + public function count(): int { if (null === $this->count) { $position = $this->key(); @@ -292,7 +292,7 @@ public function key() */ #[\ReturnTypeWillChange] #[\Override] - public function seek($pointer) + public function seek($pointer): void { $this->file->seek($pointer); } @@ -300,7 +300,7 @@ public function seek($pointer) /** * @return array */ - public function getFields() + public function getFields(): array { return $this->getColumnHeaders(); } @@ -312,7 +312,7 @@ public function getFields() * * @return array|null */ - public function getRow($number) + public function getRow($number): ?array { $this->seek($number); @@ -324,7 +324,7 @@ public function getRow($number) * * @return array */ - public function getErrors() + public function getErrors(): array { if (0 === $this->key()) { // Iterator has not yet been processed, so do that now @@ -340,7 +340,7 @@ public function getErrors() * * @return bool */ - public function hasErrors() + public function hasErrors(): bool { return count($this->getErrors()) > 0; } @@ -382,7 +382,7 @@ public static function applyStreamFilter(\SplFileObject $file, string ...$filter * * @return array|string|false */ - protected function readHeaderRow($rowNumber) + protected function readHeaderRow($rowNumber): array|string|false { $this->file->seek($rowNumber); $headers = $this->file->current(); @@ -404,7 +404,7 @@ protected function readHeaderRow($rowNumber) * * @return array */ - protected function incrementHeaders(array $headers) + protected function incrementHeaders(array $headers): array { $incrementedHeaders = []; foreach (array_count_values($headers) as $header => $count) { @@ -435,7 +435,7 @@ protected function incrementHeaders(array $headers) * * @return array */ - protected function mergeDuplicates(array $line) + protected function mergeDuplicates(array $line): array { $values = []; diff --git a/src/Eccube/Service/EntityProxyService.php b/src/Eccube/Service/EntityProxyService.php index b5cfcc3abd4..108cb469fec 100644 --- a/src/Eccube/Service/EntityProxyService.php +++ b/src/Eccube/Service/EntityProxyService.php @@ -61,7 +61,7 @@ public function __construct( * * @throws \ReflectionException */ - public function generate($includesDirs, $excludeDirs, $outputDir, ?OutputInterface $output = null) + public function generate($includesDirs, $excludeDirs, $outputDir, ?OutputInterface $output = null): array { if (is_null($output)) { $output = new ConsoleOutput(); @@ -158,7 +158,7 @@ private function originalEntityPath(string $entityClassName): string * * @throws \ReflectionException */ - private function scanTraits($dirSets) + private function scanTraits($dirSets): array { // ディレクトリセットごとのファイルをロードしつつ一覧を作成 $includedFileSets = []; @@ -223,7 +223,7 @@ private function scanTraits($dirSets) * * @return void */ - private function addTrait($entityTokens, $trait) + private function addTrait($entityTokens, $trait): void { $newTraitTokens = $this->convertTraitNameToTokens($trait); @@ -267,7 +267,7 @@ private function addTrait($entityTokens, $trait) * * @return void */ - private function removeTrait($entityTokens, $trait) + private function removeTrait($entityTokens, $trait): void { $useTraitIndex = $entityTokens->getNextTokenOfKind(0, [[CT::T_USE_TRAIT]]); if ($useTraitIndex > 0) { @@ -309,7 +309,7 @@ private function removeTrait($entityTokens, $trait) * * @return array|Token[] */ - private function convertTraitNameToTokens($name) + private function convertTraitNameToTokens($name): array { $result = []; $i = 0; @@ -336,7 +336,7 @@ private function convertTraitNameToTokens($name) * * @return void */ - private function removeClassExistsBlock(Tokens $entityTokens) + private function removeClassExistsBlock(Tokens $entityTokens): void { $startIndex = $entityTokens->getNextTokenOfKind(0, [[T_IF]]); $classIndex = $entityTokens->getNextTokenOfKind(0, [[T_CLASS]]); diff --git a/src/Eccube/Service/MailService.php b/src/Eccube/Service/MailService.php index 9ed94328348..eeccd042eb0 100644 --- a/src/Eccube/Service/MailService.php +++ b/src/Eccube/Service/MailService.php @@ -114,7 +114,7 @@ public function __construct( * @throws RuntimeError * @throws SyntaxError */ - public function sendCustomerConfirmMail(Customer $Customer, $activateUrl) + public function sendCustomerConfirmMail(Customer $Customer, $activateUrl): void { log_info('仮会員登録メール送信開始'); @@ -180,7 +180,7 @@ public function sendCustomerConfirmMail(Customer $Customer, $activateUrl) * @throws RuntimeError * @throws SyntaxError */ - public function sendCustomerCompleteMail(Customer $Customer) + public function sendCustomerCompleteMail(Customer $Customer): void { log_info('会員登録完了メール送信開始'); @@ -244,7 +244,7 @@ public function sendCustomerCompleteMail(Customer $Customer) * @throws RuntimeError * @throws SyntaxError */ - public function sendCustomerWithdrawMail(Customer $Customer, string $email) + public function sendCustomerWithdrawMail(Customer $Customer, string $email): void { log_info('退会手続き完了メール送信開始'); @@ -308,7 +308,7 @@ public function sendCustomerWithdrawMail(Customer $Customer, string $email) * @throws RuntimeError * @throws SyntaxError */ - public function sendContactMail($formData) + public function sendContactMail($formData): void { log_info('お問い合わせ受付メール送信開始'); @@ -368,7 +368,7 @@ public function sendContactMail($formData) * * @return Email */ - public function sendOrderMail(Order $Order) + public function sendOrderMail(Order $Order): Email { log_info('受注メール送信開始'); @@ -448,7 +448,7 @@ public function sendOrderMail(Order $Order) * @throws RuntimeError * @throws SyntaxError */ - public function sendAdminCustomerConfirmMail(Customer $Customer, $activateUrl) + public function sendAdminCustomerConfirmMail(Customer $Customer, $activateUrl): void { log_info('仮会員登録再送メール送信開始'); @@ -518,7 +518,7 @@ public function sendAdminCustomerConfirmMail(Customer $Customer, $activateUrl) * @throws RuntimeError When an error occurred during rendering * @throws TransportExceptionInterface */ - public function sendAdminOrderMail(Order $Order, $formData) + public function sendAdminOrderMail(Order $Order, $formData): Email { log_info('受注管理通知メール送信開始'); @@ -564,7 +564,7 @@ public function sendAdminOrderMail(Order $Order, $formData) * @throws RuntimeError * @throws SyntaxError */ - public function sendPasswordResetNotificationMail(Customer $Customer, $reset_url) + public function sendPasswordResetNotificationMail(Customer $Customer, $reset_url): void { log_info('パスワード再発行メール送信開始'); @@ -632,7 +632,7 @@ public function sendPasswordResetNotificationMail(Customer $Customer, $reset_url * @throws RuntimeError * @throws SyntaxError */ - public function sendPasswordResetCompleteMail(Customer $Customer, $password) + public function sendPasswordResetCompleteMail(Customer $Customer, $password): void { log_info('パスワード変更完了メール送信開始'); @@ -699,7 +699,7 @@ public function sendPasswordResetCompleteMail(Customer $Customer, $password) * @throws SyntaxError When an error occurred during compilation * @throws RuntimeError When an error occurred during rendering */ - public function sendShippingNotifyMail(Shipping $Shipping) + public function sendShippingNotifyMail(Shipping $Shipping): void { log_info('出荷通知メール送信処理開始', ['id' => $Shipping->getId()]); @@ -764,7 +764,7 @@ public function sendShippingNotifyMail(Shipping $Shipping) * @throws SyntaxError When an error occurred during compilation * @throws RuntimeError When an error occurred during rendering */ - public function getShippingNotifyMailBody(Shipping $Shipping, Order $Order, $templateName = null, $is_html = false) + public function getShippingNotifyMailBody(Shipping $Shipping, Order $Order, $templateName = null, $is_html = false): string { /** @var OrderItem[] $OrderItems */ $OrderItems = $Shipping->getOrderItems()->toArray(); @@ -806,7 +806,7 @@ public function getShippingNotifyMailBody(Shipping $Shipping, Order $Order, $tem * @throws RuntimeError * @throws SyntaxError */ - public function sendCustomerChangeNotifyMail(Customer $Customer, array $userData, string $eventName) + public function sendCustomerChangeNotifyMail(Customer $Customer, array $userData, string $eventName): void { log_info('会員情報変更通知メール送信処理開始'); log_info($eventName); @@ -881,7 +881,7 @@ public function sendCustomerChangeNotifyMail(Customer $Customer, array $userData * * @return string|null 存在する場合はファイル名を返す */ - public function getHtmlTemplate($templateName) + public function getHtmlTemplate($templateName): ?string { // メールテンプレート名からHTMLメール用テンプレート名を生成 $fileName = explode('.', $templateName); diff --git a/src/Eccube/Service/OrderHelper.php b/src/Eccube/Service/OrderHelper.php index d869ea23c47..b7b923d5967 100644 --- a/src/Eccube/Service/OrderHelper.php +++ b/src/Eccube/Service/OrderHelper.php @@ -161,7 +161,7 @@ public function __construct( * * @return Order */ - public function createPurchaseProcessingOrder(Cart $Cart, Customer $Customer) + public function createPurchaseProcessingOrder(Cart $Cart, Customer $Customer): Order { $OrderStatus = $this->orderStatusRepository->find(OrderStatus::PROCESSING); $Order = new Order($OrderStatus); @@ -206,7 +206,7 @@ public function createPurchaseProcessingOrder(Cart $Cart, Customer $Customer) * * @return bool */ - public function verifyCart(Cart $Cart) + public function verifyCart(Cart $Cart): bool { if (count($Cart->getCartItems()) > 0) { $divide = $this->session->get(self::SESSION_CART_DIVIDE_FLAG); @@ -229,7 +229,7 @@ public function verifyCart(Cart $Cart) * * @return bool */ - public function isLoginRequired() + public function isLoginRequired(): bool { // フォームログイン済はログイン不要 if ($this->isGranted('IS_AUTHENTICATED_FULLY')) { @@ -256,7 +256,7 @@ public function isLoginRequired() * * @return Order|null */ - public function getPurchaseProcessingOrder($preOrderId = null) + public function getPurchaseProcessingOrder($preOrderId = null): ?Order { if (null === $preOrderId) { return null; @@ -276,7 +276,7 @@ public function getPurchaseProcessingOrder($preOrderId = null) * * @return Customer|null */ - public function getNonMember($session_key = self::SESSION_NON_MEMBER) + public function getNonMember($session_key = self::SESSION_NON_MEMBER): ?Customer { $data = $this->session->get($session_key); if (empty($data)) { @@ -309,7 +309,7 @@ public function getNonMember($session_key = self::SESSION_NON_MEMBER) * * @return Order|null */ - public function initializeOrder(Cart $Cart, Customer $Customer) + public function initializeOrder(Cart $Cart, Customer $Customer): ?Order { // 購入処理中の受注情報を取得 if ($Order = $this->getPurchaseProcessingOrder($Cart->getPreOrderId())) { @@ -326,7 +326,7 @@ public function initializeOrder(Cart $Cart, Customer $Customer) /** * @return void */ - public function removeSession() + public function removeSession(): void { $this->session->remove(self::SESSION_ORDER_ID); $this->session->remove(self::SESSION_NON_MEMBER); @@ -341,7 +341,7 @@ public function removeSession() * * @return void */ - public function updateCustomerInfo(Order $Order, Customer $Customer) + public function updateCustomerInfo(Order $Order, Customer $Customer): void { if ($Order->getCreateDate() < $Customer->getUpdateDate()) { $this->setCustomer($Order, $Customer); @@ -351,7 +351,7 @@ public function updateCustomerInfo(Order $Order, Customer $Customer) /** * @return string */ - public function createPreOrderId() + public function createPreOrderId(): string { // ランダムなpre_order_idを作成 do { @@ -373,7 +373,7 @@ public function createPreOrderId() * * @return void */ - protected function setCustomer(Order $Order, Customer $Customer) + protected function setCustomer(Order $Order, Customer $Customer): void { if ($Customer->getId()) { $Order->setCustomer($Customer); @@ -395,7 +395,7 @@ protected function setCustomer(Order $Order, Customer $Customer) * * @return OrderItem[] */ - protected function createOrderItemsFromCartItems($CartItems) + protected function createOrderItemsFromCartItems($CartItems): array { $ProductItemType = $this->orderItemTypeRepository->find(OrderItemType::PRODUCT); @@ -436,7 +436,7 @@ protected function createOrderItemsFromCartItems($CartItems) * * @return Shipping */ - protected function createShippingFromCustomer(Customer $Customer) + protected function createShippingFromCustomer(Customer $Customer): Shipping { $Shipping = new Shipping(); $Shipping @@ -459,7 +459,7 @@ protected function createShippingFromCustomer(Customer $Customer) * * @return void */ - protected function setDefaultDelivery(Shipping $Shipping) + protected function setDefaultDelivery(Shipping $Shipping): void { // 配送商品に含まれる販売種別を抽出. $OrderItems = $Shipping->getOrderItems(); @@ -485,7 +485,7 @@ protected function setDefaultDelivery(Shipping $Shipping) * * @return void */ - protected function setDefaultPayment(Order $Order) + protected function setDefaultPayment(Order $Order): void { $OrderItems = $Order->getOrderItems(); @@ -524,7 +524,7 @@ protected function setDefaultPayment(Order $Order) * * @return void */ - protected function addOrderItems(Order $Order, Shipping $Shipping, array $OrderItems) + protected function addOrderItems(Order $Order, Shipping $Shipping, array $OrderItems): void { foreach ($OrderItems as $OrderItem) { $Shipping->addOrderItem($OrderItem); @@ -580,7 +580,7 @@ private function getUser(): ?UserInterface * * @return TaxDisplayType */ - public function getTaxDisplayType($OrderItemType) + public function getTaxDisplayType($OrderItemType): TaxDisplayType { if ($OrderItemType instanceof OrderItemType) { $OrderItemType = $OrderItemType->getId(); diff --git a/src/Eccube/Service/OrderPdfService.php b/src/Eccube/Service/OrderPdfService.php index 0755392b672..be133995ae3 100644 --- a/src/Eccube/Service/OrderPdfService.php +++ b/src/Eccube/Service/OrderPdfService.php @@ -202,7 +202,7 @@ public function __construct(EccubeConfig $eccubeConfig, OrderRepository $orderRe * @throws PdfReaderException * @throws PdfTypeException */ - public function makePdf(array $formData) + public function makePdf(array $formData): bool { // 発行日の設定 $this->issueDate = '作成日: '.$formData['issue_date']->format('Y年m月d日'); @@ -266,9 +266,9 @@ public function makePdf(array $formData) /** * PDFファイルを出力する. * - * @return string|mixed + * @return string */ - public function outputPdf() + public function outputPdf(): string { return $this->Output($this->getPdfFileName(), 'S'); } @@ -279,7 +279,7 @@ public function outputPdf() * * @return string ファイル名 */ - public function getPdfFileName() + public function getPdfFileName(): string { if (!is_null($this->downloadFileName)) { return $this->downloadFileName; @@ -298,7 +298,7 @@ public function getPdfFileName() * @return void */ #[\Override] - public function Footer() + public function Footer(): void { $this->Cell(0, 0, $this->issueDate, 0, 0, 'R'); } @@ -314,7 +314,7 @@ public function Footer() * @throws PdfTypeException * @throws PdfReaderException */ - protected function addPdfPage() + protected function addPdfPage(): void { // ページを追加 $this->AddPage(); @@ -333,7 +333,7 @@ protected function addPdfPage() * * @return void */ - protected function renderShopData() + protected function renderShopData(): void { // 基準座標を設定する $this->setBasePosition(); @@ -385,7 +385,7 @@ protected function renderShopData() * * @return void */ - protected function renderMessageData(array $formData) + protected function renderMessageData(array $formData): void { $this->lfText(27, 70, $formData['message1'], 8); // メッセージ1 $this->lfText(27, 74, $formData['message2'], 8); // メッセージ2 @@ -399,7 +399,7 @@ protected function renderMessageData(array $formData) * * @return void */ - protected function renderEtcData(array $formData) + protected function renderEtcData(array $formData): void { // フォント情報のバックアップ $this->backupFont(); @@ -431,7 +431,7 @@ protected function renderEtcData(array $formData) * * @return void */ - protected function renderTitle($title) + protected function renderTitle($title): void { // 基準座標を設定する $this->setBasePosition(); @@ -456,7 +456,7 @@ protected function renderTitle($title) * * @return void */ - protected function renderOrderData(Shipping $Shipping) + protected function renderOrderData(Shipping $Shipping): void { // 基準座標を設定する $this->setBasePosition(); @@ -533,7 +533,7 @@ protected function renderOrderData(Shipping $Shipping) * * @return void */ - protected function renderOrderDetailData(Shipping $Shipping) + protected function renderOrderDetailData(Shipping $Shipping): void { $arrOrder = []; // テーブルの微調整を行うための購入商品詳細情報をarrayに変換する @@ -697,7 +697,7 @@ protected function renderOrderDetailData(Shipping $Shipping) * * @return void */ - protected function lfText($x, $y, $text, $size = 0, $style = '') + protected function lfText($x, $y, $text, $size = 0, $style = ''): void { // 退避 $bakFontStyle = $this->FontStyle; @@ -719,7 +719,7 @@ protected function lfText($x, $y, $text, $size = 0, $style = '') * * @return void */ - protected function setFancyTable($header, $data, $w) + protected function setFancyTable($header, $data, $w): void { // フォント情報のバックアップ $this->backupFont(); @@ -818,7 +818,7 @@ protected function setFancyTable($header, $data, $w) * * @return void */ - protected function setBasePosition($x = null, $y = null) + protected function setBasePosition($x = null, $y = null): void { // 現在のマージンを取得する $result = $this->getMargins(); @@ -835,7 +835,7 @@ protected function setBasePosition($x = null, $y = null) * * @return void */ - protected function backupFont() + protected function backupFont(): void { // フォント情報のバックアップ $this->bakFontFamily = $this->FontFamily; @@ -848,7 +848,7 @@ protected function backupFont() * * @return void */ - protected function restoreFont() + protected function restoreFont(): void { $this->SetFont($this->bakFontFamily, $this->bakFontStyle, $this->bakFontSize); } diff --git a/src/Eccube/Service/OrderStateMachine.php b/src/Eccube/Service/OrderStateMachine.php index 507515ef5ed..ec657752227 100644 --- a/src/Eccube/Service/OrderStateMachine.php +++ b/src/Eccube/Service/OrderStateMachine.php @@ -60,7 +60,7 @@ public function __construct(WorkflowInterface $_orderStateMachine, OrderStatusRe * * @return void */ - public function apply(Order $Order, OrderStatus $OrderStatus) + public function apply(Order $Order, OrderStatus $OrderStatus): void { $context = $this->newContext($Order); $transition = $this->getTransition($context, $OrderStatus); @@ -79,7 +79,7 @@ public function apply(Order $Order, OrderStatus $OrderStatus) * * @return bool 指定ステータスに遷移できる場合はtrue */ - public function can(Order $Order, OrderStatus $OrderStatus) + public function can(Order $Order, OrderStatus $OrderStatus): bool { return !is_null($this->getTransition($this->newContext($Order), $OrderStatus)); } @@ -88,9 +88,9 @@ public function can(Order $Order, OrderStatus $OrderStatus) * @param OrderStateMachineContext $context * @param OrderStatus $OrderStatus * - * @return mixed|\Symfony\Component\Workflow\Transition|null + * @return \Symfony\Component\Workflow\Transition|null */ - private function getTransition(OrderStateMachineContext $context, OrderStatus $OrderStatus) + private function getTransition(OrderStateMachineContext $context, OrderStatus $OrderStatus): ?\Symfony\Component\Workflow\Transition { $transitions = $this->machine->getEnabledTransitions($context); foreach ($transitions as $t) { @@ -106,7 +106,7 @@ private function getTransition(OrderStateMachineContext $context, OrderStatus $O * {@inheritdoc} */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ 'workflow.order.completed' => ['onCompleted'], @@ -130,7 +130,7 @@ public static function getSubscribedEvents() * * @return void */ - public function updatePaymentDate(Event $event) + public function updatePaymentDate(Event $event): void { /* @var Order $Order */ $Order = $event->getSubject()->getOrder(); @@ -146,7 +146,7 @@ public function updatePaymentDate(Event $event) * * @throws PurchaseFlow\PurchaseException */ - public function commitUsePoint(Event $event) + public function commitUsePoint(Event $event): void { /* @var Order $Order */ $Order = $event->getSubject()->getOrder(); @@ -160,7 +160,7 @@ public function commitUsePoint(Event $event) * * @return void */ - public function rollbackUsePoint(Event $event) + public function rollbackUsePoint(Event $event): void { /* @var Order $Order */ $Order = $event->getSubject()->getOrder(); @@ -176,7 +176,7 @@ public function rollbackUsePoint(Event $event) * * @throws PurchaseFlow\PurchaseException */ - public function commitStock(Event $event) + public function commitStock(Event $event): void { /* @var Order $Order */ $Order = $event->getSubject()->getOrder(); @@ -190,7 +190,7 @@ public function commitStock(Event $event) * * @return void */ - public function rollbackStock(Event $event) + public function rollbackStock(Event $event): void { /* @var Order $Order */ $Order = $event->getSubject()->getOrder(); @@ -204,7 +204,7 @@ public function rollbackStock(Event $event) * * @return void */ - public function commitAddPoint(Event $event) + public function commitAddPoint(Event $event): void { /* @var Order $Order */ $Order = $event->getSubject()->getOrder(); @@ -221,7 +221,7 @@ public function commitAddPoint(Event $event) * * @return void */ - public function rollbackAddPoint(Event $event) + public function rollbackAddPoint(Event $event): void { /* @var Order $Order */ $Order = $event->getSubject()->getOrder(); @@ -239,7 +239,7 @@ public function rollbackAddPoint(Event $event) * * @return void */ - public function onCompleted(Event $event) + public function onCompleted(Event $event): void { /** @var OrderStateMachineContext $context */ $context = $event->getSubject(); @@ -253,7 +253,7 @@ public function onCompleted(Event $event) * * @return OrderStateMachineContext */ - private function newContext(Order $Order) + private function newContext(Order $Order): OrderStateMachineContext { return new OrderStateMachineContext((string) $Order->getOrderStatus()->getId(), $Order); } @@ -282,7 +282,7 @@ public function __construct($status, Order $Order) /** * @return string */ - public function getStatus() + public function getStatus(): string { return $this->status; } @@ -292,7 +292,7 @@ public function getStatus() * * @return void */ - public function setStatus($status) + public function setStatus($status): void { $this->status = $status; } @@ -300,7 +300,7 @@ public function setStatus($status) /** * @return Order */ - public function getOrder() + public function getOrder(): Order { return $this->Order; } diff --git a/src/Eccube/Service/Payment/Method/Cash.php b/src/Eccube/Service/Payment/Method/Cash.php index a2c98effb0f..64c9a6cf1c5 100644 --- a/src/Eccube/Service/Payment/Method/Cash.php +++ b/src/Eccube/Service/Payment/Method/Cash.php @@ -14,6 +14,7 @@ namespace Eccube\Service\Payment\Method; use Eccube\Entity\Order; +use Eccube\Service\Payment\PaymentDispatcher; use Eccube\Service\Payment\PaymentMethodInterface; use Eccube\Service\Payment\PaymentResult; use Eccube\Service\PurchaseFlow\PurchaseContext; @@ -50,7 +51,7 @@ public function __construct(PurchaseFlow $shoppingPurchaseFlow) * @throws \Eccube\Service\PurchaseFlow\PurchaseException */ #[\Override] - public function checkout() + public function checkout(): PaymentResult { $this->purchaseFlow->commit($this->Order, new PurchaseContext()); @@ -66,7 +67,7 @@ public function checkout() * @throws \Eccube\Service\PurchaseFlow\PurchaseException */ #[\Override] - public function apply() + public function apply(): PaymentDispatcher|bool { $this->purchaseFlow->prepare($this->Order, new PurchaseContext()); @@ -77,7 +78,7 @@ public function apply() * {@inheritdoc} */ #[\Override] - public function setFormType(FormInterface $form) + public function setFormType(FormInterface $form): PaymentMethodInterface { $this->form = $form; @@ -87,7 +88,7 @@ public function setFormType(FormInterface $form) /** * @return FormInterface */ - public function getFormType() + public function getFormType(): FormInterface { return $this->form; } @@ -96,7 +97,7 @@ public function getFormType() * {@inheritdoc} */ #[\Override] - public function verify() + public function verify(): PaymentResult|bool { return false; } @@ -105,7 +106,7 @@ public function verify() * {@inheritdoc} */ #[\Override] - public function setOrder(Order $Order) + public function setOrder(Order $Order): PaymentMethodInterface { $this->Order = $Order; diff --git a/src/Eccube/Service/Payment/Method/CreditCard.php b/src/Eccube/Service/Payment/Method/CreditCard.php index 14b65dfbde5..84fd3e7230e 100644 --- a/src/Eccube/Service/Payment/Method/CreditCard.php +++ b/src/Eccube/Service/Payment/Method/CreditCard.php @@ -14,7 +14,9 @@ namespace Eccube\Service\Payment\Method; use Eccube\Entity\Order; +use Eccube\Service\Payment\PaymentDispatcher; use Eccube\Service\Payment\PaymentMethodInterface; +use Eccube\Service\Payment\PaymentResult; use Symfony\Component\Form\FormInterface; /** @@ -33,31 +35,31 @@ abstract class CreditCard implements PaymentMethodInterface * {@inheritdoc} */ #[\Override] - abstract public function verify(); + abstract public function verify(): PaymentResult|bool; /** * {@inheritdoc} */ #[\Override] - abstract public function checkout(); + abstract public function checkout(): PaymentResult; /** * {@inheritdoc} */ #[\Override] - abstract public function apply(); + abstract public function apply(): PaymentDispatcher|bool; /** * {@inheritdoc} */ #[\Override] - abstract public function setFormType(FormInterface $form); + abstract public function setFormType(FormInterface $form): PaymentMethodInterface; /** * {@inheritdoc} */ #[\Override] - public function setOrder(Order $Order) + public function setOrder(Order $Order): PaymentMethodInterface { $this->Order = $Order; diff --git a/src/Eccube/Service/Payment/PaymentDispatcher.php b/src/Eccube/Service/Payment/PaymentDispatcher.php index f19cb9277b6..8a0e86876ec 100644 --- a/src/Eccube/Service/Payment/PaymentDispatcher.php +++ b/src/Eccube/Service/Payment/PaymentDispatcher.php @@ -50,7 +50,7 @@ class PaymentDispatcher * * @return bool */ - public function isForward() + public function isForward(): bool { return $this->forward; } @@ -64,7 +64,7 @@ public function isForward() * * @return self */ - public function setForward($forward) + public function setForward($forward): PaymentDispatcher { $this->forward = $forward; @@ -76,7 +76,7 @@ public function setForward($forward) * * @return string */ - public function getRoute() + public function getRoute(): string { return $this->route; } @@ -88,7 +88,7 @@ public function getRoute() * * @return self */ - public function setRoute($route) + public function setRoute($route): PaymentDispatcher { $this->route = $route; @@ -100,7 +100,7 @@ public function setRoute($route) * * @return array */ - public function getQueryParameters() + public function getQueryParameters(): array { return $this->queryParameters; } @@ -112,7 +112,7 @@ public function getQueryParameters() * * @return self */ - public function setQueryParameters(array $queryParameters) + public function setQueryParameters(array $queryParameters): PaymentDispatcher { $this->queryParameters = $queryParameters; @@ -124,7 +124,7 @@ public function setQueryParameters(array $queryParameters) * * @return array */ - public function getPathParameters() + public function getPathParameters(): array { return $this->pathParameters; } @@ -136,7 +136,7 @@ public function getPathParameters() * * @return PaymentDispatcher */ - public function setPathParameters(array $pathParameters) + public function setPathParameters(array $pathParameters): PaymentDispatcher { $this->pathParameters = $pathParameters; @@ -152,7 +152,7 @@ public function setPathParameters(array $pathParameters) * * @return self */ - public function setResponse(Response $response) + public function setResponse(Response $response): PaymentDispatcher { $this->response = $response; @@ -164,7 +164,7 @@ public function setResponse(Response $response) * * @return Response */ - public function getResponse() + public function getResponse(): Response { return $this->response; } diff --git a/src/Eccube/Service/Payment/PaymentMethodInterface.php b/src/Eccube/Service/Payment/PaymentMethodInterface.php index 39011ed3322..2e0b2c0364d 100644 --- a/src/Eccube/Service/Payment/PaymentMethodInterface.php +++ b/src/Eccube/Service/Payment/PaymentMethodInterface.php @@ -30,7 +30,7 @@ interface PaymentMethodInterface * * @return PaymentResult|bool */ - public function verify(); + public function verify(): PaymentResult|bool; /** * 決済を実行し, 実行結果を返します. @@ -39,7 +39,7 @@ public function verify(); * * @return PaymentResult */ - public function checkout(); + public function checkout(): PaymentResult; /** * 注文に決済を適用します. @@ -48,7 +48,7 @@ public function checkout(); * * @return PaymentDispatcher|bool */ - public function apply(); + public function apply(): PaymentDispatcher|bool; /** * PaymentMethod の処理に必要な FormInterface を設定します. @@ -57,7 +57,7 @@ public function apply(); * * @return self */ - public function setFormType(FormInterface $form); + public function setFormType(FormInterface $form): PaymentMethodInterface; /** * この決済を使用する Order を設定します. @@ -66,5 +66,5 @@ public function setFormType(FormInterface $form); * * @return self */ - public function setOrder(Order $Order); + public function setOrder(Order $Order): PaymentMethodInterface; } diff --git a/src/Eccube/Service/Payment/PaymentResult.php b/src/Eccube/Service/Payment/PaymentResult.php index c0f44632b3f..21425261c09 100644 --- a/src/Eccube/Service/Payment/PaymentResult.php +++ b/src/Eccube/Service/Payment/PaymentResult.php @@ -44,7 +44,7 @@ class PaymentResult * * @return PaymentResult */ - public function setSuccess($success) + public function setSuccess($success): PaymentResult { $this->success = $success; @@ -58,7 +58,7 @@ public function setSuccess($success) * * @return bool */ - public function isSuccess() + public function isSuccess(): bool { return $this->success; } @@ -68,7 +68,7 @@ public function isSuccess() * * @return array */ - public function getErrors() + public function getErrors(): array { return $this->errors; } @@ -80,7 +80,7 @@ public function getErrors() * * @return PaymentResult */ - public function setErrors(array $errors) + public function setErrors(array $errors): PaymentResult { $this->errors = $errors; @@ -96,7 +96,7 @@ public function setErrors(array $errors) * * @return PaymentResult */ - public function setResponse(Response $response) + public function setResponse(Response $response): PaymentResult { $this->response = $response; @@ -106,9 +106,9 @@ public function setResponse(Response $response) /** * Response を返します. * - * @return Response + * @return Response|null */ - public function getResponse() + public function getResponse(): ?Response { return $this->response; } diff --git a/src/Eccube/Service/PluginApiService.php b/src/Eccube/Service/PluginApiService.php index e8372dda0f3..0c4d1ed0f33 100644 --- a/src/Eccube/Service/PluginApiService.php +++ b/src/Eccube/Service/PluginApiService.php @@ -72,7 +72,7 @@ public function __construct(EccubeConfig $eccubeConfig, RequestStack $requestSta /** * @return string */ - public function getApiUrl() + public function getApiUrl(): string { if (empty($this->apiUrl)) { return $this->eccubeConfig->get('eccube_package_api_url'); @@ -86,7 +86,7 @@ public function getApiUrl() * * @return void */ - public function setApiUrl($apiUrl) + public function setApiUrl($apiUrl): void { $this->apiUrl = $apiUrl; } @@ -96,7 +96,7 @@ public function setApiUrl($apiUrl) * * @return string|bool|array> */ - public function getCategory() + public function getCategory(): string|bool|array { try { $urlCategory = $this->getApiUrl().'/category'; @@ -116,7 +116,7 @@ public function getCategory() * * @throws PluginApiException */ - public function getPlugins($data) + public function getPlugins($data): array { $url = $this->getApiUrl().'/plugins'; $params['category_id'] = $data['category_id']; @@ -143,7 +143,7 @@ public function getPlugins($data) * * @throws PluginApiException */ - public function getPurchased() + public function getPurchased(): array { $url = $this->getApiUrl().'/plugins/purchased'; @@ -160,7 +160,7 @@ public function getPurchased() * * @throws PluginApiException */ - public function getRecommended() + public function getRecommended(): array { $url = $this->getApiUrl().'/plugins/recommended'; @@ -175,7 +175,7 @@ public function getRecommended() * * @return array> */ - private function buildPlugins(&$plugins) + private function buildPlugins(&$plugins): array { /** @var Plugin[] $pluginInstalled */ $pluginInstalled = $this->pluginRepository->findAll(); @@ -212,7 +212,7 @@ private function buildPlugins(&$plugins) * * @return bool */ - private function isUpdate($pluginVersion, $remoteVersion) + private function isUpdate($pluginVersion, $remoteVersion): bool { return version_compare($pluginVersion, $remoteVersion, '<'); } @@ -226,7 +226,7 @@ private function isUpdate($pluginVersion, $remoteVersion) * * @throws PluginApiException */ - public function getPlugin($id) + public function getPlugin($id): array { $url = $this->getApiUrl().'/plugin/'.$id; @@ -241,7 +241,7 @@ public function getPlugin($id) * * @return void */ - public function pluginInstalled(Plugin $Plugin) + public function pluginInstalled(Plugin $Plugin): void { $this->updatePluginStatus('/status/installed', $Plugin); } @@ -251,7 +251,7 @@ public function pluginInstalled(Plugin $Plugin) * * @return void */ - public function pluginEnabled(Plugin $Plugin) + public function pluginEnabled(Plugin $Plugin): void { $this->updatePluginStatus('/status/enabled', $Plugin); } @@ -261,7 +261,7 @@ public function pluginEnabled(Plugin $Plugin) * * @return void */ - public function pluginDisabled(Plugin $Plugin) + public function pluginDisabled(Plugin $Plugin): void { $this->updatePluginStatus('/status/disabled', $Plugin); } @@ -271,7 +271,7 @@ public function pluginDisabled(Plugin $Plugin) * * @return void */ - public function pluginUninstalled(Plugin $Plugin) + public function pluginUninstalled(Plugin $Plugin): void { $this->updatePluginStatus('/status/uninstalled', $Plugin); } @@ -282,7 +282,7 @@ public function pluginUninstalled(Plugin $Plugin) * * @return void */ - private function updatePluginStatus($url, Plugin $Plugin) + private function updatePluginStatus($url, Plugin $Plugin): void { if ($Plugin->getSource()) { try { @@ -303,7 +303,7 @@ private function updatePluginStatus($url, Plugin $Plugin) * * @throws PluginApiException */ - public function requestApi($url, $data = [], $post = false) + public function requestApi($url, $data = [], $post = false): string|bool { if ($post === false && count($data) > 0) { $url .= '?'.http_build_query($data); @@ -366,7 +366,7 @@ public function requestApi($url, $data = [], $post = false) * * @return array> */ - public function buildInfo(&$plugin) + public function buildInfo(&$plugin): array { $this->supportedVersion($plugin); @@ -380,7 +380,7 @@ public function buildInfo(&$plugin) * * @return void */ - public function supportedVersion(&$plugin) + public function supportedVersion(&$plugin): void { // Check the eccube version that the plugin supports. $plugin['version_check'] = false; diff --git a/src/Eccube/Service/PluginContext.php b/src/Eccube/Service/PluginContext.php index 69c1581fffb..b9d494b4b1c 100644 --- a/src/Eccube/Service/PluginContext.php +++ b/src/Eccube/Service/PluginContext.php @@ -52,7 +52,7 @@ public function __construct(EccubeConfig $eccubeConfig) /** * @return bool */ - public function isInstall() + public function isInstall(): bool { return $this->mode === self::MODE_INSTALL; } @@ -60,7 +60,7 @@ public function isInstall() /** * @return bool */ - public function isUninstall() + public function isUninstall(): bool { return $this->mode === self::MODE_UNINSTALL; } @@ -68,7 +68,7 @@ public function isUninstall() /** * @return string */ - public function setInstall() + public function setInstall(): string { return $this->mode = self::MODE_INSTALL; } @@ -76,7 +76,7 @@ public function setInstall() /** * @return string */ - public function setUninstall() + public function setUninstall(): string { return $this->mode = self::MODE_UNINSTALL; } @@ -86,7 +86,7 @@ public function setUninstall() * * @return void */ - public function setCode(string $code) + public function setCode(string $code): void { $this->code = $code; } diff --git a/src/Eccube/Service/PluginService.php b/src/Eccube/Service/PluginService.php index 391278a857e..b8639b0b135 100644 --- a/src/Eccube/Service/PluginService.php +++ b/src/Eccube/Service/PluginService.php @@ -155,7 +155,7 @@ public function __construct( * @throws PluginException * @throws \Exception */ - public function install($path, $source = 0, $notExists = false) + public function install($path, $source = 0, $notExists = false): bool { $pluginBaseDir = null; $tmp = null; @@ -212,7 +212,7 @@ public function install($path, $source = 0, $notExists = false) * @throws Exception * @throws PluginException */ - public function installWithCode($code, $notExists = false) + public function installWithCode($code, $notExists = false): bool { $this->pluginContext->setCode($code); $this->pluginContext->setInstall(); @@ -258,7 +258,7 @@ public function installWithCode($code, $notExists = false) /** * @return void */ - public function preInstall() + public function preInstall(): void { // キャッシュの削除 // FIXME: Please fix clearCache function (because it's clear all cache and this file just upload) @@ -275,7 +275,7 @@ public function preInstall() * @throws ConnectionException * @throws Exception */ - public function postInstall($config, $source) + public function postInstall($config, $source): void { // dbにプラグイン登録 $this->entityManager->getConnection()->beginTransaction(); @@ -332,7 +332,7 @@ public function postInstall($config, $source) * * @return void */ - public function generateProxyAndUpdateSchema(Plugin $plugin, $config, $uninstall = false, $saveMode = true) + public function generateProxyAndUpdateSchema(Plugin $plugin, $config, $uninstall = false, $saveMode = true): void { $this->generateProxyAndCallback(function ($generatedFiles, $proxiesDirectory) use ($saveMode) { $this->schemaService->updateSchema($generatedFiles, $proxiesDirectory, $saveMode); @@ -353,7 +353,7 @@ public function generateProxyAndUpdateSchema(Plugin $plugin, $config, $uninstall * * @return void */ - public function generateProxyAndCallback(callable $callback, Plugin $plugin, $config, $uninstall = false, $tmpProxyOutputDir = null) + public function generateProxyAndCallback(callable $callback, Plugin $plugin, $config, $uninstall = false, $tmpProxyOutputDir = null): void { if ($plugin->isEnabled()) { $generatedFiles = $this->regenerateProxy($plugin, false, $tmpProxyOutputDir ?: $this->projectRoot.'/app/proxy/entity'); @@ -406,7 +406,7 @@ public function generateProxyAndCallback(callable $callback, Plugin $plugin, $co * * @throws PluginException */ - public function createTempDir() + public function createTempDir(): string { $tempDir = $this->projectRoot.'/var/cache/'.$this->environment.'/Plugin'; @mkdir($tempDir); @@ -424,7 +424,7 @@ public function createTempDir() * * @return void */ - public function deleteDirs($arr) + public function deleteDirs($arr): void { foreach ($arr as $dir) { if (file_exists($dir)) { @@ -442,7 +442,7 @@ public function deleteDirs($arr) * * @throws PluginException */ - public function unpackPluginArchive($archive, $dir) + public function unpackPluginArchive($archive, $dir): void { $extension = pathinfo($archive, PATHINFO_EXTENSION); try { @@ -468,7 +468,7 @@ public function unpackPluginArchive($archive, $dir) * * @throws PluginException */ - public function checkPluginArchiveContent($dir, array $config_cache = []) + public function checkPluginArchiveContent($dir, array $config_cache = []): void { if (!empty($config_cache)) { $meta = $config_cache; @@ -499,7 +499,7 @@ public function checkPluginArchiveContent($dir, array $config_cache = []) * * @throws PluginException */ - public function readConfig($pluginDir) + public function readConfig($pluginDir): array { $composerJsonPath = $pluginDir.DIRECTORY_SEPARATOR.'composer.json'; if (file_exists($composerJsonPath) === false) { @@ -532,7 +532,7 @@ public function readConfig($pluginDir) * * @return bool */ - public function checkSymbolName($string) + public function checkSymbolName($string): bool { return strlen((string) $string) < 256 && preg_match('/^\w+$/', (string) $string); // plugin_nameやplugin_codeに使える文字のチェック @@ -545,7 +545,7 @@ public function checkSymbolName($string) * * @return void */ - public function deleteFile($path) + public function deleteFile($path): void { $f = new Filesystem(); $f->remove($path); @@ -558,7 +558,7 @@ public function deleteFile($path) * * @throws PluginException */ - public function checkSamePlugin($code) + public function checkSamePlugin($code): void { /** @var Plugin|null $Plugin */ $Plugin = $this->pluginRepository->findOneBy(['code' => $code]); @@ -572,7 +572,7 @@ public function checkSamePlugin($code) * * @return string */ - public function calcPluginDir($code) + public function calcPluginDir($code): string { return $this->projectRoot.'/app/Plugin/'.$code; } @@ -584,7 +584,7 @@ public function calcPluginDir($code) * * @throws PluginException */ - public function createPluginDir($d) + public function createPluginDir($d): void { $b = @mkdir($d); if (!$b) { @@ -600,7 +600,7 @@ public function createPluginDir($d) * * @throws PluginException */ - public function registerPlugin($meta, $source = 0) + public function registerPlugin($meta, $source = 0): Plugin { try { $p = new Plugin(); @@ -628,7 +628,7 @@ public function registerPlugin($meta, $source = 0) * * @return void */ - public function callPluginManagerMethod($meta, $method) + public function callPluginManagerMethod($meta, $method): void { $class = '\\Plugin\\'.$meta['code'].'\\PluginManager'; if (class_exists($class)) { @@ -647,7 +647,7 @@ public function callPluginManagerMethod($meta, $method) * * @throws \Exception */ - public function uninstall(Plugin $plugin, $force = true) + public function uninstall(Plugin $plugin, $force = true): bool { $pluginDir = $this->calcPluginDir($plugin->getCode()); $this->cacheUtil->clearCache(); @@ -691,7 +691,7 @@ public function uninstall(Plugin $plugin, $force = true) * * @throws \Exception */ - public function unregisterPlugin(Plugin $p) + public function unregisterPlugin(Plugin $p): void { $em = $this->entityManager; $em->remove($p); @@ -705,7 +705,7 @@ public function unregisterPlugin(Plugin $p) * * @throws \Exception */ - public function disable(Plugin $plugin) + public function disable(Plugin $plugin): true { return $this->enable($plugin, false); } @@ -720,7 +720,7 @@ public function disable(Plugin $plugin) * * @return array 生成されたファイルのパス */ - private function regenerateProxy(Plugin $plugin, $temporary, $outputDir = null, $uninstall = false) + private function regenerateProxy(Plugin $plugin, $temporary, $outputDir = null, $uninstall = false): array { if (is_null($outputDir)) { $outputDir = $this->projectRoot.'/app/proxy/entity'; @@ -768,7 +768,7 @@ private function regenerateProxy(Plugin $plugin, $temporary, $outputDir = null, * @throws Exception * @throws PluginException */ - public function enable(Plugin $plugin, $enable = true) + public function enable(Plugin $plugin, $enable = true): true { $em = $this->entityManager; try { @@ -811,7 +811,7 @@ public function enable(Plugin $plugin, $enable = true) * @throws PluginException * @throws \Exception */ - public function update(Plugin $plugin, $path) + public function update(Plugin $plugin, $path): bool { $tmp = null; try { @@ -855,7 +855,7 @@ public function update(Plugin $plugin, $path) * * @throws \Exception */ - public function updatePlugin(Plugin $plugin, $meta) + public function updatePlugin(Plugin $plugin, $meta): void { $em = $this->entityManager; try { @@ -900,7 +900,7 @@ public function updatePlugin(Plugin $plugin, $meta) * * @throws PluginException */ - public function getPluginRequired($plugin) + public function getPluginRequired($plugin): array { $pluginCode = $plugin instanceof Plugin ? $plugin->getCode() : $plugin['code']; $pluginVersion = $plugin instanceof Plugin ? $plugin->getVersion() : $plugin['version']; @@ -921,7 +921,7 @@ public function getPluginRequired($plugin) * * @return array plugin code */ - public function findDependentPluginNeedDisable($pluginCode) + public function findDependentPluginNeedDisable($pluginCode): array { return $this->findDependentPlugin($pluginCode, true); } @@ -935,7 +935,7 @@ public function findDependentPluginNeedDisable($pluginCode) * * @return array plugin code */ - public function findDependentPlugin($pluginCode, $enableOnly = false) + public function findDependentPlugin($pluginCode, $enableOnly = false): array { $criteria = Criteria::create() ->where(Criteria::expr()->neq('code', $pluginCode)); @@ -982,7 +982,7 @@ public function findDependentPlugin($pluginCode, $enableOnly = false) * * @return array format [packageName1 => version1, packageName2 => version2] */ - public function getDependentByCode($pluginCode, $libraryType = null) + public function getDependentByCode($pluginCode, $libraryType = null): array { $pluginDir = $this->calcPluginDir($pluginCode); $jsonFile = $pluginDir.'/composer.json'; @@ -1013,7 +1013,7 @@ public function getDependentByCode($pluginCode, $libraryType = null) * * @return string format if version=true: "packageName1:version1 packageName2:version2", if version=false: "packageName1 packageName2" */ - public function parseToComposerCommand(array $packages, $getVersion = true) + public function parseToComposerCommand(array $packages, $getVersion = true): string { $result = array_keys($packages); if ($getVersion) { @@ -1035,7 +1035,7 @@ public function parseToComposerCommand(array $packages, $getVersion = true) * * @return void */ - public function copyAssets($pluginCode) + public function copyAssets($pluginCode): void { $assetsDir = $this->calcPluginDir($pluginCode).'/Resource/assets'; @@ -1053,7 +1053,7 @@ public function copyAssets($pluginCode) * * @return void */ - public function removeAssets($pluginCode) + public function removeAssets($pluginCode): void { $assetsDir = $this->eccubeConfig['plugin_html_realdir'].$pluginCode; @@ -1072,7 +1072,7 @@ public function removeAssets($pluginCode) * * @return false|int|string */ - public function checkPluginExist($plugins, $pluginCode) + public function checkPluginExist($plugins, $pluginCode): false|int|string { if (str_contains($pluginCode, self::VENDOR_NAME.'/')) { $pluginCode = str_replace(self::VENDOR_NAME.'/', '', $pluginCode); diff --git a/src/Eccube/Service/PointHelper.php b/src/Eccube/Service/PointHelper.php index ba56bfc19ec..a297ae40eee 100644 --- a/src/Eccube/Service/PointHelper.php +++ b/src/Eccube/Service/PointHelper.php @@ -55,7 +55,7 @@ public function __construct(BaseInfoRepository $baseInfoRepository, EntityManage * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - public function isPointEnabled() + public function isPointEnabled(): bool { $BaseInfo = $this->baseInfoRepository->get(); @@ -72,7 +72,7 @@ public function isPointEnabled() * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - public function pointToPrice($point) + public function pointToPrice($point): string { $BaseInfo = $this->baseInfoRepository->get(); @@ -89,7 +89,7 @@ public function pointToPrice($point) * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - public function pointToDiscount($point) + public function pointToDiscount($point): string { return bcmul($this->pointToPrice($point), '-1', 0); } @@ -104,7 +104,7 @@ public function pointToDiscount($point) * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - public function priceToPoint($price) + public function priceToPoint($price): string { $BaseInfo = $this->baseInfoRepository->get(); @@ -121,7 +121,7 @@ public function priceToPoint($price) * * @throws \Exception */ - public function addPointDiscountItem(ItemHolderInterface $itemHolder, $discount) + public function addPointDiscountItem(ItemHolderInterface $itemHolder, $discount): void { // 注文明細以外は処理しない. if ($itemHolder instanceof Order === false) { @@ -165,7 +165,7 @@ public function addPointDiscountItem(ItemHolderInterface $itemHolder, $discount) * * @return void */ - public function removePointDiscountItem(ItemHolderInterface $itemHolder) + public function removePointDiscountItem(ItemHolderInterface $itemHolder): void { if ($itemHolder instanceof Order) { foreach ($itemHolder->getItems() as $item) { @@ -183,7 +183,7 @@ public function removePointDiscountItem(ItemHolderInterface $itemHolder) * * @return void */ - public function prepare(ItemHolderInterface $itemHolder, $point) + public function prepare(ItemHolderInterface $itemHolder, $point): void { // ユーザの保有ポイントを減算 $Customer = $itemHolder->getCustomer(); @@ -196,7 +196,7 @@ public function prepare(ItemHolderInterface $itemHolder, $point) * * @return void */ - public function rollback(ItemHolderInterface $itemHolder, $point) + public function rollback(ItemHolderInterface $itemHolder, $point): void { // 利用したポイントをユーザに戻す. $Customer = $itemHolder->getCustomer(); diff --git a/src/Eccube/Service/PurchaseFlow/DiscountProcessor.php b/src/Eccube/Service/PurchaseFlow/DiscountProcessor.php index 0435fcd4db1..a5d76272aaa 100644 --- a/src/Eccube/Service/PurchaseFlow/DiscountProcessor.php +++ b/src/Eccube/Service/PurchaseFlow/DiscountProcessor.php @@ -36,7 +36,7 @@ interface DiscountProcessor * * @return void */ - public function removeDiscountItem(ItemHolderInterface $itemHolder, PurchaseContext $context); + public function removeDiscountItem(ItemHolderInterface $itemHolder, PurchaseContext $context): void; /** * 値引き明細の追加処理を実装します. @@ -47,7 +47,7 @@ public function removeDiscountItem(ItemHolderInterface $itemHolder, PurchaseCont * @param ItemHolderInterface $itemHolder * @param PurchaseContext $context * - * @return ProcessResult|void|null + * @return ProcessResult|null */ - public function addDiscountItem(ItemHolderInterface $itemHolder, PurchaseContext $context); + public function addDiscountItem(ItemHolderInterface $itemHolder, PurchaseContext $context): ?ProcessResult; } diff --git a/src/Eccube/Service/PurchaseFlow/InvalidItemException.php b/src/Eccube/Service/PurchaseFlow/InvalidItemException.php index 1d8b7962bfe..e2edb15d609 100644 --- a/src/Eccube/Service/PurchaseFlow/InvalidItemException.php +++ b/src/Eccube/Service/PurchaseFlow/InvalidItemException.php @@ -61,7 +61,7 @@ public function isWarning(): bool * * @return InvalidItemException */ - public static function fromProductClass($errorMessage, ProductClass $ProductClass): self + public static function fromProductClass($errorMessage, ProductClass $ProductClass): InvalidItemException { $productName = $ProductClass->getProduct()->getName(); if ($ProductClass->hasClassCategory1()) { diff --git a/src/Eccube/Service/PurchaseFlow/ItemCollection.php b/src/Eccube/Service/PurchaseFlow/ItemCollection.php index 5b296e3c7f2..61b0c284979 100644 --- a/src/Eccube/Service/PurchaseFlow/ItemCollection.php +++ b/src/Eccube/Service/PurchaseFlow/ItemCollection.php @@ -27,7 +27,7 @@ class ItemCollection extends ArrayCollection { /** - * @var mixed|string + * @var string */ protected $type; @@ -51,7 +51,7 @@ public function __construct($Items, $type = null) * * @return mixed|null */ - public function reduce(\Closure $func, $initial = null) + public function reduce(\Closure $func, $initial = null): mixed { return array_reduce($this->toArray(), $func, $initial); } @@ -60,7 +60,7 @@ public function reduce(\Closure $func, $initial = null) * @return ItemCollection */ // 明細種別ごとに返すメソッド作る - public function getProductClasses() + public function getProductClasses(): ItemCollection { return $this->filter( function (ItemInterface $OrderItem) { @@ -71,7 +71,7 @@ function (ItemInterface $OrderItem) { /** * @return ItemCollection */ - public function getDeliveryFees() + public function getDeliveryFees(): ItemCollection { return $this->filter( function (ItemInterface $OrderItem) { @@ -82,7 +82,7 @@ function (ItemInterface $OrderItem) { /** * @return ItemCollection */ - public function getCharges() + public function getCharges(): ItemCollection { return $this->filter( function (ItemInterface $OrderItem) { @@ -93,7 +93,7 @@ function (ItemInterface $OrderItem) { /** * @return ItemCollection */ - public function getDiscounts() + public function getDiscounts(): ItemCollection { return $this->filter( function (ItemInterface $OrderItem) { @@ -110,7 +110,7 @@ function (ItemInterface $OrderItem) { * * @return bool */ - public function hasProductByName($productName) + public function hasProductByName($productName): bool { $OrderItems = $this->filter( function (ItemInterface $OrderItem) use ($productName) { @@ -128,7 +128,7 @@ function (ItemInterface $OrderItem) use ($productName) { * * @return bool */ - public function hasItemByOrderItemType($OrderItemType) + public function hasItemByOrderItemType($OrderItemType): bool { $filteredItems = $this->filter(function (ItemInterface $OrderItem) use ($OrderItemType) { /* @var OrderItem $OrderItem */ @@ -139,9 +139,9 @@ public function hasItemByOrderItemType($OrderItemType) } /** - * @return mixed|string + * @return string */ - public function getType() + public function getType(): string { return $this->type; } @@ -149,7 +149,7 @@ public function getType() /** * @return self */ - public function sort() + public function sort(): ItemCollection { $Items = $this->toArray(); usort($Items, function (ItemInterface $a, ItemInterface $b) { diff --git a/src/Eccube/Service/PurchaseFlow/ItemHolderPostValidator.php b/src/Eccube/Service/PurchaseFlow/ItemHolderPostValidator.php index a3df60cbcb6..4fa3c9c157a 100644 --- a/src/Eccube/Service/PurchaseFlow/ItemHolderPostValidator.php +++ b/src/Eccube/Service/PurchaseFlow/ItemHolderPostValidator.php @@ -28,7 +28,7 @@ abstract class ItemHolderPostValidator * * @return ProcessResult */ - final public function execute(ItemHolderInterface $itemHolder, PurchaseContext $context) + final public function execute(ItemHolderInterface $itemHolder, PurchaseContext $context): ProcessResult { try { $this->validate($itemHolder, $context); @@ -49,5 +49,5 @@ final public function execute(ItemHolderInterface $itemHolder, PurchaseContext $ * * @throws InvalidItemException */ - abstract protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context); + abstract protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void; } diff --git a/src/Eccube/Service/PurchaseFlow/ItemHolderPreprocessor.php b/src/Eccube/Service/PurchaseFlow/ItemHolderPreprocessor.php index 93a5d524905..0d4cfd15836 100644 --- a/src/Eccube/Service/PurchaseFlow/ItemHolderPreprocessor.php +++ b/src/Eccube/Service/PurchaseFlow/ItemHolderPreprocessor.php @@ -30,5 +30,5 @@ interface ItemHolderPreprocessor * * @return void */ - public function process(ItemHolderInterface $itemHolder, PurchaseContext $context); + public function process(ItemHolderInterface $itemHolder, PurchaseContext $context): void; } diff --git a/src/Eccube/Service/PurchaseFlow/ItemHolderValidator.php b/src/Eccube/Service/PurchaseFlow/ItemHolderValidator.php index 2e5e3adec3f..4f685f0ce22 100644 --- a/src/Eccube/Service/PurchaseFlow/ItemHolderValidator.php +++ b/src/Eccube/Service/PurchaseFlow/ItemHolderValidator.php @@ -28,7 +28,7 @@ abstract class ItemHolderValidator * * @return ProcessResult */ - final public function execute(ItemHolderInterface $itemHolder, PurchaseContext $context) + final public function execute(ItemHolderInterface $itemHolder, PurchaseContext $context): ProcessResult { try { $this->validate($itemHolder, $context); @@ -49,14 +49,14 @@ final public function execute(ItemHolderInterface $itemHolder, PurchaseContext $ * * @throws InvalidItemException */ - abstract protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context); + abstract protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void; /** * @param ItemHolderInterface $itemHolder * * @return void */ - protected function handle(ItemHolderInterface $itemHolder) + protected function handle(ItemHolderInterface $itemHolder): void { } } diff --git a/src/Eccube/Service/PurchaseFlow/ItemPreprocessor.php b/src/Eccube/Service/PurchaseFlow/ItemPreprocessor.php index 93416c6994b..99005a12874 100644 --- a/src/Eccube/Service/PurchaseFlow/ItemPreprocessor.php +++ b/src/Eccube/Service/PurchaseFlow/ItemPreprocessor.php @@ -26,5 +26,5 @@ interface ItemPreprocessor * * @return void */ - public function process(ItemInterface $item, PurchaseContext $context); + public function process(ItemInterface $item, PurchaseContext $context): void; } diff --git a/src/Eccube/Service/PurchaseFlow/ItemValidator.php b/src/Eccube/Service/PurchaseFlow/ItemValidator.php index c011f802236..360895ff5d8 100644 --- a/src/Eccube/Service/PurchaseFlow/ItemValidator.php +++ b/src/Eccube/Service/PurchaseFlow/ItemValidator.php @@ -28,7 +28,7 @@ abstract class ItemValidator * * @return ProcessResult */ - final public function execute(ItemInterface $item, PurchaseContext $context) + final public function execute(ItemInterface $item, PurchaseContext $context): ProcessResult { try { $this->validate($item, $context); @@ -49,7 +49,7 @@ final public function execute(ItemInterface $item, PurchaseContext $context) * * @return void */ - abstract protected function validate(ItemInterface $item, PurchaseContext $context); + abstract protected function validate(ItemInterface $item, PurchaseContext $context): void; /** * 検証エラー時に後処理を行う. @@ -59,7 +59,7 @@ abstract protected function validate(ItemInterface $item, PurchaseContext $conte * * @return void */ - protected function handle(ItemInterface $item, PurchaseContext $context) + protected function handle(ItemInterface $item, PurchaseContext $context): void { } } diff --git a/src/Eccube/Service/PurchaseFlow/ProcessResult.php b/src/Eccube/Service/PurchaseFlow/ProcessResult.php index cea00bfb921..75df9310f7f 100644 --- a/src/Eccube/Service/PurchaseFlow/ProcessResult.php +++ b/src/Eccube/Service/PurchaseFlow/ProcessResult.php @@ -52,7 +52,7 @@ private function __construct($type, ?string $message = null, $class = null) * * @return ProcessResult */ - public static function warn($message = null, $class = null) + public static function warn($message = null, $class = null): ProcessResult { return new self(self::WARNING, $message, $class); } @@ -63,7 +63,7 @@ public static function warn($message = null, $class = null) * * @return ProcessResult */ - public static function error($message = null, $class = null) + public static function error($message = null, $class = null): ProcessResult { return new self(self::ERROR, $message, $class); } @@ -74,7 +74,7 @@ public static function error($message = null, $class = null) * * @return ProcessResult */ - public static function success($message = null, $class = null) + public static function success($message = null, $class = null): ProcessResult { return new self(self::SUCCESS, $message, $class); } @@ -82,7 +82,7 @@ public static function success($message = null, $class = null) /** * @return bool */ - public function isError() + public function isError(): bool { return $this->type === self::ERROR; } @@ -90,7 +90,7 @@ public function isError() /** * @return bool */ - public function isWarning() + public function isWarning(): bool { return $this->type === self::WARNING; } @@ -98,7 +98,7 @@ public function isWarning() /** * @return bool */ - public function isSuccess() + public function isSuccess(): bool { return $this->type === self::SUCCESS; } @@ -106,7 +106,7 @@ public function isSuccess() /** * @return string|null */ - public function getMessage() + public function getMessage(): ?string { return $this->message; } diff --git a/src/Eccube/Service/PurchaseFlow/Processor/AbstractPurchaseProcessor.php b/src/Eccube/Service/PurchaseFlow/Processor/AbstractPurchaseProcessor.php index 1c3d4af8c6b..fe795d412d4 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/AbstractPurchaseProcessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/AbstractPurchaseProcessor.php @@ -23,7 +23,7 @@ abstract class AbstractPurchaseProcessor implements PurchaseProcessor * {@inheritdoc} */ #[\Override] - public function prepare(ItemHolderInterface $target, PurchaseContext $context) + public function prepare(ItemHolderInterface $target, PurchaseContext $context): void { } @@ -31,7 +31,7 @@ public function prepare(ItemHolderInterface $target, PurchaseContext $context) * {@inheritdoc} */ #[\Override] - public function commit(ItemHolderInterface $target, PurchaseContext $context) + public function commit(ItemHolderInterface $target, PurchaseContext $context): void { } @@ -39,7 +39,7 @@ public function commit(ItemHolderInterface $target, PurchaseContext $context) * {@inheritdoc} */ #[\Override] - public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context): void { } } diff --git a/src/Eccube/Service/PurchaseFlow/Processor/AddPointProcessor.php b/src/Eccube/Service/PurchaseFlow/Processor/AddPointProcessor.php index 38cafed92fd..62bc1a5d8e3 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/AddPointProcessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/AddPointProcessor.php @@ -48,7 +48,7 @@ public function __construct(BaseInfoRepository $baseInfoRepository) * @return void */ #[\Override] - public function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if (!$this->supports($itemHolder)) { return; @@ -66,7 +66,7 @@ public function validate(ItemHolderInterface $itemHolder, PurchaseContext $conte * * @return string */ - private function calculateAddPoint(ItemHolderInterface $itemHolder) + private function calculateAddPoint(ItemHolderInterface $itemHolder): string { $basicPointRate = $this->BaseInfo->getBasicPointRate(); @@ -82,15 +82,15 @@ function ($carry, ItemInterface $item) use ($basicPointRate) { // TODO: ポイントは税抜き分しか割引されない、ポイント明細は税抜きのままでいいのか? $point = '0'; if ($item->isPoint()) { - $pointCalc = bcmul(bcmul((string) $item->getPrice(), bcdiv((string) $pointRate, '100', 2), 2), (string) $item->getQuantity(), 2); + $pointCalc = bcmul(bcmul($item->getPrice(), bcdiv((string) $pointRate, '100', 2), 2), $item->getQuantity(), 2); $point = (string) round((float) $pointCalc); // Only calc point on product } elseif ($item->isProduct()) { // ポイント = 単価 * ポイント付与率 * 数量 - $pointCalc = bcmul(bcmul((string) $item->getPrice(), bcdiv((string) $pointRate, '100', 2), 2), (string) $item->getQuantity(), 2); + $pointCalc = bcmul(bcmul($item->getPrice(), bcdiv((string) $pointRate, '100', 2), 2), $item->getQuantity(), 2); $point = (string) round((float) $pointCalc); } elseif ($item->isDiscount()) { - $pointCalc = bcmul(bcmul((string) $item->getPrice(), bcdiv((string) $pointRate, '100', 2), 2), (string) $item->getQuantity(), 2); + $pointCalc = bcmul(bcmul($item->getPrice(), bcdiv((string) $pointRate, '100', 2), 2), $item->getQuantity(), 2); $point = (string) round((float) $pointCalc); } @@ -113,7 +113,7 @@ function ($carry, ItemInterface $item) use ($basicPointRate) { * * @return bool */ - private function supports(ItemHolderInterface $itemHolder) + private function supports(ItemHolderInterface $itemHolder): bool { if (!$this->BaseInfo->isOptionPoint()) { return false; diff --git a/src/Eccube/Service/PurchaseFlow/Processor/CustomerPurchaseInfoProcessor.php b/src/Eccube/Service/PurchaseFlow/Processor/CustomerPurchaseInfoProcessor.php index 2a5c7632d2f..1936e166506 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/CustomerPurchaseInfoProcessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/CustomerPurchaseInfoProcessor.php @@ -29,7 +29,7 @@ class CustomerPurchaseInfoProcessor extends AbstractPurchaseProcessor * @return void */ #[\Override] - public function commit(ItemHolderInterface $target, PurchaseContext $context) + public function commit(ItemHolderInterface $target, PurchaseContext $context): void { if (!$target instanceof Order) { return; diff --git a/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeeChangeValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeeChangeValidator.php index 362e817d918..d5fb69dbef4 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeeChangeValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeeChangeValidator.php @@ -33,7 +33,7 @@ class DeliveryFeeChangeValidator extends ItemHolderPostValidator * @throws InvalidItemException 送料が変更されている場合 */ #[\Override] - protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if (!$itemHolder instanceof Order) { return; diff --git a/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeeFreeByShippingPreprocessor.php b/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeeFreeByShippingPreprocessor.php index 569a1be1ac5..238b85dea66 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeeFreeByShippingPreprocessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeeFreeByShippingPreprocessor.php @@ -48,7 +48,7 @@ public function __construct(BaseInfoRepository $baseInfoRepository) * @return void */ #[\Override] - public function process(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function process(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if (!($this->BaseInfo->getDeliveryFreeAmount() || $this->BaseInfo->getDeliveryFreeQuantity())) { return; diff --git a/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeeFreePreprocessor.php b/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeeFreePreprocessor.php index 3ccd9d0a554..e3986bd919f 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeeFreePreprocessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeeFreePreprocessor.php @@ -46,7 +46,7 @@ public function __construct(BaseInfoRepository $baseInfoRepository) * @return void */ #[\Override] - public function process(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function process(ItemHolderInterface $itemHolder, PurchaseContext $context): void { $isDeliveryFree = false; diff --git a/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeePreprocessor.php b/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeePreprocessor.php index 506e14071ef..57d44f23e9e 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeePreprocessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/DeliveryFeePreprocessor.php @@ -81,7 +81,7 @@ public function __construct( * @throws \Doctrine\ORM\NoResultException */ #[\Override] - public function process(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function process(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if ($itemHolder instanceof Order) { $this->removeDeliveryFeeItem($itemHolder); @@ -94,7 +94,7 @@ public function process(ItemHolderInterface $itemHolder, PurchaseContext $contex * * @return void */ - private function removeDeliveryFeeItem(ItemHolderInterface $itemHolder) + private function removeDeliveryFeeItem(ItemHolderInterface $itemHolder): void { if ($itemHolder instanceof Order) { foreach ($itemHolder->getShippings() as $Shipping) { @@ -117,7 +117,7 @@ private function removeDeliveryFeeItem(ItemHolderInterface $itemHolder) * * @throws \Doctrine\ORM\NoResultException */ - private function saveDeliveryFeeItem(ItemHolderInterface $itemHolder) + private function saveDeliveryFeeItem(ItemHolderInterface $itemHolder): void { $DeliveryFeeType = $this->entityManager ->find(OrderItemType::class, OrderItemType::DELIVERY_FEE); diff --git a/src/Eccube/Service/PurchaseFlow/Processor/DeliverySettingValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/DeliverySettingValidator.php index bc82a560665..02826fb31a5 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/DeliverySettingValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/DeliverySettingValidator.php @@ -57,7 +57,7 @@ public function __construct(DeliveryRepository $deliveryRepository) * @throws InvalidItemException 配送業者が設定されていない場合 */ #[\Override] - protected function validate(ItemInterface $item, PurchaseContext $context) + protected function validate(ItemInterface $item, PurchaseContext $context): void { if (!$item->isProduct()) { return; @@ -80,7 +80,7 @@ protected function validate(ItemInterface $item, PurchaseContext $context) * @return void */ #[\Override] - protected function handle(ItemInterface $item, PurchaseContext $context) + protected function handle(ItemInterface $item, PurchaseContext $context): void { $item->setQuantity('0'); } diff --git a/src/Eccube/Service/PurchaseFlow/Processor/EmptyItemsValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/EmptyItemsValidator.php index 72d177b06f9..350486e632e 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/EmptyItemsValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/EmptyItemsValidator.php @@ -47,7 +47,7 @@ public function __construct(EntityManagerInterface $entityManager) * @throws InvalidItemException 商品明細がない場合 */ #[\Override] - protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { foreach ($itemHolder->getItems() as $item) { if ($item->isProduct() && $item->getQuantity() <= 0) { diff --git a/src/Eccube/Service/PurchaseFlow/Processor/OrderNoProcessor.php b/src/Eccube/Service/PurchaseFlow/Processor/OrderNoProcessor.php index 71864960447..37d6479766f 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/OrderNoProcessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/OrderNoProcessor.php @@ -52,7 +52,7 @@ public function __construct(EccubeConfig $eccubeConfig, OrderRepository $orderRe * @return void */ #[\Override] - public function process(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function process(ItemHolderInterface $itemHolder, PurchaseContext $context): void { $Order = $itemHolder; diff --git a/src/Eccube/Service/PurchaseFlow/Processor/OrderUpdateProcessor.php b/src/Eccube/Service/PurchaseFlow/Processor/OrderUpdateProcessor.php index 325f27cec24..6330f8c91c0 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/OrderUpdateProcessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/OrderUpdateProcessor.php @@ -46,7 +46,7 @@ public function __construct(OrderStatusRepository $orderStatusRepository) * @return void */ #[\Override] - public function commit(ItemHolderInterface $target, PurchaseContext $context) + public function commit(ItemHolderInterface $target, PurchaseContext $context): void { if (!$target instanceof Order) { return; diff --git a/src/Eccube/Service/PurchaseFlow/Processor/PaymentChargeChangeValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/PaymentChargeChangeValidator.php index a2e46e7a2e9..1f072f4a81f 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/PaymentChargeChangeValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/PaymentChargeChangeValidator.php @@ -33,7 +33,7 @@ class PaymentChargeChangeValidator extends ItemHolderPostValidator * @throws InvalidItemException 手数料が変更されている場合 */ #[\Override] - protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if (!$itemHolder instanceof Order) { return; diff --git a/src/Eccube/Service/PurchaseFlow/Processor/PaymentChargePreprocessor.php b/src/Eccube/Service/PurchaseFlow/Processor/PaymentChargePreprocessor.php index cb9b7c99f3a..d6f6d8ec193 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/PaymentChargePreprocessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/PaymentChargePreprocessor.php @@ -69,7 +69,7 @@ public function __construct( * @return void */ #[\Override] - public function process(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function process(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if (!$itemHolder instanceof Order) { return; @@ -96,7 +96,7 @@ public function process(ItemHolderInterface $itemHolder, PurchaseContext $contex * * @return void */ - protected function addChargeItem(ItemHolderInterface $itemHolder) + protected function addChargeItem(ItemHolderInterface $itemHolder): void { /** @var Order $itemHolder */ /** @var OrderItemType $OrderItemType */ diff --git a/src/Eccube/Service/PurchaseFlow/Processor/PaymentTotalLimitValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/PaymentTotalLimitValidator.php index 29225348c9b..064938533fd 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/PaymentTotalLimitValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/PaymentTotalLimitValidator.php @@ -47,7 +47,7 @@ public function __construct(EccubeConfig $eccubeConfig) * @throws \Eccube\Service\PurchaseFlow\InvalidItemException 合計金額が上限を超えている場合 */ #[\Override] - protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { $totalPrice = $itemHolder->getTotal(); if ($totalPrice > $this->maxTotalFee) { diff --git a/src/Eccube/Service/PurchaseFlow/Processor/PaymentTotalNegativeValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/PaymentTotalNegativeValidator.php index 12ac6744371..4cbbfd83c97 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/PaymentTotalNegativeValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/PaymentTotalNegativeValidator.php @@ -32,7 +32,7 @@ class PaymentTotalNegativeValidator extends ItemHolderPostValidator * @throws InvalidItemException 合計金額がマイナスの場合 */ #[\Override] - protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if ($itemHolder->getTotal() < 0) { $this->throwInvalidItemException(trans('front.shopping.payment_total_invalid')); diff --git a/src/Eccube/Service/PurchaseFlow/Processor/PaymentValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/PaymentValidator.php index 1853e9c52fb..f499d8db709 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/PaymentValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/PaymentValidator.php @@ -52,7 +52,7 @@ public function __construct(DeliveryRepository $deliveryRepository) * @throws \Eccube\Service\PurchaseFlow\InvalidItemException 支払い方法が異なる場合 */ #[\Override] - protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { // 明細の個数が1以下の場合はOK if (count($itemHolder->getItems()) <= 1) { @@ -104,7 +104,7 @@ protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $co * * @return array */ - private function getDeliveries(SaleType $SaleType) + private function getDeliveries(SaleType $SaleType): array { /** @var Delivery[] $Deliveries */ $Deliveries = $this->deliveryRepository->findBy( @@ -122,7 +122,7 @@ private function getDeliveries(SaleType $SaleType) * * @return ArrayCollection */ - private function getPayments($Deliveries) + private function getPayments($Deliveries): ArrayCollection { $Payments = new ArrayCollection(); foreach ($Deliveries as $Delivery) { diff --git a/src/Eccube/Service/PurchaseFlow/Processor/PointDiffProcessor.php b/src/Eccube/Service/PurchaseFlow/Processor/PointDiffProcessor.php index 58d4538ef76..2283d04467b 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/PointDiffProcessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/PointDiffProcessor.php @@ -59,7 +59,7 @@ public function __construct(EntityManagerInterface $entityManager, PointHelper $ * @return void */ #[\Override] - protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if (!$this->supports($itemHolder, $context)) { return; @@ -84,7 +84,7 @@ protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $co * @return void */ #[\Override] - public function prepare(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function prepare(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if (!$this->supports($itemHolder, $context)) { return; @@ -102,7 +102,7 @@ public function prepare(ItemHolderInterface $itemHolder, PurchaseContext $contex * @return void */ #[\Override] - public function commit(ItemHolderInterface $target, PurchaseContext $context) + public function commit(ItemHolderInterface $target, PurchaseContext $context): void { // 何もしない } @@ -113,7 +113,7 @@ public function commit(ItemHolderInterface $target, PurchaseContext $context) * @return void */ #[\Override] - public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if (!$this->supports($itemHolder, $context)) { return; @@ -144,7 +144,7 @@ public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $conte * * @return bool */ - private function supports(ItemHolderInterface $itemHolder, PurchaseContext $context) + private function supports(ItemHolderInterface $itemHolder, PurchaseContext $context): bool { if (!$this->pointHelper->isPointEnabled()) { return false; @@ -192,7 +192,7 @@ private function supports(ItemHolderInterface $itemHolder, PurchaseContext $cont * * @return string */ - protected function getDiffOfUsePoint(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function getDiffOfUsePoint(ItemHolderInterface $itemHolder, PurchaseContext $context): string { if ($context->getOriginHolder()) { $fromUsePoint = $context->getOriginHolder()->getUsePoint(); diff --git a/src/Eccube/Service/PurchaseFlow/Processor/PointProcessor.php b/src/Eccube/Service/PurchaseFlow/Processor/PointProcessor.php index 3b0471ffc61..8190142cab3 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/PointProcessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/PointProcessor.php @@ -57,7 +57,7 @@ public function __construct(EntityManagerInterface $entityManager, PointHelper $ * {@inheritdoc} */ #[\Override] - public function removeDiscountItem(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function removeDiscountItem(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if (!$this->supports($itemHolder)) { return; @@ -70,7 +70,7 @@ public function removeDiscountItem(ItemHolderInterface $itemHolder, PurchaseCont * {@inheritdoc} */ #[\Override] - public function addDiscountItem(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function addDiscountItem(ItemHolderInterface $itemHolder, PurchaseContext $context): ?ProcessResult { if (!$this->supports($itemHolder)) { return null; @@ -131,7 +131,7 @@ public function addDiscountItem(ItemHolderInterface $itemHolder, PurchaseContext * {@inheritdoc} */ #[\Override] - public function prepare(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function prepare(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if (!$this->supports($itemHolder)) { return; @@ -145,7 +145,7 @@ public function prepare(ItemHolderInterface $itemHolder, PurchaseContext $contex * {@inheritdoc} */ #[\Override] - public function commit(ItemHolderInterface $target, PurchaseContext $context) + public function commit(ItemHolderInterface $target, PurchaseContext $context): void { // 何もしない } @@ -154,7 +154,7 @@ public function commit(ItemHolderInterface $target, PurchaseContext $context) * {@inheritdoc} */ #[\Override] - public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context): void { // 利用したポイントをユーザに戻す. if (!$this->supports($itemHolder)) { @@ -181,7 +181,7 @@ public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $conte * * @return bool */ - private function supports(ItemHolderInterface $itemHolder) + private function supports(ItemHolderInterface $itemHolder): bool { if (!$this->pointHelper->isPointEnabled()) { return false; diff --git a/src/Eccube/Service/PurchaseFlow/Processor/PointRateProcessor.php b/src/Eccube/Service/PurchaseFlow/Processor/PointRateProcessor.php index eb7641ce91f..8eea04e3c15 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/PointRateProcessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/PointRateProcessor.php @@ -44,7 +44,7 @@ public function __construct(BaseInfoRepository $baseInfoRepository) * @throws \Exception */ #[\Override] - protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if (!$itemHolder instanceof Order) { return; diff --git a/src/Eccube/Service/PurchaseFlow/Processor/PreOrderIdValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/PreOrderIdValidator.php index 1992254beea..f6da070d312 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/PreOrderIdValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/PreOrderIdValidator.php @@ -49,7 +49,7 @@ public function __construct(CartService $cartService) * @throws PurchaseException */ #[\Override] - public function prepare(ItemHolderInterface $target, PurchaseContext $context) + public function prepare(ItemHolderInterface $target, PurchaseContext $context): void { // 処理なし } @@ -65,7 +65,7 @@ public function prepare(ItemHolderInterface $target, PurchaseContext $context) * @throws PurchaseException */ #[\Override] - public function commit(ItemHolderInterface $target, PurchaseContext $context) + public function commit(ItemHolderInterface $target, PurchaseContext $context): void { // 処理なし } @@ -84,7 +84,7 @@ public function commit(ItemHolderInterface $target, PurchaseContext $context) * @throws BadRequestHttpException pre_order_idが一致しない場合 OR Cartがない場合 OR $itemHolderが受注でない場合 */ #[\Override] - public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context): void { // $itemHolderが受注の場合のみチェック if (!$itemHolder instanceof Order) { diff --git a/src/Eccube/Service/PurchaseFlow/Processor/PriceChangeValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/PriceChangeValidator.php index 9f454ba561e..18a9d89d962 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/PriceChangeValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/PriceChangeValidator.php @@ -32,7 +32,7 @@ class PriceChangeValidator extends ItemValidator * @throws \Eccube\Service\PurchaseFlow\InvalidItemException 販売価格が変更されている場合 */ #[\Override] - public function validate(ItemInterface $item, PurchaseContext $context) + public function validate(ItemInterface $item, PurchaseContext $context): void { if (!$item->isProduct()) { return; diff --git a/src/Eccube/Service/PurchaseFlow/Processor/ProductStatusValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/ProductStatusValidator.php index 2d5a165d485..d98567c6081 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/ProductStatusValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/ProductStatusValidator.php @@ -33,7 +33,7 @@ class ProductStatusValidator extends ItemValidator * @throws InvalidItemException 商品が公開されていない場合 */ #[\Override] - protected function validate(ItemInterface $item, PurchaseContext $context) + protected function validate(ItemInterface $item, PurchaseContext $context): void { if ($item->isProduct()) { $ProductClass = $item->getProductClass(); @@ -55,7 +55,7 @@ protected function validate(ItemInterface $item, PurchaseContext $context) * @return void */ #[\Override] - protected function handle(ItemInterface $item, PurchaseContext $context) + protected function handle(ItemInterface $item, PurchaseContext $context): void { $item->setQuantity('0'); } diff --git a/src/Eccube/Service/PurchaseFlow/Processor/SaleLimitMultipleValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/SaleLimitMultipleValidator.php index c4798b04845..8dd5ff49569 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/SaleLimitMultipleValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/SaleLimitMultipleValidator.php @@ -45,7 +45,7 @@ public function __construct(ProductClassRepository $productClassRepository) * @throws \Eccube\Service\PurchaseFlow\InvalidItemException 商品の購入数が在庫数を超えている場合 */ #[\Override] - public function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { $OrderItemsByProductClass = []; foreach ($itemHolder->getItems() as $Item) { diff --git a/src/Eccube/Service/PurchaseFlow/Processor/SaleLimitValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/SaleLimitValidator.php index 18b41f82ab1..de99d017b68 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/SaleLimitValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/SaleLimitValidator.php @@ -32,7 +32,7 @@ class SaleLimitValidator extends ItemValidator * @throws InvalidItemException 販売制限数を超えている場合 */ #[\Override] - protected function validate(ItemInterface $item, PurchaseContext $context) + protected function validate(ItemInterface $item, PurchaseContext $context): void { if (!$item->isProduct()) { return; @@ -56,7 +56,7 @@ protected function validate(ItemInterface $item, PurchaseContext $context) * @return void */ #[\Override] - protected function handle(ItemInterface $item, PurchaseContext $context) + protected function handle(ItemInterface $item, PurchaseContext $context): void { $limit = $item->getProductClass()->getSaleLimit(); $item->setQuantity($limit); diff --git a/src/Eccube/Service/PurchaseFlow/Processor/StockDiffProcessor.php b/src/Eccube/Service/PurchaseFlow/Processor/StockDiffProcessor.php index df7ee5e275c..108a8bf6003 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/StockDiffProcessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/StockDiffProcessor.php @@ -52,7 +52,7 @@ public function __construct(ProductClassRepository $productClassRepository) * @throws \Eccube\Service\PurchaseFlow\InvalidItemException */ #[\Override] - public function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if (is_null($context->getOriginHolder())) { return; @@ -106,7 +106,7 @@ public function validate(ItemHolderInterface $itemHolder, PurchaseContext $conte * * @return array 商品クラスIDをキーとした商品の数量の差分 */ - protected function getDiffOfQuantities(ItemHolderInterface $From, ItemHolderInterface $To) + protected function getDiffOfQuantities(ItemHolderInterface $From, ItemHolderInterface $To): array { $FromItems = $this->getQuantityByProductClass($From); $ToItems = $this->getQuantityByProductClass($To); @@ -138,7 +138,7 @@ protected function getDiffOfQuantities(ItemHolderInterface $From, ItemHolderInte * * @return array 商品クラスIDをキーとした商品の数量 */ - protected function getQuantityByProductClass(ItemHolderInterface $ItemHolder) + protected function getQuantityByProductClass(ItemHolderInterface $ItemHolder): array { $ItemsByProductClass = []; foreach ($ItemHolder->getItems() as $Item) { @@ -164,7 +164,7 @@ protected function getQuantityByProductClass(ItemHolderInterface $ItemHolder) * @return void */ #[\Override] - public function prepare(ItemHolderInterface $target, PurchaseContext $context) + public function prepare(ItemHolderInterface $target, PurchaseContext $context): void { if (is_null($context->getOriginHolder())) { return; @@ -200,7 +200,7 @@ public function prepare(ItemHolderInterface $target, PurchaseContext $context) * @return void */ #[\Override] - public function commit(ItemHolderInterface $target, PurchaseContext $context) + public function commit(ItemHolderInterface $target, PurchaseContext $context): void { } @@ -213,7 +213,7 @@ public function commit(ItemHolderInterface $target, PurchaseContext $context) * @return void */ #[\Override] - public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context): void { } } diff --git a/src/Eccube/Service/PurchaseFlow/Processor/StockMultipleValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/StockMultipleValidator.php index 0f94a927c15..e6298be4406 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/StockMultipleValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/StockMultipleValidator.php @@ -48,7 +48,7 @@ public function __construct(ProductClassRepository $productClassRepository) * @throws InvalidItemException */ #[\Override] - public function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if ($itemHolder instanceof Order) { $OrderItemsByProductClass = []; diff --git a/src/Eccube/Service/PurchaseFlow/Processor/StockReduceProcessor.php b/src/Eccube/Service/PurchaseFlow/Processor/StockReduceProcessor.php index a70fcaf1409..4353c342de5 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/StockReduceProcessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/StockReduceProcessor.php @@ -53,7 +53,7 @@ public function __construct(ProductStockRepository $productStockRepository, Enti * {@inheritdoc} */ #[\Override] - public function prepare(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function prepare(ItemHolderInterface $itemHolder, PurchaseContext $context): void { // 在庫を減らす $this->eachProductOrderItems($itemHolder, function ($currentStock, $itemQuantity) { @@ -65,7 +65,7 @@ public function prepare(ItemHolderInterface $itemHolder, PurchaseContext $contex * {@inheritdoc} */ #[\Override] - public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context): void { // 在庫を戻す $this->eachProductOrderItems($itemHolder, function ($currentStock, $itemQuantity) { @@ -83,7 +83,7 @@ public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $conte * @throws \Doctrine\ORM\OptimisticLockException * @throws \Doctrine\ORM\PessimisticLockException */ - private function eachProductOrderItems(ItemHolderInterface $itemHolder, callable $callback) + private function eachProductOrderItems(ItemHolderInterface $itemHolder, callable $callback): void { // Order以外の場合は何もしない if (!$itemHolder instanceof Order) { diff --git a/src/Eccube/Service/PurchaseFlow/Processor/StockValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/StockValidator.php index 35e9d5fe354..323484bd144 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/StockValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/StockValidator.php @@ -31,7 +31,7 @@ class StockValidator extends ItemValidator * @throws \Eccube\Service\PurchaseFlow\InvalidItemException 在庫切れの場合 */ #[\Override] - protected function validate(ItemInterface $item, PurchaseContext $context) + protected function validate(ItemInterface $item, PurchaseContext $context): void { if (!$item->isProduct()) { return; @@ -56,7 +56,7 @@ protected function validate(ItemInterface $item, PurchaseContext $context) * @return void */ #[\Override] - protected function handle(ItemInterface $item, PurchaseContext $context) + protected function handle(ItemInterface $item, PurchaseContext $context): void { $stock = $item->getProductClass()->getStock(); $item->setQuantity($stock); diff --git a/src/Eccube/Service/PurchaseFlow/Processor/TaxProcessor.php b/src/Eccube/Service/PurchaseFlow/Processor/TaxProcessor.php index e8284bbbb82..64ff1c1a234 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/TaxProcessor.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/TaxProcessor.php @@ -76,7 +76,7 @@ public function __construct( * @throws \Doctrine\ORM\NoResultException */ #[\Override] - public function process(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function process(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if (!$itemHolder instanceof Order) { return; @@ -142,7 +142,7 @@ public function process(ItemHolderInterface $itemHolder, PurchaseContext $contex * * @return TaxType 税区分 */ - protected function getTaxType($OrderItemType) + protected function getTaxType($OrderItemType): TaxType { if ($OrderItemType instanceof OrderItemType) { $OrderItemType = $OrderItemType->getId(); @@ -170,7 +170,7 @@ protected function getTaxType($OrderItemType) * * @return TaxDisplayType 税表示区分 */ - protected function getTaxDisplayType($OrderItemType) + protected function getTaxDisplayType($OrderItemType): TaxDisplayType { return $this->orderHelper->getTaxDisplayType($OrderItemType); } diff --git a/src/Eccube/Service/PurchaseFlow/Processor/TaxRateChangeValidator.php b/src/Eccube/Service/PurchaseFlow/Processor/TaxRateChangeValidator.php index 8ffbb0f7eda..6f5c3d28ca7 100644 --- a/src/Eccube/Service/PurchaseFlow/Processor/TaxRateChangeValidator.php +++ b/src/Eccube/Service/PurchaseFlow/Processor/TaxRateChangeValidator.php @@ -33,7 +33,7 @@ class TaxRateChangeValidator extends ItemHolderPostValidator * @throws InvalidItemException 税率が変更された場合 */ #[\Override] - protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { if (!$itemHolder instanceof Order) { return; diff --git a/src/Eccube/Service/PurchaseFlow/PurchaseContext.php b/src/Eccube/Service/PurchaseFlow/PurchaseContext.php index 66ec9ea1cab..e7eace1f96e 100644 --- a/src/Eccube/Service/PurchaseFlow/PurchaseContext.php +++ b/src/Eccube/Service/PurchaseFlow/PurchaseContext.php @@ -60,7 +60,7 @@ public function __construct(?ItemHolderInterface $originHolder = null, UserInter * * @return ItemHolderInterface|null */ - public function getOriginHolder() + public function getOriginHolder(): ?ItemHolderInterface { return $this->originHolder; } @@ -70,7 +70,7 @@ public function getOriginHolder() * * @return Customer|UserInterface|null */ - public function getUser() + public function getUser(): Customer|UserInterface|null { return $this->user; } @@ -80,7 +80,7 @@ public function getUser() * * @return void */ - public function setFlowType($flowType) + public function setFlowType($flowType): void { $this->flowType = $flowType; } @@ -88,7 +88,7 @@ public function setFlowType($flowType) /** * @return bool */ - public function isOrderFlow() + public function isOrderFlow(): bool { return $this->flowType === self::ORDER_FLOW; } @@ -96,7 +96,7 @@ public function isOrderFlow() /** * @return bool */ - public function isShoppingFlow() + public function isShoppingFlow(): bool { return $this->flowType === self::SHOPPING_FLOW; } @@ -104,7 +104,7 @@ public function isShoppingFlow() /** * @return bool */ - public function isCartFlow() + public function isCartFlow(): bool { return $this->flowType === self::CART_FLOW; } diff --git a/src/Eccube/Service/PurchaseFlow/PurchaseFlow.php b/src/Eccube/Service/PurchaseFlow/PurchaseFlow.php index 84e9ef60cc5..b436edabe89 100644 --- a/src/Eccube/Service/PurchaseFlow/PurchaseFlow.php +++ b/src/Eccube/Service/PurchaseFlow/PurchaseFlow.php @@ -76,7 +76,7 @@ public function __construct() * * @return void */ - public function setFlowType($flowType) + public function setFlowType($flowType): void { $this->flowType = $flowType; } @@ -86,7 +86,7 @@ public function setFlowType($flowType) * * @return void */ - public function setPurchaseProcessors(ArrayCollection $processors) + public function setPurchaseProcessors(ArrayCollection $processors): void { $this->purchaseProcessors = $processors; } @@ -96,7 +96,7 @@ public function setPurchaseProcessors(ArrayCollection $processors) * * @return void */ - public function setItemValidators(ArrayCollection $itemValidators) + public function setItemValidators(ArrayCollection $itemValidators): void { $this->itemValidators = $itemValidators; } @@ -106,7 +106,7 @@ public function setItemValidators(ArrayCollection $itemValidators) * * @return void */ - public function setItemHolderValidators(ArrayCollection $itemHolderValidators) + public function setItemHolderValidators(ArrayCollection $itemHolderValidators): void { $this->itemHolderValidators = $itemHolderValidators; } @@ -116,7 +116,7 @@ public function setItemHolderValidators(ArrayCollection $itemHolderValidators) * * @return void */ - public function setItemPreprocessors(ArrayCollection $itemPreprocessors) + public function setItemPreprocessors(ArrayCollection $itemPreprocessors): void { $this->itemPreprocessors = $itemPreprocessors; } @@ -126,7 +126,7 @@ public function setItemPreprocessors(ArrayCollection $itemPreprocessors) * * @return void */ - public function setItemHolderPreprocessors(ArrayCollection $itemHolderPreprocessors) + public function setItemHolderPreprocessors(ArrayCollection $itemHolderPreprocessors): void { $this->itemHolderPreprocessors = $itemHolderPreprocessors; } @@ -136,7 +136,7 @@ public function setItemHolderPreprocessors(ArrayCollection $itemHolderPreprocess * * @return void */ - public function setItemHolderPostValidators(ArrayCollection $itemHolderPostValidators) + public function setItemHolderPostValidators(ArrayCollection $itemHolderPostValidators): void { $this->itemHolderPostValidators = $itemHolderPostValidators; } @@ -146,7 +146,7 @@ public function setItemHolderPostValidators(ArrayCollection $itemHolderPostValid * * @return void */ - public function setDiscountProcessors(ArrayCollection $discountProcessors) + public function setDiscountProcessors(ArrayCollection $discountProcessors): void { $this->discountProcessors = $discountProcessors; } @@ -157,7 +157,7 @@ public function setDiscountProcessors(ArrayCollection $discountProcessors) * * @return PurchaseFlowResult */ - public function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): PurchaseFlowResult { $context->setFlowType($this->flowType); @@ -228,7 +228,7 @@ public function validate(ItemHolderInterface $itemHolder, PurchaseContext $conte * * @throws PurchaseException */ - public function prepare(ItemHolderInterface $target, PurchaseContext $context) + public function prepare(ItemHolderInterface $target, PurchaseContext $context): void { $context->setFlowType($this->flowType); @@ -247,7 +247,7 @@ public function prepare(ItemHolderInterface $target, PurchaseContext $context) * * @throws PurchaseException */ - public function commit(ItemHolderInterface $target, PurchaseContext $context) + public function commit(ItemHolderInterface $target, PurchaseContext $context): void { $context->setFlowType($this->flowType); @@ -264,7 +264,7 @@ public function commit(ItemHolderInterface $target, PurchaseContext $context) * * @return void */ - public function rollback(ItemHolderInterface $target, PurchaseContext $context) + public function rollback(ItemHolderInterface $target, PurchaseContext $context): void { $context->setFlowType($this->flowType); @@ -278,7 +278,7 @@ public function rollback(ItemHolderInterface $target, PurchaseContext $context) * * @return void */ - public function addPurchaseProcessor(PurchaseProcessor $purchaseProcessor) + public function addPurchaseProcessor(PurchaseProcessor $purchaseProcessor): void { $this->purchaseProcessors[] = $purchaseProcessor; } @@ -288,7 +288,7 @@ public function addPurchaseProcessor(PurchaseProcessor $purchaseProcessor) * * @return void */ - public function addItemHolderPreprocessor(ItemHolderPreprocessor $itemHolderPreprocessor) + public function addItemHolderPreprocessor(ItemHolderPreprocessor $itemHolderPreprocessor): void { $this->itemHolderPreprocessors[] = $itemHolderPreprocessor; } @@ -298,7 +298,7 @@ public function addItemHolderPreprocessor(ItemHolderPreprocessor $itemHolderPrep * * @return void */ - public function addItemPreprocessor(ItemPreprocessor $itemPreprocessor) + public function addItemPreprocessor(ItemPreprocessor $itemPreprocessor): void { $this->itemPreprocessors[] = $itemPreprocessor; } @@ -308,7 +308,7 @@ public function addItemPreprocessor(ItemPreprocessor $itemPreprocessor) * * @return void */ - public function addItemValidator(ItemValidator $itemValidator) + public function addItemValidator(ItemValidator $itemValidator): void { $this->itemValidators[] = $itemValidator; } @@ -318,7 +318,7 @@ public function addItemValidator(ItemValidator $itemValidator) * * @return void */ - public function addItemHolderValidator(ItemHolderValidator $itemHolderValidator) + public function addItemHolderValidator(ItemHolderValidator $itemHolderValidator): void { $this->itemHolderValidators[] = $itemHolderValidator; } @@ -328,7 +328,7 @@ public function addItemHolderValidator(ItemHolderValidator $itemHolderValidator) * * @return void */ - public function addItemHolderPostValidator(ItemHolderPostValidator $itemHolderPostValidator) + public function addItemHolderPostValidator(ItemHolderPostValidator $itemHolderPostValidator): void { $this->itemHolderPostValidators[] = $itemHolderPostValidator; } @@ -338,7 +338,7 @@ public function addItemHolderPostValidator(ItemHolderPostValidator $itemHolderPo * * @return void */ - public function addDiscountProcessor(DiscountProcessor $discountProcessor) + public function addDiscountProcessor(DiscountProcessor $discountProcessor): void { $this->discountProcessors[] = $discountProcessor; } @@ -348,7 +348,7 @@ public function addDiscountProcessor(DiscountProcessor $discountProcessor) * * @return void */ - protected function calculateTotal(ItemHolderInterface $itemHolder) + protected function calculateTotal(ItemHolderInterface $itemHolder): void { $total = array_reduce($itemHolder->getItems()->toArray(), function ($sum, ItemInterface $item) { $sum = bcadd($sum, bcmul($item->getPriceIncTax(), $item->getQuantity(), 2), 2); @@ -368,7 +368,7 @@ protected function calculateTotal(ItemHolderInterface $itemHolder) * * @return void */ - protected function calculateSubTotal(ItemHolderInterface $itemHolder) + protected function calculateSubTotal(ItemHolderInterface $itemHolder): void { $total = $itemHolder->getItems() ->getProductClasses() @@ -389,7 +389,7 @@ protected function calculateSubTotal(ItemHolderInterface $itemHolder) * * @return void */ - protected function calculateDeliveryFeeTotal(ItemHolderInterface $itemHolder) + protected function calculateDeliveryFeeTotal(ItemHolderInterface $itemHolder): void { $total = $itemHolder->getItems() ->getDeliveryFees() @@ -406,7 +406,7 @@ protected function calculateDeliveryFeeTotal(ItemHolderInterface $itemHolder) * * @return void */ - protected function calculateDiscount(ItemHolderInterface $itemHolder) + protected function calculateDiscount(ItemHolderInterface $itemHolder): void { $total = $itemHolder->getItems() ->getDiscounts() @@ -424,7 +424,7 @@ protected function calculateDiscount(ItemHolderInterface $itemHolder) * * @return void */ - protected function calculateCharge(ItemHolderInterface $itemHolder) + protected function calculateCharge(ItemHolderInterface $itemHolder): void { $total = $itemHolder->getItems() ->getCharges() @@ -441,7 +441,7 @@ protected function calculateCharge(ItemHolderInterface $itemHolder) * * @return void */ - protected function calculateTax(ItemHolderInterface $itemHolder) + protected function calculateTax(ItemHolderInterface $itemHolder): void { if ($itemHolder instanceof Order) { $total = array_reduce($itemHolder->getTaxByTaxRate(), function ($sum, $tax) { @@ -464,7 +464,7 @@ protected function calculateTax(ItemHolderInterface $itemHolder) * * @return void */ - protected function calculateAll(ItemHolderInterface $itemHolder) + protected function calculateAll(ItemHolderInterface $itemHolder): void { $this->calculateDeliveryFeeTotal($itemHolder); $this->calculateCharge($itemHolder); @@ -479,7 +479,7 @@ protected function calculateAll(ItemHolderInterface $itemHolder) * * @return string */ - public function dump() + public function dump(): string { /** @var \Closure(mixed): mixed $callback */ $callback = function ($processor) { diff --git a/src/Eccube/Service/PurchaseFlow/PurchaseFlowResult.php b/src/Eccube/Service/PurchaseFlow/PurchaseFlowResult.php index b08ab9b3a10..88cfb371209 100644 --- a/src/Eccube/Service/PurchaseFlow/PurchaseFlowResult.php +++ b/src/Eccube/Service/PurchaseFlow/PurchaseFlowResult.php @@ -38,7 +38,7 @@ public function __construct(ItemHolderInterface $itemHolder) * * @return void */ - public function addProcessResult(ProcessResult $processResult) + public function addProcessResult(ProcessResult $processResult): void { $this->processResults[] = $processResult; } @@ -46,7 +46,7 @@ public function addProcessResult(ProcessResult $processResult) /** * @return array|ProcessResult[] */ - public function getErrors() + public function getErrors(): array { return array_filter($this->processResults, function (ProcessResult $processResult) { return $processResult->isError(); @@ -56,7 +56,7 @@ public function getErrors() /** * @return array|ProcessResult[] */ - public function getWarning() + public function getWarning(): array { return array_filter($this->processResults, function (ProcessResult $processResult) { return $processResult->isWarning(); @@ -66,7 +66,7 @@ public function getWarning() /** * @return bool */ - public function hasError() + public function hasError(): bool { return !empty($this->getErrors()); } @@ -74,7 +74,7 @@ public function hasError() /** * @return bool */ - public function hasWarning() + public function hasWarning(): bool { return !empty($this->getWarning()); } @@ -82,7 +82,7 @@ public function hasWarning() /** * @return ItemHolderInterface */ - public function getItemHolder() + public function getItemHolder(): ItemHolderInterface { return $this->itemHolder; } diff --git a/src/Eccube/Service/PurchaseFlow/PurchaseProcessor.php b/src/Eccube/Service/PurchaseFlow/PurchaseProcessor.php index 50644f57086..b4bcad687c2 100644 --- a/src/Eccube/Service/PurchaseFlow/PurchaseProcessor.php +++ b/src/Eccube/Service/PurchaseFlow/PurchaseProcessor.php @@ -33,7 +33,7 @@ interface PurchaseProcessor * * @throws PurchaseException */ - public function prepare(ItemHolderInterface $target, PurchaseContext $context); + public function prepare(ItemHolderInterface $target, PurchaseContext $context): void; /** * 受注の確定処理を行います。 @@ -46,7 +46,7 @@ public function prepare(ItemHolderInterface $target, PurchaseContext $context); * * @throws PurchaseException */ - public function commit(ItemHolderInterface $target, PurchaseContext $context); + public function commit(ItemHolderInterface $target, PurchaseContext $context): void; /** * 仮確定した受注データの取り消し処理を行います。 @@ -56,5 +56,5 @@ public function commit(ItemHolderInterface $target, PurchaseContext $context); * * @return void */ - public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context); + public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context): void; } diff --git a/src/Eccube/Service/PurchaseFlow/ValidatorTrait.php b/src/Eccube/Service/PurchaseFlow/ValidatorTrait.php index 4db1f76b27b..3b75f00d076 100644 --- a/src/Eccube/Service/PurchaseFlow/ValidatorTrait.php +++ b/src/Eccube/Service/PurchaseFlow/ValidatorTrait.php @@ -26,7 +26,7 @@ trait ValidatorTrait * * @throws InvalidItemException */ - protected function throwInvalidItemException($errorCode, ?ProductClass $ProductClass = null, $warning = false) + protected function throwInvalidItemException($errorCode, ?ProductClass $ProductClass = null, $warning = false): void { if ($ProductClass) { $productName = $ProductClass->getProduct()->getName(); diff --git a/src/Eccube/Service/SchemaService.php b/src/Eccube/Service/SchemaService.php index edcf759b37a..ceea057661e 100644 --- a/src/Eccube/Service/SchemaService.php +++ b/src/Eccube/Service/SchemaService.php @@ -60,7 +60,7 @@ public function __construct(EntityManagerInterface $entityManager, PluginContext * * @return void */ - public function executeCallback(callable $callback, $generatedFiles, $proxiesDirectory, $outputDir = null) + public function executeCallback(callable $callback, $generatedFiles, $proxiesDirectory, $outputDir = null): void { $createOutputDir = false; if (is_null($outputDir)) { @@ -127,7 +127,7 @@ public function executeCallback(callable $callback, $generatedFiles, $proxiesDir * * @return void */ - public function updateSchema($generatedFiles, $proxiesDirectory, $saveMode = false) + public function updateSchema($generatedFiles, $proxiesDirectory, $saveMode = false): void { $this->executeCallback(function (SchemaTool $tool, array $metaData) use ($saveMode) { $tool->updateSchema($metaData, $saveMode); @@ -141,7 +141,7 @@ public function updateSchema($generatedFiles, $proxiesDirectory, $saveMode = fal * * @return void */ - public function dropTable($targetNamespace) + public function dropTable($targetNamespace): void { /** @var MappingDriver $mappingDriver */ $mappingDriver = $this->entityManager->getConfiguration()->getMetadataDriverImpl(); diff --git a/src/Eccube/Service/SystemService.php b/src/Eccube/Service/SystemService.php index acee78ee074..0cbcdcbdadd 100644 --- a/src/Eccube/Service/SystemService.php +++ b/src/Eccube/Service/SystemService.php @@ -67,7 +67,7 @@ public function __construct( * * @return string */ - public function getDbversion() + public function getDbversion(): string { $rsm = new \Doctrine\ORM\Query\ResultSetMapping(); $rsm->addScalarResult('v', 'v'); @@ -104,7 +104,7 @@ public function getDbversion() * * @return bool */ - public function canSetMemoryLimit($memory) + public function canSetMemoryLimit($memory): bool { try { $ret = ini_set('memory_limit', $memory); @@ -120,7 +120,7 @@ public function canSetMemoryLimit($memory) * * @return float|int */ - public function getMemoryLimit() + public function getMemoryLimit(): float|int { // Data type: bytes $memoryLimit = (new MemoryDataCollector())->getMemoryLimit(); @@ -143,7 +143,7 @@ public function getMemoryLimit() * * @return void */ - public function switchMaintenance($isEnable = false, $mode = self::AUTO_MAINTENANCE, bool $force = false) + public function switchMaintenance($isEnable = false, $mode = self::AUTO_MAINTENANCE, bool $force = false): void { if ($isEnable) { $this->enableMaintenance($mode, $force); @@ -174,7 +174,7 @@ public function getMaintenanceToken(): ?string * * @return void */ - public function disableMaintenanceEvent(TerminateEvent $event) + public function disableMaintenanceEvent(TerminateEvent $event): void { if ($this->disableMaintenanceAfterResponse) { $this->switchMaintenance(false, $this->maintenanceMode); @@ -205,7 +205,7 @@ public function enableMaintenance($mode = self::AUTO_MAINTENANCE, bool $force = * * @return void */ - public function disableMaintenance($mode = self::AUTO_MAINTENANCE) + public function disableMaintenance($mode = self::AUTO_MAINTENANCE): void { $this->disableMaintenanceAfterResponse = true; $this->maintenanceMode = $mode; @@ -237,7 +237,7 @@ public function disableMaintenanceNow($mode = self::AUTO_MAINTENANCE, bool $forc * * @return bool */ - public function isMaintenanceMode() + public function isMaintenanceMode(): bool { // .maintenanceが存在しているかチェック return \file_exists($this->eccubeConfig->get('eccube_content_maintenance_file_path')); @@ -247,7 +247,7 @@ public function isMaintenanceMode() * {@inheritdoc} */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [KernelEvents::TERMINATE => 'disableMaintenanceEvent']; } diff --git a/src/Eccube/Service/TaxRuleService.php b/src/Eccube/Service/TaxRuleService.php index 1453645acb6..a6a627d0739 100644 --- a/src/Eccube/Service/TaxRuleService.php +++ b/src/Eccube/Service/TaxRuleService.php @@ -47,7 +47,7 @@ public function __construct(TaxRuleRepository $taxRuleRepository, BaseInfoReposi * * @return string 税金付与した金額 */ - public function getTax($price, $product = null, $productClass = null, $pref = null, $country = null) + public function getTax($price, $product = null, $productClass = null, $pref = null, $country = null): string { /* * 商品別税率が有効で商品別税率が設定されている場合は商品別税率 @@ -79,7 +79,7 @@ public function getTax($price, $product = null, $productClass = null, $pref = nu * * @return string */ - public function getPriceIncTax($price, $product = null, $productClass = null, $pref = null, $country = null) + public function getPriceIncTax($price, $product = null, $productClass = null, $pref = null, $country = null): string { return bcadd($price, $this->getTax($price, $product, $productClass, $pref, $country), 2); } @@ -94,7 +94,7 @@ public function getPriceIncTax($price, $product = null, $productClass = null, $p * * @return string 税金額 */ - public function calcTax($price, $taxRate, $RoundingType, $taxAdjust = '0') + public function calcTax($price, $taxRate, $RoundingType, $taxAdjust = '0'): string { // tax = price * taxRate / 100 $tax = bcdiv(bcmul($price, $taxRate, 4), '100', 4); @@ -113,7 +113,7 @@ public function calcTax($price, $taxRate, $RoundingType, $taxAdjust = '0') * * @return string 税金額 */ - public function calcTaxIncluded($price, $taxRate, $RoundingType, $taxAdjust = '0') + public function calcTaxIncluded($price, $taxRate, $RoundingType, $taxAdjust = '0'): string { // tax = (price - taxAdjust) * taxRate / (100 + taxRate) $priceAfterAdjust = bcsub($price, $taxAdjust, 4); @@ -131,7 +131,7 @@ public function calcTaxIncluded($price, $taxRate, $RoundingType, $taxAdjust = '0 * * @return string 端数処理後の数値 */ - public static function roundByRoundingType($value, $RoundingType) + public static function roundByRoundingType($value, $RoundingType): string { $ret = match ($RoundingType) { // 四捨五入 diff --git a/src/Eccube/Service/TwoFactorAuthService.php b/src/Eccube/Service/TwoFactorAuthService.php index 82e267ddab1..d17337c247a 100644 --- a/src/Eccube/Service/TwoFactorAuthService.php +++ b/src/Eccube/Service/TwoFactorAuthService.php @@ -101,7 +101,7 @@ public function __construct( * * @return bool */ - public function isAuth($Member) + public function isAuth($Member): bool { if ($json = $this->request->cookies->get($this->cookieName)) { $configs = json_decode($json); @@ -130,7 +130,7 @@ public function isAuth($Member) * * @return Cookie */ - public function createAuthedCookie($Member) + public function createAuthedCookie($Member): Cookie { $hasher = $this->passwordHasherFactory->getPasswordHasher($Member); $encodedString = $hasher->hash($Member->getId().$Member->getTwoFactorAuthKey()); @@ -165,7 +165,7 @@ public function createAuthedCookie($Member) * * @return bool */ - public function verifyCode($authKey, $token) + public function verifyCode($authKey, $token): bool { return $this->tfa->verifyCode($authKey, $token, 2); } @@ -173,7 +173,7 @@ public function verifyCode($authKey, $token) /** * @return string */ - public function createSecret() + public function createSecret(): string { return $this->tfa->createSecret(); } @@ -181,7 +181,7 @@ public function createSecret() /** * @return bool */ - public function isEnabled() + public function isEnabled(): bool { $enabled = $this->eccubeConfig->get('eccube_2fa_enabled'); if (is_string($enabled) && $enabled === '0' || $enabled === false) { diff --git a/src/Eccube/Session/Session.php b/src/Eccube/Session/Session.php index a67e7e78d4e..a567396d195 100644 --- a/src/Eccube/Session/Session.php +++ b/src/Eccube/Session/Session.php @@ -47,7 +47,7 @@ public function getId(): string } #[\Override] - public function setId(string $id) + public function setId(string $id): void { $this->getSession()->setId($id); } @@ -59,7 +59,7 @@ public function getName(): string } #[\Override] - public function setName(string $name) + public function setName(string $name): void { $this->getSession()->setName($name); } @@ -77,7 +77,7 @@ public function migrate(bool $destroy = false, ?int $lifetime = null): bool } #[\Override] - public function save() + public function save(): void { $this->getSession()->save(); } @@ -95,7 +95,7 @@ public function get(string $name, mixed $default = null): mixed } #[\Override] - public function set(string $name, mixed $value) + public function set(string $name, mixed $value): void { $this->getSession()->set($name, $value); } @@ -113,7 +113,7 @@ public function all(): array * @param array $attributes */ #[\Override] - public function replace(array $attributes) + public function replace(array $attributes): void { $this->getSession()->replace($attributes); } @@ -125,7 +125,7 @@ public function remove(string $name): mixed } #[\Override] - public function clear() + public function clear(): void { $this->getSession()->clear(); } @@ -137,7 +137,7 @@ public function isStarted(): bool } #[\Override] - public function registerBag(SessionBagInterface $bag) + public function registerBag(SessionBagInterface $bag): void { $this->getSession()->registerBag($bag); } diff --git a/src/Eccube/Session/Storage/Handler/SameSiteNoneCompatSessionHandler.php b/src/Eccube/Session/Storage/Handler/SameSiteNoneCompatSessionHandler.php index 492593115f4..77191d4a4a4 100644 --- a/src/Eccube/Session/Storage/Handler/SameSiteNoneCompatSessionHandler.php +++ b/src/Eccube/Session/Storage/Handler/SameSiteNoneCompatSessionHandler.php @@ -194,7 +194,7 @@ public function gc($maxlifetime): int|false /** * @return string */ - public function getCookieSameSite() + public function getCookieSameSite(): string { if ($this->shouldSendSameSiteNone() && $this->getCookieSecure()) { return Cookie::SAMESITE_NONE; @@ -206,7 +206,7 @@ public function getCookieSameSite() /** * @return string */ - public function getCookiePath() + public function getCookiePath(): string { return env('ECCUBE_COOKIE_PATH', '/'); } @@ -214,7 +214,7 @@ public function getCookiePath() /** * @return string */ - public function getCookieSecure() + public function getCookieSecure(): string { $request = Request::createFromGlobals(); @@ -224,7 +224,7 @@ public function getCookieSecure() /** * @return bool */ - private function shouldSendSameSiteNone() + private function shouldSendSameSiteNone(): bool { $userAgent = array_key_exists('HTTP_USER_AGENT', $_SERVER) ? $_SERVER['HTTP_USER_AGENT'] : null; diff --git a/src/Eccube/Twig/Extension/CartServiceExtension.php b/src/Eccube/Twig/Extension/CartServiceExtension.php index 3bf38256e51..84df71afe35 100644 --- a/src/Eccube/Twig/Extension/CartServiceExtension.php +++ b/src/Eccube/Twig/Extension/CartServiceExtension.php @@ -31,7 +31,7 @@ public function __construct(CartService $cartService) } #[\Override] - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('get_cart', $this->get_cart(...), ['is_safe' => ['all']]), @@ -44,7 +44,7 @@ public function getFunctions() /** * @return Cart|null */ - public function get_cart() + public function get_cart(): ?Cart { return $this->cartService->getCart(); } @@ -52,7 +52,7 @@ public function get_cart() /** * @return Cart[] */ - public function get_all_carts() + public function get_all_carts(): array { return $this->cartService->getCarts(); } @@ -60,7 +60,7 @@ public function get_all_carts() /** * @return string */ - public function get_carts_total_price() + public function get_carts_total_price(): string { $Carts = $this->cartService->getCarts(); $totalPrice = array_reduce($Carts, function (string $total, Cart $Cart) { @@ -75,7 +75,7 @@ public function get_carts_total_price() /** * @return string */ - public function get_carts_total_quantity() + public function get_carts_total_quantity(): string { $Carts = $this->cartService->getCarts(); $totalQuantity = array_reduce($Carts, function ($total, Cart $Cart) { diff --git a/src/Eccube/Twig/Extension/CsrfExtension.php b/src/Eccube/Twig/Extension/CsrfExtension.php index fe290bc0cde..74d7755c168 100644 --- a/src/Eccube/Twig/Extension/CsrfExtension.php +++ b/src/Eccube/Twig/Extension/CsrfExtension.php @@ -39,7 +39,7 @@ public function __construct(CsrfTokenManagerInterface $tokenManager) * @return array */ #[\Override] - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('csrf_token_for_anchor', $this->getCsrfTokenForAnchor(...), ['is_safe' => ['all']]), @@ -49,7 +49,7 @@ public function getFunctions() /** * @return string */ - public function getCsrfTokenForAnchor() + public function getCsrfTokenForAnchor(): string { $token = $this->tokenManager->getToken(Constant::TOKEN_NAME)->getValue(); @@ -59,7 +59,7 @@ public function getCsrfTokenForAnchor() /** * @return string */ - public function getCsrfToken() + public function getCsrfToken(): string { return $this->tokenManager->getToken(Constant::TOKEN_NAME)->getValue(); } diff --git a/src/Eccube/Twig/Extension/EccubeBlockExtension.php b/src/Eccube/Twig/Extension/EccubeBlockExtension.php index c81073f20b7..d8ff1feed5f 100644 --- a/src/Eccube/Twig/Extension/EccubeBlockExtension.php +++ b/src/Eccube/Twig/Extension/EccubeBlockExtension.php @@ -42,7 +42,7 @@ public function __construct(Environment $twig, array $blockTemplates) * @return TwigFunction[] */ #[\Override] - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('eccube_block_*', function ($context, $name, array $parameters = []) { diff --git a/src/Eccube/Twig/Extension/EccubeExtension.php b/src/Eccube/Twig/Extension/EccubeExtension.php index 4aba07c3dab..c334a6a1e09 100644 --- a/src/Eccube/Twig/Extension/EccubeExtension.php +++ b/src/Eccube/Twig/Extension/EccubeExtension.php @@ -56,7 +56,7 @@ public function __construct(EccubeConfig $eccubeConfig, ProductRepository $produ * @return TwigFunction[] An array of functions */ #[\Override] - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('has_errors', $this->hasErrors(...)), @@ -73,7 +73,7 @@ public function getFunctions() * @return TwigFilter[] */ #[\Override] - public function getFilters() + public function getFilters(): array { return [ new TwigFilter('no_image_product', $this->getNoImageProduct(...)), @@ -91,7 +91,7 @@ public function getFilters() * @return TwigTest[] */ #[\Override] - public function getTests() + public function getTests(): array { return [ new TwigTest('integer', function ($value) { return is_integer($value); }), @@ -103,7 +103,7 @@ public function getTests() * * @return string */ - public function getName() + public function getName(): string { return 'eccube'; } @@ -115,7 +115,7 @@ public function getName() * * @return array */ - public function getActiveMenus($menus = []) + public function getActiveMenus($menus = []): array { $count = count($menus); for ($i = $count; $i <= 2; $i++) { @@ -133,7 +133,7 @@ public function getActiveMenus($menus = []) * * @return string */ - public function getNoImageProduct($image) + public function getNoImageProduct($image): string { return empty($image) ? 'no_image_product.png' : $image; } @@ -147,7 +147,7 @@ public function getNoImageProduct($image) * * @return string */ - public function getDateFormatFilter($date, $value = '', $format = 'Y/m/d') + public function getDateFormatFilter($date, $value = '', $format = 'Y/m/d'): string { if (is_null($date)) { return $value; @@ -166,7 +166,7 @@ public function getDateFormatFilter($date, $value = '', $format = 'Y/m/d') * * @return string */ - public function getPriceFilter($number, $decimals = 0, $decPoint = '.', $thousandsSep = ',') + public function getPriceFilter($number, $decimals = 0, $decPoint = '.', $thousandsSep = ','): string { /** @var string $locale */ $locale = $this->eccubeConfig['locale']; @@ -186,7 +186,7 @@ public function getPriceFilter($number, $decimals = 0, $decPoint = '.', $thousan * * @return string */ - public function getEllipsis($value, $length = 100, $end = '...') + public function getEllipsis($value, $length = 100, $end = '...'): string { return StringUtil::ellipsis($value, $length, $end); } @@ -198,7 +198,7 @@ public function getEllipsis($value, $length = 100, $end = '...') * * @return string */ - public function getTimeAgo($date) + public function getTimeAgo($date): string { return StringUtil::timeAgo($date); } @@ -208,7 +208,7 @@ public function getTimeAgo($date) * * @return bool */ - public function hasErrors() + public function hasErrors(): bool { $hasErrors = false; @@ -235,7 +235,7 @@ public function hasErrors() * * @return Product|null */ - public function getProduct($id) + public function getProduct($id): ?Product { try { $Product = $this->productRepository->findWithSortedClassCategories($id); @@ -257,7 +257,7 @@ public function getProduct($id) * * @return string */ - public function getClassCategoriesAsJson(Product $Product) + public function getClassCategoriesAsJson(Product $Product): string { $Product->_calc(); $class_categories = [ @@ -318,7 +318,7 @@ public function getClassCategoriesAsJson(Product $Product) * * @return string */ - public function getExtensionIcon($ext, $attr = [], $iconOnly = false) + public function getExtensionIcon($ext, $attr = [], $iconOnly = false): string { $classes = [ 'txt' => 'fa-file-text-o', @@ -377,7 +377,7 @@ public function getExtensionIcon($ext, $attr = [], $iconOnly = false) * * @return bool|string */ - public function getCurrencySymbol($currency = null) + public function getCurrencySymbol($currency = null): bool|string { if (is_null($currency)) { $currency = $this->eccubeConfig->get('currency'); diff --git a/src/Eccube/Twig/Extension/IgnoreRoutingNotFoundExtension.php b/src/Eccube/Twig/Extension/IgnoreRoutingNotFoundExtension.php index 0a47fb1eab7..a49f9b54abe 100644 --- a/src/Eccube/Twig/Extension/IgnoreRoutingNotFoundExtension.php +++ b/src/Eccube/Twig/Extension/IgnoreRoutingNotFoundExtension.php @@ -60,7 +60,7 @@ public function getFunctions(): array * * @throws RouteNotFoundException */ - public function getPath($name, $parameters = [], $relative = false) + public function getPath($name, $parameters = [], $relative = false): string { try { return $this->generator->generate($name, $parameters, $relative ? UrlGeneratorInterface::RELATIVE_PATH : UrlGeneratorInterface::ABSOLUTE_PATH); @@ -84,7 +84,7 @@ public function getPath($name, $parameters = [], $relative = false) * * @throws RouteNotFoundException */ - public function getUrl($name, $parameters = [], $schemeRelative = false) + public function getUrl($name, $parameters = [], $schemeRelative = false): string { try { return $this->generator->generate($name, $parameters, $schemeRelative ? UrlGeneratorInterface::NETWORK_PATH : UrlGeneratorInterface::ABSOLUTE_URL); diff --git a/src/Eccube/Twig/Extension/IntlExtension.php b/src/Eccube/Twig/Extension/IntlExtension.php index 25ca3064918..b522fa354bf 100644 --- a/src/Eccube/Twig/Extension/IntlExtension.php +++ b/src/Eccube/Twig/Extension/IntlExtension.php @@ -23,7 +23,7 @@ class IntlExtension extends AbstractExtension * {@inheritdoc} */ #[\Override] - public function getFilters() + public function getFilters(): array { return [ new TwigFilter('date_day', $this->date_day(...), ['needs_environment' => true]), @@ -64,7 +64,7 @@ public function date_day(Environment $env, $date): bool|string * * @return bool|string */ - public function date_min(Environment $env, $date) + public function date_min(Environment $env, $date): bool|string { if (!$date) { return ''; @@ -84,7 +84,7 @@ public function date_min(Environment $env, $date) * * @return bool|string */ - public function date_sec(Environment $env, $date) + public function date_sec(Environment $env, $date): bool|string { if (!$date) { return ''; @@ -99,7 +99,7 @@ public function date_sec(Environment $env, $date) * * @return bool|string */ - public function date_day_with_weekday(Environment $env, $date) + public function date_day_with_weekday(Environment $env, $date): bool|string { if (!$date) { return ''; diff --git a/src/Eccube/Twig/Extension/RepositoryExtension.php b/src/Eccube/Twig/Extension/RepositoryExtension.php index 93b65b0eed2..065492a4561 100644 --- a/src/Eccube/Twig/Extension/RepositoryExtension.php +++ b/src/Eccube/Twig/Extension/RepositoryExtension.php @@ -30,7 +30,7 @@ public function __construct(EntityManagerInterface $em) } #[\Override] - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('repository', function ($entity) { diff --git a/src/Eccube/Twig/Extension/TaxExtension.php b/src/Eccube/Twig/Extension/TaxExtension.php index ccc4ba02c44..7bc02e4421f 100644 --- a/src/Eccube/Twig/Extension/TaxExtension.php +++ b/src/Eccube/Twig/Extension/TaxExtension.php @@ -41,7 +41,7 @@ public function __construct(TaxRuleRepository $taxRuleRepository) * @return TwigFunction[] An array of functions */ #[\Override] - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('is_reduced_tax_rate', $this->isReducedTaxRate(...)), @@ -57,7 +57,7 @@ public function getFunctions() * * @return bool */ - public function isReducedTaxRate(OrderItem $OrderItem) + public function isReducedTaxRate(OrderItem $OrderItem): bool { $Order = $OrderItem->getOrder(); diff --git a/src/Eccube/Twig/Extension/TemplateEventExtension.php b/src/Eccube/Twig/Extension/TemplateEventExtension.php index 10f4ec3a506..83c3f248fa6 100644 --- a/src/Eccube/Twig/Extension/TemplateEventExtension.php +++ b/src/Eccube/Twig/Extension/TemplateEventExtension.php @@ -23,7 +23,7 @@ class TemplateEventExtension extends AbstractExtension { #[\Override] - public function getNodeVisitors() + public function getNodeVisitors(): array { return [new TemplateEventNodeVisiror()]; } @@ -51,7 +51,7 @@ public function leaveNode(Node $node, Environment $env): Node } #[\Override] - public function getPriority() + public function getPriority(): int { return 0; } @@ -60,7 +60,7 @@ public function getPriority() class TemplateEventNode extends Node { #[\Override] - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->write('$__eccube__gblobal = $this->env->getGlobals();') diff --git a/src/Eccube/Twig/Extension/TwigIncludeExtension.php b/src/Eccube/Twig/Extension/TwigIncludeExtension.php index e14525c4dce..f2d3ef0fb4e 100644 --- a/src/Eccube/Twig/Extension/TwigIncludeExtension.php +++ b/src/Eccube/Twig/Extension/TwigIncludeExtension.php @@ -30,7 +30,7 @@ public function __construct(\Twig\Environment $twig) } #[\Override] - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('include_dispatch', $this->include_dispatch(...), @@ -47,7 +47,7 @@ public function getFunctions() * * @return string レンダリング結果 */ - public function include_dispatch($context, $template, $variables = []) + public function include_dispatch($context, $template, $variables = []): string { if (!empty($variables)) { $context = array_merge($context, $variables); diff --git a/src/Eccube/Twig/Template.php b/src/Eccube/Twig/Template.php index 0adafa05040..88dfb90f2eb 100644 --- a/src/Eccube/Twig/Template.php +++ b/src/Eccube/Twig/Template.php @@ -82,7 +82,7 @@ public function getDebugInfo(): array * * @return array */ - protected function doDisplay(array $context, array $blocks = []): iterable + protected function doDisplay(array $context, array $blocks = []): array { // Templateのキャッシュ作成時に動的に作成されるメソッド return []; diff --git a/src/Eccube/Util/CacheUtil.php b/src/Eccube/Util/CacheUtil.php index 109a573f6ce..bf7c144a602 100644 --- a/src/Eccube/Util/CacheUtil.php +++ b/src/Eccube/Util/CacheUtil.php @@ -63,7 +63,7 @@ public function __construct(KernelInterface $kernel, ContainerInterface $contain * * @return void */ - public function clearCache($env = null) + public function clearCache($env = null): void { $this->clearCacheAfterResponse = $env; } @@ -71,14 +71,14 @@ public function clearCache($env = null) /** * @param TerminateEvent $event * - * @return string|void + * @return string * * @throws \Exception */ - public function forceClearCache(TerminateEvent $event) + public function forceClearCache(TerminateEvent $event): string { if ($this->clearCacheAfterResponse === false) { - return; + return ''; } $console = new Application($this->kernel); @@ -126,7 +126,7 @@ public function forceClearCache(TerminateEvent $event) * * @throws \Exception */ - public function clearDoctrineCache() + public function clearDoctrineCache(): ?string { /** @var Psr6CacheClearer $poolClearer */ $poolClearer = $this->container->get('cache.global_clearer'); @@ -160,7 +160,7 @@ public function clearDoctrineCache() * * @return void */ - public function clearTwigCache() + public function clearTwigCache(): void { $cacheDir = $this->kernel->getCacheDir().'/twig'; $fs = new Filesystem(); @@ -181,7 +181,7 @@ public function clearTwigCache() * * @deprecated CacheUtil::clearCacheを利用すること */ - public static function clear($app, $isAll, $isTwig = false) + public static function clear($app, $isAll, $isTwig = false): bool { $cacheDir = $app['config']['root_dir'].'/app/cache'; @@ -234,7 +234,7 @@ public static function clear($app, $isAll, $isTwig = false) * {@inheritdoc} */ #[\Override] - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [KernelEvents::TERMINATE => 'forceClearCache']; } diff --git a/src/Eccube/Util/EntityUtil.php b/src/Eccube/Util/EntityUtil.php index 40e3bd318d3..7718accfd61 100644 --- a/src/Eccube/Util/EntityUtil.php +++ b/src/Eccube/Util/EntityUtil.php @@ -26,7 +26,7 @@ class EntityUtil * * @return array エンティティのプロパティの配列 */ - public static function dumpToArray($entity) + public static function dumpToArray($entity): array { $objReflect = new \ReflectionClass($entity); $arrProperties = $objReflect->getProperties(); diff --git a/src/Eccube/Util/FilesystemUtil.php b/src/Eccube/Util/FilesystemUtil.php index 268dfa5f04a..05056c248d3 100644 --- a/src/Eccube/Util/FilesystemUtil.php +++ b/src/Eccube/Util/FilesystemUtil.php @@ -23,7 +23,7 @@ class FilesystemUtil * * @return string */ - public static function sizeToHumanReadable($size, $decimals = 0) + public static function sizeToHumanReadable($size, $decimals = 0): string { $units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; diff --git a/src/Eccube/Util/FormUtil.php b/src/Eccube/Util/FormUtil.php index 2989ee5b16d..844ebfb2f64 100644 --- a/src/Eccube/Util/FormUtil.php +++ b/src/Eccube/Util/FormUtil.php @@ -22,9 +22,9 @@ class FormUtil * * @param FormInterface $form * - * @return array + * @return mixed */ - public static function getViewData(FormInterface $form) + public static function getViewData(FormInterface $form): mixed { $viewData = []; $forms = $form->all(); @@ -53,7 +53,7 @@ public static function getViewData(FormInterface $form) * * @return mixed */ - public static function submitAndGetData(FormInterface $form, $viewData) + public static function submitAndGetData(FormInterface $form, $viewData): mixed { $form->submit($viewData); diff --git a/src/Eccube/Util/ReflectionUtil.php b/src/Eccube/Util/ReflectionUtil.php index 1ab1a165d28..10daa1ff0d1 100644 --- a/src/Eccube/Util/ReflectionUtil.php +++ b/src/Eccube/Util/ReflectionUtil.php @@ -24,7 +24,7 @@ class ReflectionUtil * * @throws \ReflectionException */ - public static function setValue($instance, $property, $value) + public static function setValue($instance, $property, $value): void { $refObj = new \ReflectionObject($instance); $refProp = $refObj->getProperty($property); @@ -40,7 +40,7 @@ public static function setValue($instance, $property, $value) * * @throws \ReflectionException */ - public static function setValues($instance, array $values) + public static function setValues($instance, array $values): void { foreach ($values as $property => $value) { self::setValue($instance, $property, $value); diff --git a/src/Eccube/Util/StringUtil.php b/src/Eccube/Util/StringUtil.php index 7a12e49a81c..704af33bc10 100644 --- a/src/Eccube/Util/StringUtil.php +++ b/src/Eccube/Util/StringUtil.php @@ -48,7 +48,7 @@ class StringUtil * * @throws \RuntimeException */ - public static function random($length = 16) + public static function random($length = 16): string { if (function_exists('openssl_random_pseudo_bytes')) { /** @var string|false $bytes */ @@ -95,7 +95,7 @@ public static function random($length = 16) * * @return string */ - public static function quickRandom($length = 16) + public static function quickRandom($length = 16): string { $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; @@ -110,7 +110,7 @@ public static function quickRandom($length = 16) * * @return string */ - public static function convertLineFeed($value, $lf = "\n") + public static function convertLineFeed($value, $lf = "\n"): string { if (empty($value)) { return ''; @@ -127,7 +127,7 @@ public static function convertLineFeed($value, $lf = "\n") * * @return string|null */ - public static function characterEncoding($value, $encoding = ['UTF-8', 'SJIS', 'EUC-JP', 'ASCII', 'JIS', 'sjis-win']) + public static function characterEncoding($value, $encoding = ['UTF-8', 'SJIS', 'EUC-JP', 'ASCII', 'JIS', 'sjis-win']): ?string { foreach ($encoding as $encode) { if (mb_check_encoding($value, $encode)) { @@ -148,7 +148,7 @@ public static function characterEncoding($value, $encoding = ['UTF-8', 'SJIS', ' * * @return string */ - public static function ellipsis($value, $length = 100, $end = '...') + public static function ellipsis($value, $length = 100, $end = '...'): string { if (mb_strlen($value) <= $length) { return $value; @@ -164,7 +164,7 @@ public static function ellipsis($value, $length = 100, $end = '...') * * @return string */ - public static function timeAgo($date) + public static function timeAgo($date): string { if (empty($date)) { return ''; @@ -223,7 +223,7 @@ public static function timeAgo($date) * * @return bool $value が空白と判断された場合 true */ - public static function isBlank($value, $greedy = false) + public static function isBlank($value, $greedy = false): bool { $deprecated = '\Eccube\Util\StringUtil::isBlank() の第一引数は文字型、数値を使用してください'; // テストカバレッジを上げるために return の前で trigger_error をスローしている @@ -287,7 +287,7 @@ public static function isBlank($value, $greedy = false) * * @return bool */ - public static function isNotBlank($value, $greedy = false) + public static function isNotBlank($value, $greedy = false): bool { return !self::isBlank($value, $greedy); } @@ -299,7 +299,7 @@ public static function isNotBlank($value, $greedy = false) * * @return string|int|null */ - public static function trimAll($value) + public static function trimAll($value): string|int|null { if ($value === '') { return ''; @@ -322,7 +322,7 @@ public static function trimAll($value) * * @return string */ - public static function replaceOrAddEnv($env, array $replacement) + public static function replaceOrAddEnv($env, array $replacement): string { foreach ($replacement as $key => $value) { $pattern = '/^('.$key.')=(.*)/m'; diff --git a/src/Eccube/Validator/EmailValidator/NoRFCEmailValidator.php b/src/Eccube/Validator/EmailValidator/NoRFCEmailValidator.php index efecb5358a3..55e7980b70a 100644 --- a/src/Eccube/Validator/EmailValidator/NoRFCEmailValidator.php +++ b/src/Eccube/Validator/EmailValidator/NoRFCEmailValidator.php @@ -31,7 +31,7 @@ class NoRFCEmailValidator extends EmailValidator * @return bool */ #[\Override] - public function isValid($email, ?EmailValidation $emailValidation = null) + public function isValid($email, ?EmailValidation $emailValidation = null): bool { $wsp = '[\x20\x09]'; $vchar = '[\x21-\x7e]'; diff --git a/tests/Eccube/Tests/DependencyInjection/Compiler/NavCompilerPassTest.php b/tests/Eccube/Tests/DependencyInjection/Compiler/NavCompilerPassTest.php index fbc9fff5a0f..e5b86af5a1b 100644 --- a/tests/Eccube/Tests/DependencyInjection/Compiler/NavCompilerPassTest.php +++ b/tests/Eccube/Tests/DependencyInjection/Compiler/NavCompilerPassTest.php @@ -117,7 +117,7 @@ public function createContainer() */ class DefaultNav implements EccubeNav { - public static function getNav() + public static function getNav(): array { return [ 'default' => [ @@ -154,7 +154,7 @@ public static function getNav() */ class AddNav1 implements EccubeNav { - public static function getNav() + public static function getNav(): array { return [ 'add' => [ @@ -207,7 +207,7 @@ public static function getExpect() */ class AddNav2 implements EccubeNav { - public static function getNav() + public static function getNav(): array { return [ 'default' => [ @@ -262,7 +262,7 @@ public static function getExpect() */ class AddNav3 implements EccubeNav { - public static function getNav() + public static function getNav(): array { return [ 'default' => [ @@ -321,7 +321,7 @@ public static function getExpect() */ class UpdateNav implements EccubeNav { - public static function getNav() + public static function getNav(): array { return [ 'default' => [ diff --git a/tests/Eccube/Tests/DependencyInjection/Compiler/PurchaseFlowPassTest.php b/tests/Eccube/Tests/DependencyInjection/Compiler/PurchaseFlowPassTest.php index 6c52efc79b4..f1979118548 100644 --- a/tests/Eccube/Tests/DependencyInjection/Compiler/PurchaseFlowPassTest.php +++ b/tests/Eccube/Tests/DependencyInjection/Compiler/PurchaseFlowPassTest.php @@ -25,6 +25,7 @@ use Eccube\Service\PurchaseFlow\ItemHolderValidator; use Eccube\Service\PurchaseFlow\ItemPreprocessor; use Eccube\Service\PurchaseFlow\ItemValidator; +use Eccube\Service\PurchaseFlow\ProcessResult; use Eccube\Service\PurchaseFlow\PurchaseContext; use Eccube\Service\PurchaseFlow\PurchaseFlow; use Eccube\Service\PurchaseFlow\PurchaseProcessor; @@ -105,7 +106,7 @@ public function createContainer() #[CartFlow] class PurchaseFlowPassTest_CartFlow extends ItemHolderValidator { - protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { PurchaseFlowPassTest::$called = true; } @@ -117,7 +118,7 @@ protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $co #[ShoppingFlow] class PurchaseFlowPassTest_ShoppingFlow extends ItemHolderValidator { - protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { PurchaseFlowPassTest::$called = true; } @@ -129,7 +130,7 @@ protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $co #[OrderFlow] class PurchaseFlowPassTest_OrderFlow extends ItemHolderValidator { - protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { PurchaseFlowPassTest::$called = true; } @@ -141,7 +142,7 @@ protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $co #[CartFlow] class PurchaseFlowPassTest_ItemPreprocessor implements ItemPreprocessor { - public function process(ItemInterface $item, PurchaseContext $context) + public function process(ItemInterface $item, PurchaseContext $context): void { PurchaseFlowPassTest::$called = true; } @@ -153,7 +154,7 @@ public function process(ItemInterface $item, PurchaseContext $context) #[CartFlow] class PurchaseFlowPassTest_ItemValidator extends ItemValidator { - protected function validate(ItemInterface $item, PurchaseContext $context) + protected function validate(ItemInterface $item, PurchaseContext $context): void { PurchaseFlowPassTest::$called = true; } @@ -165,7 +166,7 @@ protected function validate(ItemInterface $item, PurchaseContext $context) #[CartFlow] class PurchaseFlowPassTest_ItemHolderPreprocessor implements ItemHolderPreprocessor { - public function process(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function process(ItemHolderInterface $itemHolder, PurchaseContext $context): void { PurchaseFlowPassTest::$called = true; } @@ -177,7 +178,7 @@ public function process(ItemHolderInterface $itemHolder, PurchaseContext $contex #[CartFlow] class PurchaseFlowPassTest_ItemHolderValidator extends ItemHolderValidator { - protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { PurchaseFlowPassTest::$called = true; } @@ -189,7 +190,7 @@ protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $co #[CartFlow] class PurchaseFlowPassTest_ItemHolderPostValidator extends ItemHolderPostValidator { - protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context) + protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $context): void { PurchaseFlowPassTest::$called = true; } @@ -201,12 +202,12 @@ protected function validate(ItemHolderInterface $itemHolder, PurchaseContext $co #[CartFlow] class PurchaseFlowPassTest_DiscountProcessor implements DiscountProcessor { - public function removeDiscountItem(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function removeDiscountItem(ItemHolderInterface $itemHolder, PurchaseContext $context): void { PurchaseFlowPassTest::$called = true; } - public function addDiscountItem(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function addDiscountItem(ItemHolderInterface $itemHolder, PurchaseContext $context): ?ProcessResult { PurchaseFlowPassTest::$called = true; @@ -220,17 +221,17 @@ public function addDiscountItem(ItemHolderInterface $itemHolder, PurchaseContext #[CartFlow] class PurchaseFlowPassTest_PurchaseProcessor implements PurchaseProcessor { - public function prepare(ItemHolderInterface $target, PurchaseContext $context) + public function prepare(ItemHolderInterface $target, PurchaseContext $context): void { PurchaseFlowPassTest::$called = true; } - public function commit(ItemHolderInterface $target, PurchaseContext $context) + public function commit(ItemHolderInterface $target, PurchaseContext $context): void { PurchaseFlowPassTest::$called = true; } - public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function rollback(ItemHolderInterface $itemHolder, PurchaseContext $context): void { PurchaseFlowPassTest::$called = true; } diff --git a/tests/Eccube/Tests/DependencyInjection/Compiler/QueryCustomizerPassTest.php b/tests/Eccube/Tests/DependencyInjection/Compiler/QueryCustomizerPassTest.php index 19fcff67a3f..8e7453651c8 100644 --- a/tests/Eccube/Tests/DependencyInjection/Compiler/QueryCustomizerPassTest.php +++ b/tests/Eccube/Tests/DependencyInjection/Compiler/QueryCustomizerPassTest.php @@ -49,12 +49,12 @@ public function testAppendCustomizerToQueries() class TestQueryCustomizer extends WhereCustomizer { - protected function createStatements($params, $queryKey) + protected function createStatements($params, $queryKey): array { return []; } - public function getQueryKey() + public function getQueryKey(): string { return QueryKey::CUSTOMER_SEARCH; } diff --git a/tests/Eccube/Tests/Doctrine/Query/JoinCustomizerTest.php b/tests/Eccube/Tests/Doctrine/Query/JoinCustomizerTest.php index b0a1541184c..46d5772e3a3 100644 --- a/tests/Eccube/Tests/Doctrine/Query/JoinCustomizerTest.php +++ b/tests/Eccube/Tests/Doctrine/Query/JoinCustomizerTest.php @@ -79,7 +79,7 @@ public function __construct($callback) * * @return JoinClause[] */ - public function createStatements($params, $queryKey) + public function createStatements($params, $queryKey): array { $callback = $this->callback; @@ -91,7 +91,7 @@ public function createStatements($params, $queryKey) * * @return string */ - public function getQueryKey() + public function getQueryKey(): string { return ''; } diff --git a/tests/Eccube/Tests/Doctrine/Query/OrderByCustomizerTest.php b/tests/Eccube/Tests/Doctrine/Query/OrderByCustomizerTest.php index f429e832688..3faaa2e2822 100644 --- a/tests/Eccube/Tests/Doctrine/Query/OrderByCustomizerTest.php +++ b/tests/Eccube/Tests/Doctrine/Query/OrderByCustomizerTest.php @@ -102,7 +102,7 @@ public function __construct($closure) * * @return OrderByClause[] */ - public function createStatements($params, $queryKey) + public function createStatements($params, $queryKey): array { $callback = $this->closure; @@ -114,7 +114,7 @@ public function createStatements($params, $queryKey) * * @return string */ - public function getQueryKey() + public function getQueryKey(): string { return ''; } diff --git a/tests/Eccube/Tests/Doctrine/Query/QueriesTest.php b/tests/Eccube/Tests/Doctrine/Query/QueriesTest.php index 08b4abaa187..01b70a22794 100644 --- a/tests/Eccube/Tests/Doctrine/Query/QueriesTest.php +++ b/tests/Eccube/Tests/Doctrine/Query/QueriesTest.php @@ -62,7 +62,7 @@ class QueriesTest_Customizer implements QueryCustomizer * * @return void */ - public function customize(QueryBuilder $builder, $params, $queryKey) + public function customize(QueryBuilder $builder, $params, $queryKey): void { $this->customized = true; } @@ -72,7 +72,7 @@ public function customize(QueryBuilder $builder, $params, $queryKey) * * @return string */ - public function getQueryKey() + public function getQueryKey(): string { return QueriesTest::class; } @@ -86,14 +86,14 @@ class QueriesTest_CustomizerWithoutAnnotation implements QueryCustomizer * * @return void */ - public function customize(QueryBuilder $builder, $params, $queryKey) + public function customize(QueryBuilder $builder, $params, $queryKey): void { } /** * @return string */ - public function getQueryKey() + public function getQueryKey(): string { return ''; } diff --git a/tests/Eccube/Tests/Doctrine/Query/WhereCustomizerTest.php b/tests/Eccube/Tests/Doctrine/Query/WhereCustomizerTest.php index 1a85f88f9a7..f0fbc2a6a86 100644 --- a/tests/Eccube/Tests/Doctrine/Query/WhereCustomizerTest.php +++ b/tests/Eccube/Tests/Doctrine/Query/WhereCustomizerTest.php @@ -81,7 +81,7 @@ public function __construct($callback) * * @return WhereClause[] */ - protected function createStatements($params, $queryKey) + protected function createStatements($params, $queryKey): array { $callback = $this->callback; @@ -93,7 +93,7 @@ protected function createStatements($params, $queryKey) * * @return string */ - public function getQueryKey() + public function getQueryKey(): string { return ''; } diff --git a/tests/Eccube/Tests/Entity/OrderTest.php b/tests/Eccube/Tests/Entity/OrderTest.php index b360de463be..52b5a26b33e 100644 --- a/tests/Eccube/Tests/Entity/OrderTest.php +++ b/tests/Eccube/Tests/Entity/OrderTest.php @@ -186,7 +186,7 @@ public function testGetMergedProductOrderItems() $this->verify(); // まとめられた明細の商品の個数が全配送先の合計になっているか $OrderItem = $OrderItems[0]; - $this->expected = bcmul((string) $quantity, (string) $times, 0); + $this->expected = bcmul($quantity, $times, 0); $this->actual = $OrderItem->getQuantity(); $this->verify(); } diff --git a/tests/Eccube/Tests/Service/CartServiceTest.php b/tests/Eccube/Tests/Service/CartServiceTest.php index 57480be5ed4..cdc4f3ee1ff 100644 --- a/tests/Eccube/Tests/Service/CartServiceTest.php +++ b/tests/Eccube/Tests/Service/CartServiceTest.php @@ -275,7 +275,7 @@ class CartServiceTest_CartItemComparator implements CartItemComparator * * @return bool 同じ明細になる場合はtrue */ - public function compare(CartItem $item1, CartItem $item2) + public function compare(CartItem $item1, CartItem $item2): bool { return $item1->getProductClassId() == $item2->getProductClassId() && $item1->getQuantity() == $item2->getQuantity(); diff --git a/tests/Eccube/Tests/Service/OrderStateMachineTest.php b/tests/Eccube/Tests/Service/OrderStateMachineTest.php index 867d8176013..b1aa32639bb 100644 --- a/tests/Eccube/Tests/Service/OrderStateMachineTest.php +++ b/tests/Eccube/Tests/Service/OrderStateMachineTest.php @@ -240,7 +240,7 @@ public function testTransitionShip() $this->stateMachine->apply($Order, $this->statusOf(OrderStatus::DELIVERED)); - self::assertSame(1100, $Customer->getPoint(), '発送済みになれば加算ポイントが会員に付与されているはず'); + self::assertSame('1100', $Customer->getPoint(), '発送済みになれば加算ポイントが会員に付与されているはず'); } public function testTransitionReturn() @@ -266,7 +266,8 @@ public function testTransitionReturn() $this->stateMachine->apply($Order, $this->statusOf(OrderStatus::RETURNED)); - self::assertSame(1000 + 10 - 100, $Customer->getPoint(), '返品になれば利用ポイント分が戻され、加算ポイント分は引かれるはず'); + // 1000 + 10 - 100 = 910 + self::assertSame('910', $Customer->getPoint(), '返品になれば利用ポイント分が戻され、加算ポイント分は引かれるはず'); } public function testTransitionCancelReturn() @@ -295,7 +296,8 @@ public function testTransitionCancelReturn() $this->stateMachine->apply($Order, $this->statusOf(OrderStatus::DELIVERED)); - self::assertSame(1000 - 10 + 100, $Customer->getPoint(), '返品キャンセルになれば利用ポイント分が減らされ、加算ポイント分が増えるはず'); + // 1000 - 10 + 100 = 1090 + self::assertSame('1090', $Customer->getPoint(), '返品キャンセルになれば利用ポイント分が減らされ、加算ポイント分が増えるはず'); } /** diff --git a/tests/Eccube/Tests/Service/PurchaseFlow/Processor/PointRateProcessorTest.php b/tests/Eccube/Tests/Service/PurchaseFlow/Processor/PointRateProcessorTest.php index b4385f6e04c..a1e9799d6ae 100644 --- a/tests/Eccube/Tests/Service/PurchaseFlow/Processor/PointRateProcessorTest.php +++ b/tests/Eccube/Tests/Service/PurchaseFlow/Processor/PointRateProcessorTest.php @@ -56,7 +56,7 @@ public function testExecute() public function testExecuteProductPointRate() { $baseRate = $this->BaseInfo->getBasicPointRate(); - $productPointRate = $baseRate + 1; + $productPointRate = bcadd($baseRate, '1'); foreach ($this->Order->getProductOrderItems() as $OrderItem) { $OrderItem->getProductClass()->setPointRate($productPointRate); @@ -66,9 +66,9 @@ public function testExecuteProductPointRate() foreach ($this->Order->getOrderItems() as $OrderItem) { if ($OrderItem->isProduct()) { - $this->assertSame($OrderItem->getPointRate(), $productPointRate); + $this->assertSame($productPointRate, $OrderItem->getPointRate()); } else { - $this->assertSame($OrderItem->getPointRate(), $baseRate); + $this->assertSame($baseRate, $OrderItem->getPointRate()); } } } diff --git a/tests/Eccube/Tests/Service/PurchaseFlow/Processor/ProductStatusValidatorTest.php b/tests/Eccube/Tests/Service/PurchaseFlow/Processor/ProductStatusValidatorTest.php index f4929cbfc72..4abb27e9de2 100644 --- a/tests/Eccube/Tests/Service/PurchaseFlow/Processor/ProductStatusValidatorTest.php +++ b/tests/Eccube/Tests/Service/PurchaseFlow/Processor/ProductStatusValidatorTest.php @@ -70,7 +70,7 @@ public function testDisplayStatusWithShow() $this->validator->execute($this->cartItem, new PurchaseContext()); - self::assertSame(10, $this->cartItem->getQuantity()); + self::assertSame('10', $this->cartItem->getQuantity()); } /** diff --git a/tests/Eccube/Tests/Service/PurchaseFlow/Processor/StockValidatorTest.php b/tests/Eccube/Tests/Service/PurchaseFlow/Processor/StockValidatorTest.php index 703bec20410..ae7aead8518 100644 --- a/tests/Eccube/Tests/Service/PurchaseFlow/Processor/StockValidatorTest.php +++ b/tests/Eccube/Tests/Service/PurchaseFlow/Processor/StockValidatorTest.php @@ -67,7 +67,7 @@ public function testValidStock() { $this->cartItem->setQuantity(1); $this->validator->execute($this->cartItem, new PurchaseContext()); - self::assertSame(1, $this->cartItem->getQuantity()); + self::assertSame('1', $this->cartItem->getQuantity()); } public function testValidStockFail() @@ -90,6 +90,6 @@ public function testValidStockOrder() $this->ProductClass->setStock(100); $this->validator->execute($Order->getOrderItems()[0], new PurchaseContext()); - self::assertSame(1, $Order->getOrderItems()[0]->getQuantity()); + self::assertSame('1', $Order->getOrderItems()[0]->getQuantity()); } } diff --git a/tests/Eccube/Tests/Service/PurchaseFlow/PurchaseFlowTest.php b/tests/Eccube/Tests/Service/PurchaseFlow/PurchaseFlowTest.php index f4fc2145918..2841e0127b2 100644 --- a/tests/Eccube/Tests/Service/PurchaseFlow/PurchaseFlowTest.php +++ b/tests/Eccube/Tests/Service/PurchaseFlow/PurchaseFlowTest.php @@ -153,14 +153,14 @@ public function flowTypeProvider() class PurchaseFlowTest_ItemHolderPreprocessor implements ItemHolderPreprocessor { - public function process(ItemHolderInterface $itemHolder, PurchaseContext $context) + public function process(ItemHolderInterface $itemHolder, PurchaseContext $context): void { } } class PurchaseFlowTest_ItemPreprocessor implements ItemPreprocessor { - public function process(ItemInterface $item, PurchaseContext $context) + public function process(ItemInterface $item, PurchaseContext $context): void { } } @@ -179,7 +179,7 @@ public function __construct($errorMessage) $this->errorMessage = $errorMessage; } - protected function validate(ItemInterface $item, PurchaseContext $context): never + protected function validate(ItemInterface $item, PurchaseContext $context): void { throw new InvalidItemException($this->errorMessage); } @@ -208,7 +208,7 @@ protected function validate(ItemHolderInterface $item, PurchaseContext $context) class PurchaseFlowTest_FlowTypeValidator extends ItemHolderValidator { - protected function validate(ItemHolderInterface $item, PurchaseContext $context) + protected function validate(ItemHolderInterface $item, PurchaseContext $context): void { if ($context->isCartFlow()) { throw new InvalidItemException('Cart Flow'); diff --git a/tests/Eccube/Tests/Service/PurchaseFlow/ValidatableItemProcessorTest.php b/tests/Eccube/Tests/Service/PurchaseFlow/ValidatableItemProcessorTest.php index e60c6b77b39..cbadfdd09a7 100644 --- a/tests/Eccube/Tests/Service/PurchaseFlow/ValidatableItemProcessorTest.php +++ b/tests/Eccube/Tests/Service/PurchaseFlow/ValidatableItemProcessorTest.php @@ -77,11 +77,11 @@ class ItemValidatorTest_NormalValidator extends ItemValidator { public $handleCalled = false; - protected function validate(ItemInterface $item, PurchaseContext $context) + protected function validate(ItemInterface $item, PurchaseContext $context): void { } - protected function handle(ItemInterface $item, PurchaseContext $context) + protected function handle(ItemInterface $item, PurchaseContext $context): void { $this->handleCalled = true; } @@ -91,12 +91,12 @@ class ItemValidatorTest_FailValidator extends ItemValidator { public $handleCalled = false; - protected function validate(ItemInterface $item, PurchaseContext $context): never + protected function validate(ItemInterface $item, PurchaseContext $context): void { throw new InvalidItemException(); } - protected function handle(ItemInterface $item, PurchaseContext $context) + protected function handle(ItemInterface $item, PurchaseContext $context): void { $this->handleCalled = true; } diff --git a/tests/Eccube/Tests/Twig/Extension/EccubeExtensionTest.php b/tests/Eccube/Tests/Twig/Extension/EccubeExtensionTest.php index a7b69e55b02..f55918e74f9 100644 --- a/tests/Eccube/Tests/Twig/Extension/EccubeExtensionTest.php +++ b/tests/Eccube/Tests/Twig/Extension/EccubeExtensionTest.php @@ -53,7 +53,7 @@ public function testGetClassCategoriesAsJson() $actual = $actuals[$class_category_id]['#'.$class_category_id2]; - $this->assertEquals($class_category_id2, $actual['classcategory_id2']); + $this->assertSame((string) $class_category_id2, $actual['classcategory_id2']); $this->assertEquals($name2, $actual['name']); $ProductClass = $Product diff --git a/tests/Eccube/Tests/Web/Admin/Order/EditControllerTest.php b/tests/Eccube/Tests/Web/Admin/Order/EditControllerTest.php index ec584611326..d4b9d08f99a 100644 --- a/tests/Eccube/Tests/Web/Admin/Order/EditControllerTest.php +++ b/tests/Eccube/Tests/Web/Admin/Order/EditControllerTest.php @@ -702,7 +702,7 @@ public function testChangeOrderItemTaxRate() // 税率が10%で登録されている /** @var Order $Order */ $Order = $this->orderRepository->findBy([], ['create_date' => 'DESC'])[0]; - self::assertSame(10, $Order->getProductOrderItems()[0]->getTaxRate()); + self::assertSame('10', $Order->getProductOrderItems()[0]->getTaxRate()); self::assertSame('100.00', $Order->getProductOrderItems()[0]->getTax()); } diff --git a/tests/Eccube/Tests/Web/Admin/Setting/Shop/TaxRuleControllerTest.php b/tests/Eccube/Tests/Web/Admin/Setting/Shop/TaxRuleControllerTest.php index 1c4508d4180..33e7fe0e92e 100644 --- a/tests/Eccube/Tests/Web/Admin/Setting/Shop/TaxRuleControllerTest.php +++ b/tests/Eccube/Tests/Web/Admin/Setting/Shop/TaxRuleControllerTest.php @@ -64,7 +64,7 @@ public function testEdit() $now = new \DateTime(); $form = [ '_token' => 'dummy', - 'tax_rate' => 10, + 'tax_rate' => '10', 'rounding_type' => random_int(1, 3), 'apply_date' => $now->format('Y').'-'.$now->format('m').'-'.$now->format('d').'T'.$now->format('H').':'.$now->format('i'), ]; @@ -121,7 +121,7 @@ public function testEditWithTime() $now = new \DateTime(); $form = [ '_token' => 'dummy', - 'tax_rate' => 10, + 'tax_rate' => '10', 'rounding_type' => random_int(1, 3), 'apply_date' => $now->format('Y').'-'.$now->format('m').'-'.$now->format('d').'T23:01', ]; diff --git a/tests/Eccube/Tests/Web/HelpControllerTest.php b/tests/Eccube/Tests/Web/HelpControllerTest.php index dcfb12de1f3..c1ede6b09ed 100644 --- a/tests/Eccube/Tests/Web/HelpControllerTest.php +++ b/tests/Eccube/Tests/Web/HelpControllerTest.php @@ -22,7 +22,8 @@ public function testRoutingHelpTradelaw() { $client = $this->client; $client->request('GET', $this->generateUrl('help_tradelaw')); - $this->assertTrue($client->getResponse()->isSuccessful()); + $response = $client->getResponse(); + $this->assertTrue($response->isSuccessful(), 'Response status: '.$response->getStatusCode().' - Content: '.$response->getContent()); } /**