Skip to content

Commit 2949683

Browse files
FRW-10644 Added PHPStan 2.* Support. (#703)
* FRW-10644 Updated PHPSTan * FRW-10644 Updated PHPSTan * FRW-10644 Updated compposer files * Enabled AMQP * Enabled AMQP --------- Co-authored-by: gechetspr <serhii.chepela@spryker.com>
1 parent 0e4643a commit 2949683

18 files changed

Lines changed: 100 additions & 72 deletions

File tree

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@
3333
"ondrejmirtes/better-reflection": "6.43.*",
3434
"phpbench/phpbench": "^1.2",
3535
"phpmd/phpmd": "2.15.*",
36-
"phpstan/phpstan": "^1.12",
36+
"phpstan/phpstan": "^2.1",
3737
"psr/cache": "^1.0 || ^2.0 || ^3.0",
3838
"psr/log": "^1.0 || ^2.0 || ^3.0",
3939
"ramsey/uuid": "^3.9",
40-
"rector/rector": "^0.13",
40+
"rector/rector": "^2.0",
4141
"spryker-sdk/acp": "^0.3.2",
4242
"spryker-sdk/async-api": "^0.3.2",
4343
"spryker-sdk/brancho": "dev-master as 1.0.0",
4444
"spryker-sdk/composer-replace": "dev-master as 1.0.0",
45-
"spryker-sdk/evaluator": "^0.3.2",
45+
"spryker-sdk/evaluator": "^0.3.4",
4646
"spryker-sdk/sdk-contracts": "^0.5.0",
4747
"spryker-sdk/security-checker": "^0.2.0",
4848
"spryker-sdk/spryk": "^0.4.7",
4949
"spryker-sdk/sync-api": "^0.1.1",
50-
"spryker-sdk/upgrader": "^0.3.14",
50+
"spryker-sdk/upgrader": "^0.3.17",
5151
"spryker/architecture-sniffer": "^0.5.7",
5252
"spryker/code-sniffer": "^0.17.18",
5353
"symfony/asset": "^6.0",

composer.lock

Lines changed: 39 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infrastructure/sdk.Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ RUN apk update \
1919
########################################
2020
RUN mv /usr/local/etc/php/disabled/otel.ini /usr/local/etc/php/conf.d/90-otel.ini
2121

22+
########################################
23+
# Enable AMQP Extension
24+
# It's already in the core image.
25+
########################################
26+
RUN mv /usr/local/etc/php/disabled/amqp.ini /usr/local/etc/php/conf.d/90-amqp.ini
27+
2228
RUN git config --add --system safe.directory /project
2329

2430
ARG SPRYKER_COMPOSER_MODE

infrastructure/sdk.sprykerci-8.2.Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ RUN docker-php-ext-install xsl
2323
########################################
2424
RUN mv /usr/local/etc/php/disabled/otel.ini /usr/local/etc/php/conf.d/90-otel.ini
2525

26+
########################################
27+
# Enable AMQP Extension
28+
# It's already in the core image.
29+
########################################
30+
RUN mv /usr/local/etc/php/disabled/amqp.ini /usr/local/etc/php/conf.d/90-amqp.ini
31+
2632
RUN git config --add --system safe.directory /project
2733

2834
########################################

infrastructure/sdk.sprykerci-8.3.Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ RUN docker-php-ext-install xsl
2323
########################################
2424
RUN mv /usr/local/etc/php/disabled/otel.ini /usr/local/etc/php/conf.d/90-otel.ini
2525

26+
########################################
27+
# Enable AMQP Extension
28+
# It's already in the core image.
29+
########################################
30+
RUN mv /usr/local/etc/php/disabled/amqp.ini /usr/local/etc/php/conf.d/90-amqp.ini
31+
2632
RUN git config --add --system safe.directory /project
2733

2834
########################################

infrastructure/sdk.sprykerci-8.4.Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ RUN docker-php-ext-install xsl
2323
########################################
2424
RUN mv /usr/local/etc/php/disabled/otel.ini /usr/local/etc/php/conf.d/90-otel.ini
2525

26+
########################################
27+
# Enable AMQP Extension
28+
# It's already in the core image.
29+
########################################
30+
RUN mv /usr/local/etc/php/disabled/amqp.ini /usr/local/etc/php/conf.d/90-amqp.ini
31+
2632
RUN git config --add --system safe.directory /project
2733

2834
########################################

src/Core/Application/Dto/Abstraction/Dto.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ protected function toSingularValue($value, string $type = DtoProperty::TYPE_DEFA
115115

116116
/**
117117
* @param \SprykerSdk\Sdk\Core\Application\Dto\Abstraction\Reflection\DtoProperty $property
118-
* @param array $arrayValue
118+
* @param mixed $arrayValue
119119
* @param string $type
120120
*
121121
* @return array
@@ -131,7 +131,7 @@ protected function toArrayValue(DtoProperty $property, $arrayValue, string $type
131131

132132
/**
133133
* @param array $keyStack
134-
* @param array $arrayValue
134+
* @param mixed $arrayValue
135135
* @param string $type
136136
*
137137
* @return array
@@ -192,7 +192,7 @@ protected function setFromArray(array $data, bool $ignoreMissing)
192192
protected function fromSingularValue(DtoProperty $property, $value, bool $ignoreMissing = false)
193193
{
194194
if (is_subclass_of($property->getType(), FromArrayToArrayInterface::class)) {
195-
/** @var \SprykerSdk\Sdk\Core\Application\Dto\Abstraction\FromArrayToArrayInterface $className */
195+
/** @var class-string<\SprykerSdk\Sdk\Core\Application\Dto\Abstraction\FromArrayToArrayInterface> $className */
196196
$className = $property->getType();
197197

198198
$value = is_array($value) ? $className::fromArray($value, $ignoreMissing) : null;
@@ -205,7 +205,7 @@ protected function fromSingularValue(DtoProperty $property, $value, bool $ignore
205205

206206
/**
207207
* @param \SprykerSdk\Sdk\Core\Application\Dto\Abstraction\Reflection\DtoProperty $property
208-
* @param array $collectionValue
208+
* @param mixed $collectionValue
209209
* @param bool $ignoreMissing
210210
*
211211
* @return array
@@ -222,7 +222,7 @@ protected function fromCollectionValue(DtoProperty $property, $collectionValue,
222222
/**
223223
* @param array $keyStack
224224
* @param \SprykerSdk\Sdk\Core\Application\Dto\Abstraction\Reflection\DtoProperty $property
225-
* @param array $collectionValue
225+
* @param mixed $collectionValue
226226
* @param bool $ignoreMissing
227227
*
228228
* @return array

src/Extension/Converter/DeprecationsReportConverter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace SprykerSdk\Sdk\Extension\Converter;
99

10+
use Closure;
1011
use SprykerSdk\Sdk\Core\Application\Dto\Violation\Violation;
1112
use SprykerSdk\Sdk\Core\Application\Dto\Violation\ViolationReport;
1213
use SprykerSdk\Sdk\Core\Application\Violation\AbstractViolationConverter;
@@ -92,7 +93,7 @@ protected function filterDeprecations(array $report): array
9293
*/
9394
protected function formatDeprecations(array $issues): array
9495
{
95-
return array_map([static::class, 'createDeprecation'], $issues);
96+
return array_map(Closure::fromCallable([$this, 'createDeprecation']), $issues);
9697
}
9798

9899
/**

src/Extension/ValueResolver/SdkDirectoryValueResolver.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,12 @@ protected function getValueFromSettings(array $settingValues): string
9999
return $this->sdkBasePath;
100100
}
101101

102-
$settingSdkBasePath = $settingValues[Setting::PATH_SDK_DIR];
102+
$settingSdkBasePath = (string)$settingValues[Setting::PATH_SDK_DIR];
103103

104-
if (realpath($settingSdkBasePath) !== false) {
105-
return realpath($settingSdkBasePath);
104+
$realPath = realpath($settingSdkBasePath);
105+
106+
if ($realPath !== false) {
107+
return $realPath;
106108
}
107109

108110
return $this->sdkBasePath . DIRECTORY_SEPARATOR . $settingSdkBasePath;

src/Infrastructure/Event/Workflow/WorkflowTransitionListener.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ protected function getTransitionMeta(Event $event, string $metaName)
376376
*/
377377
protected function getContext(TransitionEvent $event): ContextInterface
378378
{
379-
/** @var \SprykerSdk\Sdk\Core\Domain\Entity\ContextInterface $context */
380379
$context = $event->getContext()['context'] ?? null;
381380

382381
if (!$context instanceof ContextInterface) {

0 commit comments

Comments
 (0)