diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c1945a9..dbd2047d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ['8.3'] + php: ['8.4'] deps: ['stable'] steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 663b4b24..56549a2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog ## Unreleased +### Add +- Add support for Magento v2.4.9 +- Add support for PHP 8.4 + ### Update - Update WebComponents library to version 5.1.7 - Add template to suggest element diff --git a/composer.json b/composer.json index 2afd5c5e..bab93de4 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "~8.1.0||~8.2.0||~8.3.0", + "php": "~8.1.0||~8.2.0||~8.3.0||~8.4.0", "omikron/factfinder-communication-sdk": "^0.9.9", "magento/framework": "^103.0.7", "magento/module-catalog": "^104.0.7", @@ -25,7 +25,7 @@ "require-dev": { "pdepend/pdepend": "^2.16", "phpmd/phpmd" : "^2.15", - "phpunit/phpunit": "~9.5.0", + "phpunit/phpunit": "^9.6", "magento/magento-coding-standard": "*", "friendsofphp/php-cs-fixer": "^3.58" }, diff --git a/src/Console/Command/Export.php b/src/Console/Command/Export.php index 7c906b7c..6d158214 100644 --- a/src/Console/Command/Export.php +++ b/src/Console/Command/Export.php @@ -56,7 +56,7 @@ protected function configure(): void /** * {@inheritdoc} */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { $this->state->setAreaCode('frontend'); $storeIds = $this->getStoreIds((int) $input->getOption('store')); diff --git a/src/Exception/ExportPreviewValidationException.php b/src/Exception/ExportPreviewValidationException.php index 6cacf81d..517b975e 100644 --- a/src/Exception/ExportPreviewValidationException.php +++ b/src/Exception/ExportPreviewValidationException.php @@ -8,7 +8,7 @@ class ExportPreviewValidationException extends \Exception { - public function __construct($message = '', $code = 0, Throwable $previous = null) + public function __construct($message = '', $code = 0, ?Throwable $previous = null) { parent::__construct(sprintf('Product will not be exported. Reason: %s', $message), $code, $previous); } diff --git a/src/Exception/ResponseException.php b/src/Exception/ResponseException.php index 9ab209e3..d5ade3c1 100644 --- a/src/Exception/ResponseException.php +++ b/src/Exception/ResponseException.php @@ -6,7 +6,7 @@ class ResponseException extends \RuntimeException { - public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) // phpcs:ignore + public function __construct(string $message = '', int $code = 0, ?\Throwable $previous = null) // phpcs:ignore { parent::__construct($message ?: 'Response body was empty', $code, $previous); } diff --git a/src/Model/Adminhtml/System/Config/Backend/Feed/Frequency.php b/src/Model/Adminhtml/System/Config/Backend/Feed/Frequency.php index c227ad24..8cc54773 100644 --- a/src/Model/Adminhtml/System/Config/Backend/Feed/Frequency.php +++ b/src/Model/Adminhtml/System/Config/Backend/Feed/Frequency.php @@ -28,8 +28,8 @@ public function __construct( ScopeConfigInterface $config, TypeListInterface $cacheTypeList, WriterInterface $configWriter, - AbstractResource $resource = null, - AbstractDb $resourceCollection = null, + ?AbstractResource $resource = null, + ?AbstractDb $resourceCollection = null, array $data = [] ) { parent::__construct($context, $registry, $config, $cacheTypeList, $resource, $resourceCollection, $data); diff --git a/src/Model/Api/CredentialsFactory.php b/src/Model/Api/CredentialsFactory.php index 04eb1cb7..132a51f0 100644 --- a/src/Model/Api/CredentialsFactory.php +++ b/src/Model/Api/CredentialsFactory.php @@ -19,7 +19,7 @@ public function __construct(ObjectManagerInterface $objectManager, AuthConfig $a $this->authConfig = $authConfig; } - public function create(array $authData = null) + public function create(?array $authData = null) { return $this->objectManager->create(Credentials::class, $authData ?? [ diff --git a/src/Model/Config/CmsConfig.php b/src/Model/Config/CmsConfig.php index e743d031..75c82c65 100644 --- a/src/Model/Config/CmsConfig.php +++ b/src/Model/Config/CmsConfig.php @@ -17,7 +17,7 @@ public function __construct(ScopeConfigInterface $scopeConfig) $this->scopeConfig = $scopeConfig; } - public function getCmsBlacklist(int $scopeCode = null): array + public function getCmsBlacklist(?int $scopeCode = null): array { $pages = (string) $this->scopeConfig->getValue(self::PATH_DISABLE_CMS_PAGES, 'store', $scopeCode); return array_filter(explode(',', $pages)); diff --git a/src/Model/Config/CommunicationConfig.php b/src/Model/Config/CommunicationConfig.php index 4e4bfeb7..f316a394 100644 --- a/src/Model/Config/CommunicationConfig.php +++ b/src/Model/Config/CommunicationConfig.php @@ -31,7 +31,7 @@ public function __construct(ScopeConfigInterface $scopeConfig, UrlInterface $url $this->urlBuilder = $urlBuilder; } - public function getChannel(int $scopeId = null): string + public function getChannel(?int $scopeId = null): string { return (string) $this->scopeConfig->getValue(self::PATH_CHANNEL, ScopeInterface::SCOPE_STORES, $scopeId); } @@ -41,12 +41,12 @@ public function getAddress(): string return (string) $this->scopeConfig->getValue(self::PATH_ADDRESS, ScopeInterface::SCOPE_STORES); } - public function isChannelEnabled(int $scopeId = null): bool + public function isChannelEnabled(?int $scopeId = null): bool { return $this->scopeConfig->isSetFlag(self::PATH_IS_ENABLED, ScopeInterface::SCOPE_STORES, $scopeId); } - public function isPushImportEnabled(int $scopeId = null): bool + public function isPushImportEnabled(?int $scopeId = null): bool { return $this->scopeConfig->isSetFlag(self::PATH_DATA_TRANSFER_IMPORT, ScopeInterface::SCOPE_STORES, $scopeId); } diff --git a/src/Model/Config/ExportConfig.php b/src/Model/Config/ExportConfig.php index 7a9f2356..d507b784 100644 --- a/src/Model/Config/ExportConfig.php +++ b/src/Model/Config/ExportConfig.php @@ -39,7 +39,7 @@ public function getSingleFields(?int $storeId = null): array return $this->getAttributeCodes($storeId, fn (array $row): bool => !$row['multi']); } - public function getPushImportDataTypes(int $scopeId = null): array + public function getPushImportDataTypes(?int $scopeId = null): array { $configPath = 'factfinder/data_transfer/ff_push_import_type'; $dataTypes = (string) $this->scopeConfig->getValue($configPath, ScopeInterface::SCOPE_STORES, $scopeId); diff --git a/src/Model/FieldRoles.php b/src/Model/FieldRoles.php index 5484dce3..9bd1f0f1 100644 --- a/src/Model/FieldRoles.php +++ b/src/Model/FieldRoles.php @@ -22,7 +22,7 @@ public function __construct( ) { } - public function getFieldRoles(int $scopeId = null): array + public function getFieldRoles(?int $scopeId = null): array { try { $config = $this->scopeConfig->getValue(self::PATH_PRODUCT_FIELD_ROLE, Scope::SCOPE_STORES, $scopeId); @@ -32,12 +32,12 @@ public function getFieldRoles(int $scopeId = null): array } } - public function getFieldRole(string $roleName, int $scopeId = null): string + public function getFieldRole(string $roleName, ?int $scopeId = null): string { return (string) ($this->getFieldRoles($scopeId)[$roleName] ?? ''); } - public function saveFieldRoles(array $fieldRoles, int $scopeId = null): bool + public function saveFieldRoles(array $fieldRoles, ?int $scopeId = null): bool { try { $roles = (string) $this->serializer->serialize($fieldRoles);