diff --git a/composer.json b/composer.json index dfe1a56f5..6896a73ee 100644 --- a/composer.json +++ b/composer.json @@ -33,21 +33,21 @@ "ondrejmirtes/better-reflection": "6.43.*", "phpbench/phpbench": "^1.2", "phpmd/phpmd": "2.15.*", - "phpstan/phpstan": "^1.12", + "phpstan/phpstan": "^2.1", "psr/cache": "^1.0 || ^2.0 || ^3.0", "psr/log": "^1.0 || ^2.0 || ^3.0", "ramsey/uuid": "^3.9", - "rector/rector": "^0.13", + "rector/rector": "^2.0", "spryker-sdk/acp": "^0.3.2", "spryker-sdk/async-api": "^0.3.2", "spryker-sdk/brancho": "dev-master as 1.0.0", "spryker-sdk/composer-replace": "dev-master as 1.0.0", - "spryker-sdk/evaluator": "^0.3.2", + "spryker-sdk/evaluator": "^0.3.4", "spryker-sdk/sdk-contracts": "^0.5.0", "spryker-sdk/security-checker": "^0.2.0", "spryker-sdk/spryk": "^0.4.7", "spryker-sdk/sync-api": "^0.1.1", - "spryker-sdk/upgrader": "^0.3.14", + "spryker-sdk/upgrader": "^0.3.17", "spryker/architecture-sniffer": "^0.5.7", "spryker/code-sniffer": "^0.17.18", "symfony/asset": "^6.0", diff --git a/composer.lock b/composer.lock index 227eec7e5..b0f427615 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1743b41599359b9625aadb03b01ef723", + "content-hash": "4556262e63393442f5b01ce4a658f299", "packages": [ { "name": "amphp/amp", @@ -6536,15 +6536,15 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.32", + "version": "2.1.40", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2770dcdf5078d0b0d53f94317e06affe88419aa8", - "reference": "2770dcdf5078d0b0d53f94317e06affe88419aa8", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9b2c7aeb83a75d8680ea5e7c9b7fca88052b766b", + "reference": "9b2c7aeb83a75d8680ea5e7c9b7fca88052b766b", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": "^7.4|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -6585,7 +6585,7 @@ "type": "github" } ], - "time": "2025-09-30T10:16:31+00:00" + "time": "2026-02-23T15:04:35+00:00" }, { "name": "psr/cache", @@ -7163,42 +7163,35 @@ }, { "name": "rector/rector", - "version": "0.13.10", + "version": "2.3.8", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "d1e069db8ad3b4aea2b968248370c21415e4c180" + "reference": "bbd37aedd8df749916cffa2a947cfc4714d1ba2c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/d1e069db8ad3b4aea2b968248370c21415e4c180", - "reference": "d1e069db8ad3b4aea2b968248370c21415e4c180", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/bbd37aedd8df749916cffa2a947cfc4714d1ba2c", + "reference": "bbd37aedd8df749916cffa2a947cfc4714d1ba2c", "shasum": "" }, "require": { - "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.8.2" + "php": "^7.4|^8.0", + "phpstan/phpstan": "^2.1.38" }, "conflict": { - "phpstan/phpdoc-parser": "<1.6.2", - "rector/rector-cakephp": "*", "rector/rector-doctrine": "*", - "rector/rector-laravel": "*", - "rector/rector-nette": "*", - "rector/rector-phpoffice": "*", + "rector/rector-downgrade-php": "*", "rector/rector-phpunit": "*", - "rector/rector-prefixed": "*", "rector/rector-symfony": "*" }, + "suggest": { + "ext-dom": "To manipulate phpunit.xml via the custom-rule command" + }, "bin": [ "bin/rector" ], "type": "library", - "extra": { - "branch-alias": { - "dev-main": "0.13-dev" - } - }, "autoload": { "files": [ "bootstrap.php" @@ -7209,9 +7202,16 @@ "MIT" ], "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "homepage": "https://getrector.com/", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.13.10" + "source": "https://github.com/rectorphp/rector/tree/2.3.8" }, "funding": [ { @@ -7219,7 +7219,7 @@ "type": "github" } ], - "time": "2022-08-03T12:48:10+00:00" + "time": "2026-02-22T09:45:50+00:00" }, { "name": "revolt/event-loop", @@ -7936,16 +7936,16 @@ }, { "name": "spryker-sdk/evaluator", - "version": "0.3.3", + "version": "0.3.4", "source": { "type": "git", "url": "https://github.com/spryker-sdk/evaluator.git", - "reference": "60af5d08af48ef167b631eba10a97f1bb951e503" + "reference": "534ad4bc2ef18ee7aa387b8be60b281c025b9c87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spryker-sdk/evaluator/zipball/60af5d08af48ef167b631eba10a97f1bb951e503", - "reference": "60af5d08af48ef167b631eba10a97f1bb951e503", + "url": "https://api.github.com/repos/spryker-sdk/evaluator/zipball/534ad4bc2ef18ee7aa387b8be60b281c025b9c87", + "reference": "534ad4bc2ef18ee7aa387b8be60b281c025b9c87", "shasum": "" }, "require": { @@ -7979,7 +7979,7 @@ "symfony/polyfill-php72": "*" }, "require-dev": { - "phpstan/phpstan": "^1.10", + "phpstan/phpstan": "^2.1.0", "phpunit/phpunit": "^12.1.0", "spryker/code-sniffer": "^0.17.18" }, @@ -8005,9 +8005,9 @@ "description": "The tool for evaluating Spryker shops", "support": { "issues": "https://github.com/spryker-sdk/evaluator/issues", - "source": "https://github.com/spryker-sdk/evaluator/tree/0.3.3" + "source": "https://github.com/spryker-sdk/evaluator/tree/0.3.4" }, - "time": "2026-02-12T14:33:23+00:00" + "time": "2026-02-20T11:01:42+00:00" }, { "name": "spryker-sdk/integrator", @@ -8262,16 +8262,16 @@ }, { "name": "spryker-sdk/upgrader", - "version": "0.3.16", + "version": "0.3.17", "source": { "type": "git", "url": "https://github.com/spryker-sdk/upgrader.git", - "reference": "0d6fd309f29a039e1d40ff7c62eefb5069cb6f67" + "reference": "481e5c14f830d9684365070f2395da54c66892af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spryker-sdk/upgrader/zipball/0d6fd309f29a039e1d40ff7c62eefb5069cb6f67", - "reference": "0d6fd309f29a039e1d40ff7c62eefb5069cb6f67", + "url": "https://api.github.com/repos/spryker-sdk/upgrader/zipball/481e5c14f830d9684365070f2395da54c66892af", + "reference": "481e5c14f830d9684365070f2395da54c66892af", "shasum": "" }, "require": { @@ -8287,7 +8287,7 @@ "nette/neon": "^3.4", "nikic/php-parser": "^5.6.0", "php": ">=8.3", - "phpstan/phpstan": "^1.12", + "phpstan/phpstan": "^2.1", "spryker-sdk/azure-php-client": "^0.2.1", "spryker-sdk/integrator": "^0.2.0", "spryker-sdk/sdk-contracts": "^0.5.0", @@ -8335,9 +8335,9 @@ "description": "Code evaluator and upgrader tool", "support": { "issues": "https://github.com/spryker-sdk/upgrader/issues", - "source": "https://github.com/spryker-sdk/upgrader/tree/0.3.16" + "source": "https://github.com/spryker-sdk/upgrader/tree/0.3.17" }, - "time": "2026-02-12T14:19:04+00:00" + "time": "2026-02-20T10:50:14+00:00" }, { "name": "spryker-sdk/utils", diff --git a/infrastructure/sdk.Dockerfile b/infrastructure/sdk.Dockerfile index f277cacb5..f94845851 100644 --- a/infrastructure/sdk.Dockerfile +++ b/infrastructure/sdk.Dockerfile @@ -19,6 +19,12 @@ RUN apk update \ ######################################## RUN mv /usr/local/etc/php/disabled/otel.ini /usr/local/etc/php/conf.d/90-otel.ini +######################################## +# Enable AMQP Extension +# It's already in the core image. +######################################## +RUN mv /usr/local/etc/php/disabled/amqp.ini /usr/local/etc/php/conf.d/90-amqp.ini + RUN git config --add --system safe.directory /project ARG SPRYKER_COMPOSER_MODE diff --git a/infrastructure/sdk.sprykerci-8.2.Dockerfile b/infrastructure/sdk.sprykerci-8.2.Dockerfile index d4afade8f..ea19a7d4a 100644 --- a/infrastructure/sdk.sprykerci-8.2.Dockerfile +++ b/infrastructure/sdk.sprykerci-8.2.Dockerfile @@ -23,6 +23,12 @@ RUN docker-php-ext-install xsl ######################################## RUN mv /usr/local/etc/php/disabled/otel.ini /usr/local/etc/php/conf.d/90-otel.ini +######################################## +# Enable AMQP Extension +# It's already in the core image. +######################################## +RUN mv /usr/local/etc/php/disabled/amqp.ini /usr/local/etc/php/conf.d/90-amqp.ini + RUN git config --add --system safe.directory /project ######################################## diff --git a/infrastructure/sdk.sprykerci-8.3.Dockerfile b/infrastructure/sdk.sprykerci-8.3.Dockerfile index 6852c0eee..9abcc1b3f 100644 --- a/infrastructure/sdk.sprykerci-8.3.Dockerfile +++ b/infrastructure/sdk.sprykerci-8.3.Dockerfile @@ -23,6 +23,12 @@ RUN docker-php-ext-install xsl ######################################## RUN mv /usr/local/etc/php/disabled/otel.ini /usr/local/etc/php/conf.d/90-otel.ini +######################################## +# Enable AMQP Extension +# It's already in the core image. +######################################## +RUN mv /usr/local/etc/php/disabled/amqp.ini /usr/local/etc/php/conf.d/90-amqp.ini + RUN git config --add --system safe.directory /project ######################################## diff --git a/infrastructure/sdk.sprykerci-8.4.Dockerfile b/infrastructure/sdk.sprykerci-8.4.Dockerfile index fbad4b2be..eb3b67fb3 100644 --- a/infrastructure/sdk.sprykerci-8.4.Dockerfile +++ b/infrastructure/sdk.sprykerci-8.4.Dockerfile @@ -23,6 +23,12 @@ RUN docker-php-ext-install xsl ######################################## RUN mv /usr/local/etc/php/disabled/otel.ini /usr/local/etc/php/conf.d/90-otel.ini +######################################## +# Enable AMQP Extension +# It's already in the core image. +######################################## +RUN mv /usr/local/etc/php/disabled/amqp.ini /usr/local/etc/php/conf.d/90-amqp.ini + RUN git config --add --system safe.directory /project ######################################## diff --git a/src/Core/Application/Dto/Abstraction/Dto.php b/src/Core/Application/Dto/Abstraction/Dto.php index 5bdd568da..98c3ea3a8 100644 --- a/src/Core/Application/Dto/Abstraction/Dto.php +++ b/src/Core/Application/Dto/Abstraction/Dto.php @@ -115,7 +115,7 @@ protected function toSingularValue($value, string $type = DtoProperty::TYPE_DEFA /** * @param \SprykerSdk\Sdk\Core\Application\Dto\Abstraction\Reflection\DtoProperty $property - * @param array $arrayValue + * @param mixed $arrayValue * @param string $type * * @return array @@ -131,7 +131,7 @@ protected function toArrayValue(DtoProperty $property, $arrayValue, string $type /** * @param array $keyStack - * @param array $arrayValue + * @param mixed $arrayValue * @param string $type * * @return array @@ -192,7 +192,7 @@ protected function setFromArray(array $data, bool $ignoreMissing) protected function fromSingularValue(DtoProperty $property, $value, bool $ignoreMissing = false) { if (is_subclass_of($property->getType(), FromArrayToArrayInterface::class)) { - /** @var \SprykerSdk\Sdk\Core\Application\Dto\Abstraction\FromArrayToArrayInterface $className */ + /** @var class-string<\SprykerSdk\Sdk\Core\Application\Dto\Abstraction\FromArrayToArrayInterface> $className */ $className = $property->getType(); $value = is_array($value) ? $className::fromArray($value, $ignoreMissing) : null; @@ -205,7 +205,7 @@ protected function fromSingularValue(DtoProperty $property, $value, bool $ignore /** * @param \SprykerSdk\Sdk\Core\Application\Dto\Abstraction\Reflection\DtoProperty $property - * @param array $collectionValue + * @param mixed $collectionValue * @param bool $ignoreMissing * * @return array @@ -222,7 +222,7 @@ protected function fromCollectionValue(DtoProperty $property, $collectionValue, /** * @param array $keyStack * @param \SprykerSdk\Sdk\Core\Application\Dto\Abstraction\Reflection\DtoProperty $property - * @param array $collectionValue + * @param mixed $collectionValue * @param bool $ignoreMissing * * @return array diff --git a/src/Extension/Converter/DeprecationsReportConverter.php b/src/Extension/Converter/DeprecationsReportConverter.php index e286ca1ba..32cfd1cb4 100644 --- a/src/Extension/Converter/DeprecationsReportConverter.php +++ b/src/Extension/Converter/DeprecationsReportConverter.php @@ -7,6 +7,7 @@ namespace SprykerSdk\Sdk\Extension\Converter; +use Closure; use SprykerSdk\Sdk\Core\Application\Dto\Violation\Violation; use SprykerSdk\Sdk\Core\Application\Dto\Violation\ViolationReport; use SprykerSdk\Sdk\Core\Application\Violation\AbstractViolationConverter; @@ -92,7 +93,7 @@ protected function filterDeprecations(array $report): array */ protected function formatDeprecations(array $issues): array { - return array_map([static::class, 'createDeprecation'], $issues); + return array_map(Closure::fromCallable([$this, 'createDeprecation']), $issues); } /** diff --git a/src/Extension/ValueResolver/SdkDirectoryValueResolver.php b/src/Extension/ValueResolver/SdkDirectoryValueResolver.php index 33461e17c..928287345 100644 --- a/src/Extension/ValueResolver/SdkDirectoryValueResolver.php +++ b/src/Extension/ValueResolver/SdkDirectoryValueResolver.php @@ -99,10 +99,12 @@ protected function getValueFromSettings(array $settingValues): string return $this->sdkBasePath; } - $settingSdkBasePath = $settingValues[Setting::PATH_SDK_DIR]; + $settingSdkBasePath = (string)$settingValues[Setting::PATH_SDK_DIR]; - if (realpath($settingSdkBasePath) !== false) { - return realpath($settingSdkBasePath); + $realPath = realpath($settingSdkBasePath); + + if ($realPath !== false) { + return $realPath; } return $this->sdkBasePath . DIRECTORY_SEPARATOR . $settingSdkBasePath; diff --git a/src/Infrastructure/Event/Workflow/WorkflowTransitionListener.php b/src/Infrastructure/Event/Workflow/WorkflowTransitionListener.php index 36b745792..577ed15e1 100644 --- a/src/Infrastructure/Event/Workflow/WorkflowTransitionListener.php +++ b/src/Infrastructure/Event/Workflow/WorkflowTransitionListener.php @@ -376,7 +376,6 @@ protected function getTransitionMeta(Event $event, string $metaName) */ protected function getContext(TransitionEvent $event): ContextInterface { - /** @var \SprykerSdk\Sdk\Core\Domain\Entity\ContextInterface $context */ $context = $event->getContext()['context'] ?? null; if (!$context instanceof ContextInterface) { diff --git a/src/Infrastructure/EventListener/ApplicationReceiverSetupListener.php b/src/Infrastructure/EventListener/ApplicationReceiverSetupListener.php index 28637cc6a..4077138fa 100644 --- a/src/Infrastructure/EventListener/ApplicationReceiverSetupListener.php +++ b/src/Infrastructure/EventListener/ApplicationReceiverSetupListener.php @@ -81,9 +81,10 @@ public function beforeConsoleCommand(ConsoleCommandEvent $event): void } if ($inputOutputConnector instanceof HelperSetInjectorInterface) { - /** @var \Symfony\Component\Console\Helper\HelperSet $helperSet */ - $helperSet = $event->getCommand()->getHelperSet() ?? $this->getApplicationHelperSet($event); - $inputOutputConnector->setHelperSet($helperSet); + $helperSet = $event->getCommand()->getHelperSet(); + if ($helperSet !== null) { + $inputOutputConnector->setHelperSet($helperSet); + } } if ($inputOutputConnector instanceof InteractionProcessorInjectorInterface) { @@ -132,14 +133,18 @@ public function onKernelRequest(RequestEvent $event): void */ protected function getApplicationHelperSet(ConsoleCommandEvent $event): ?HelperSet { - if ( - $event->getCommand() !== null - && $event->getCommand()->getApplication() !== null - && $event->getCommand()->getApplication()->getHelperSet() !== null - ) { - return $event->getCommand()->getApplication()->getHelperSet(); + $command = $event->getCommand(); + + if ($command === null) { + return null; + } + + $application = $command->getApplication(); + + if ($application === null) { + return null; } - return null; + return $application->getHelperSet(); } } diff --git a/src/Infrastructure/Mapper/CommandMapperInterface.php b/src/Infrastructure/Mapper/CommandMapperInterface.php index 4f755e610..0c7164667 100644 --- a/src/Infrastructure/Mapper/CommandMapperInterface.php +++ b/src/Infrastructure/Mapper/CommandMapperInterface.php @@ -15,7 +15,7 @@ interface CommandMapperInterface /** * @param \SprykerSdk\SdkContracts\Entity\CommandInterface $command * - * @return \SprykerSdk\Sdk\Infrastructure\Entity\Command> + * @return \SprykerSdk\Sdk\Infrastructure\Entity\Command */ public function mapCommand(CommandInterface $command): Command; } diff --git a/src/Infrastructure/Mapper/PlaceholderMapper.php b/src/Infrastructure/Mapper/PlaceholderMapper.php index 2af59fd84..ec133af39 100644 --- a/src/Infrastructure/Mapper/PlaceholderMapper.php +++ b/src/Infrastructure/Mapper/PlaceholderMapper.php @@ -15,7 +15,7 @@ class PlaceholderMapper implements PlaceholderMapperInterface /** * @param \SprykerSdk\SdkContracts\Entity\PlaceholderInterface $placeholder * - * @return \SprykerSdk\Sdk\Infrastructure\Entity\Placeholder> + * @return \SprykerSdk\Sdk\Infrastructure\Entity\Placeholder */ public function mapPlaceholder(PlaceholderInterface $placeholder): Placeholder { diff --git a/src/Infrastructure/Repository/ViolationReportFileRepository.php b/src/Infrastructure/Repository/ViolationReportFileRepository.php index a877debff..c5d15c5a8 100644 --- a/src/Infrastructure/Repository/ViolationReportFileRepository.php +++ b/src/Infrastructure/Repository/ViolationReportFileRepository.php @@ -43,7 +43,7 @@ public function __construct( /** * @param string $taskId - * @param \SprykerSdk\SdkContracts\Report\Violation\ViolationReportInterface $violationReport + * @param \SprykerSdk\SdkContracts\Report\ReportInterface $violationReport * * @throws \Symfony\Component\Translation\Exception\InvalidResourceException * diff --git a/src/Infrastructure/Service/ValueReceiver/ApiInteractionProcessor.php b/src/Infrastructure/Service/ValueReceiver/ApiInteractionProcessor.php index 40ee41037..ae7afe15c 100644 --- a/src/Infrastructure/Service/ValueReceiver/ApiInteractionProcessor.php +++ b/src/Infrastructure/Service/ValueReceiver/ApiInteractionProcessor.php @@ -97,6 +97,6 @@ protected function prepareChoiceValues(array $choices): array return $choices; } - return array_combine(range(1, count($choices)), $choices) ?: []; + return array_combine(range(1, count($choices)), $choices); } } diff --git a/src/Infrastructure/Service/ValueReceiver/CliInteractionProcessor.php b/src/Infrastructure/Service/ValueReceiver/CliInteractionProcessor.php index 4c7230164..416905f39 100644 --- a/src/Infrastructure/Service/ValueReceiver/CliInteractionProcessor.php +++ b/src/Infrastructure/Service/ValueReceiver/CliInteractionProcessor.php @@ -159,6 +159,6 @@ protected function prepareChoiceValues(array $choices): array return $choices; } - return array_combine(range(1, count($choices)), $choices) ?: []; + return array_combine(range(1, count($choices)), $choices); } } diff --git a/src/Presentation/RestApi/EventListener/JsonRequestListener.php b/src/Presentation/RestApi/EventListener/JsonRequestListener.php index 53208dc41..e9118a112 100644 --- a/src/Presentation/RestApi/EventListener/JsonRequestListener.php +++ b/src/Presentation/RestApi/EventListener/JsonRequestListener.php @@ -92,8 +92,7 @@ protected function supports(Request $request): bool */ public function isApplicable(Request $request): bool { - return is_string($request->getContent()) - && $request->getContent() !== '' + return $request->getContent() !== '' && $request->attributes->has('_rest_api'); } } diff --git a/tests/_project/project/phpstan.neon b/tests/_project/project/phpstan.neon index 6ced343d4..e840dd5e0 100644 --- a/tests/_project/project/phpstan.neon +++ b/tests/_project/project/phpstan.neon @@ -4,9 +4,7 @@ parameters: bootstrapFiles: - phpstan-bootstrap.php - checkGenericClassInNonGenericObjectType: false reportUnmatchedIgnoredErrors: false - checkMissingIterableValueType: false parallel: maximumNumberOfProcesses: 1