Skip to content

Commit 6e25138

Browse files
authored
Merge pull request #99 from spryker/feature/frw-10644/master-upgraded-phpstan
FRW-10644 PHPStan 2.* Support.
2 parents 14d5e9a + 1fe5156 commit 6e25138

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"cs-check": "phpcs -p -s --standard=vendor/spryker/code-sniffer/Spryker/ruleset.xml --ignore=/tests/app/ src/ tests/",
5555
"cs-fix": "phpcbf -p --standard=vendor/spryker/code-sniffer/Spryker/ruleset.xml --ignore=/tests/app/ src/ tests/",
5656
"stan": "phpstan analyse",
57-
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^1.0.0 && mv composer.backup composer.json",
57+
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^2.1.0 && mv composer.backup composer.json",
5858
"test": "codecept build && codecept run"
5959
},
6060
"extra": {

phpstan.neon

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ parameters:
22
level: 8
33
paths:
44
- src/
5-
checkMissingIterableValueType: false
65
excludePaths:
76
- '*/templates/*'
8-
- 'src/Spryker/Zed/EventBehavior/Persistence/Propel/AbstractSpyEventBehaviorEntityChange.php'
9-
- 'src/Spryker/Zed/EventBehavior/Persistence/Propel/AbstractSpyEventBehaviorEntityChangeQuery.php'
7+
- 'src/Spryker/Zed/EventBehavior/Persistence/Propel/AbstractSpyEventBehaviorEntityChange.php (?)'
8+
- 'src/Spryker/Zed/EventBehavior/Persistence/Propel/AbstractSpyEventBehaviorEntityChangeQuery.php (?)'
109
ignoreErrors:
1110
- '#Parameter \#1 \$plugins of method .+EventResourceQueryContainerManager::processResourceEvents\(\) expects .+ given.#'
1211
- '#Call to (static method|method) .+ on an unknown class Generated\\.+#'
1312
- '#Cannot call method offset\(\) on .+ModelCriteria\|null#'
1413
- '#Parameter \#1 \$clause of method .+\\ModelCriteria::where\(\) expects array\|literal-string, non-falsy-string given.#'
14+
-
15+
identifier: missingType.iterableValue
1516
bootstrapFiles:
1617
- tests/bootstrap.php

src/Spryker/Glue/EventBehavior/Plugin/EventDispatcher/EventBehaviorEventDispatcherPlugin.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\HttpKernel\KernelEvents;
1515

1616
/**
17-
* @method \Spryker\Glue\EventBehavior\EventBehaviorDependencyFactory getFactory()
1817
* @method \Spryker\Zed\EventBehavior\Business\EventBehaviorFacadeInterface getFacade()
1918
*/
2019
class EventBehaviorEventDispatcherPlugin extends AbstractPlugin implements EventDispatcherPluginInterface

src/Spryker/Zed/EventBehavior/Business/Model/AbstractEventResourcePluginIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function key(): int
8888
*/
8989
public function valid(): bool
9090
{
91-
return is_array($this->current) && $this->current !== [];
91+
return is_array($this->current) && $this->current !== []; // @phpstan-ignore function.alreadyNarrowedType
9292
}
9393

9494
/**

src/Spryker/Zed/EventBehavior/Business/Model/EventEntityTransferFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function getEventTransferForeignKeys(array $eventTransfers, $foreignKeyCo
4747
}
4848

4949
$value = $eventTransfer->getForeignKeys()[$foreignKeyColumnName];
50-
if ($value !== null) {
50+
if ($value !== null) { // @phpstan-ignore notIdentical.alwaysTrue
5151
$foreignKeys[] = $value;
5252
}
5353
}

src/Spryker/Zed/EventBehavior/Communication/Console/EventTriggerConsole.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9898
if ($input->getOption(static::RESOURCE_IDS_OPTION)) {
9999
/** @var string $idsString */
100100
$idsString = $input->getOption(static::RESOURCE_IDS_OPTION);
101-
/** @var array<int> $resourcesIds */
102-
$resourcesIds = explode(',', $idsString);
101+
$resourcesIds = array_map('intval', explode(',', $idsString));
103102
}
104103

105104
$this->getFacade()->executeResolvedPluginsBySources($resources, $resourcesIds);

0 commit comments

Comments
 (0)