Skip to content

Commit c3d868f

Browse files
committed
FRW-10644 Updated PHPSTan
1 parent 640446a commit c3d868f

13 files changed

Lines changed: 90 additions & 82 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": "dev-feature/frw-10644/master-upgraded-phpstan",
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": "dev-feature/frw-10644/master-upgraded-phpstan-support",
5151
"spryker/architecture-sniffer": "^0.5.7",
5252
"spryker/code-sniffer": "^0.17.18",
5353
"symfony/asset": "^6.0",

composer.lock

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

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)