Skip to content

Commit

Permalink
minor #15582 Bye Psalm ๐Ÿ‘‹๐Ÿผ (jakubtobiasz)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.12 branch.

Discussion
----------

| Q               | A                                                            |
|-----------------|--------------------------------------------------------------|
| Branch?         | 1.12
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | n/a
| License         | MIT

**Justification**
>Hello everyone, last Friday, we once again raised the topic of maintaining two static analysis tools within Sylius. We're wondering about switching to only one (preferably phpstan, with a change to write custom PHPStan rules for Sylius).
>
>Why? From time to time we have to face with issues when one tool is fine with some code, but another starts complaining. We're aware it (probably) increases the code quality, but at the same time, some of us find the ROI at a low level compared to (stupid) work we sometimes have to do.

Core Team Voting result:
6 votes for keeping only PHPStan
1 vote for keeping only Psalm
1 vote for keeping both
2 votes for keeping any but only one

I was wondering whether we should target it against `1.12` or `1.13`, but as it's not a hard dependency, and we still maintain `1.12`, I decided to pick this one.


Commits
-------
  Remove Psalm
  • Loading branch information
NoResponseMate committed Dec 4, 2023
2 parents 0a166a2 + 7ece672 commit c227331
Show file tree
Hide file tree
Showing 162 changed files with 179 additions and 932 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci_static-checks.yaml
Expand Up @@ -95,9 +95,6 @@ jobs:
- name: Run PHPArkitect
run: vendor/bin/phparkitect check

- name: Run Psalm
run: vendor/bin/psalm --show-info=false --output-format=github --php-version=${{ matrix.php }}

- name: Run PHPStan
run: vendor/bin/phpstan analyse

Expand Down
2 changes: 0 additions & 2 deletions CONFLICTS.md
Expand Up @@ -20,8 +20,6 @@ references related issues.

This version is causing a problem with mink session:
`InvalidArgumentException: Specify session name to get in vendor/friends-of-behat/mink/src/Mink.php:198`,
Psalm error:
`UndefinedDocblockClass: Docblock-defined class, interface or enum named UnitEnum does not exist`.

- `symfony/framework-bundle:5.4.5`:

Expand Down
7 changes: 2 additions & 5 deletions Makefile
Expand Up @@ -7,9 +7,6 @@ phpspec:
phpstan:
vendor/bin/phpstan analyse

psalm:
vendor/bin/psalm

behat-cli:
vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&@cli&&~@todo" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="~@javascript&&@cli&&~@todo" --rerun

Expand All @@ -35,11 +32,11 @@ behat: behat-cli behat-non-js behat-js

init: install backend frontend

ci: init phpstan psalm phpunit phpspec behat
ci: init phpstan phpunit phpspec behat

integration: init phpunit behat-cli behat-non-js

static: install phpspec phpstan psalm
static: install phpspec phpstan

# Example execution: make profile url=http://app
profile:
Expand Down
4 changes: 1 addition & 3 deletions composer.json
Expand Up @@ -221,7 +221,6 @@
"phpstan/phpstan-webmozart-assert": "^1.1",
"phpunit/phpunit": "^8.5",
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
"psalm/plugin-mockery": "0.7.0",
"psr/event-dispatcher": "^1.0",
"rector/rector": "^0.12.20",
"stripe/stripe-php": "^8.1",
Expand All @@ -232,8 +231,7 @@
"symfony/flex": "^1.7",
"symfony/runtime": "^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
"symplify/monorepo-builder": "^11.0",
"vimeo/psalm": "^4.19"
"symplify/monorepo-builder": "^11.0"
},
"suggest": {
"ext-iconv": "For better performance than using Symfony Polyfill Component",
Expand Down
239 changes: 0 additions & 239 deletions psalm.xml

This file was deleted.

3 changes: 0 additions & 3 deletions src/Sylius/Bundle/AddressingBundle/SyliusAddressingBundle.php
Expand Up @@ -25,9 +25,6 @@ public function getSupportedDrivers(): array
];
}

/**
* @psalm-suppress MismatchingDocblockReturnType https://github.com/vimeo/psalm/issues/2345
*/
protected function getModelNamespace(): string
{
return 'Sylius\Component\Addressing\Model';
Expand Down
Expand Up @@ -49,11 +49,7 @@ public function getRouteName(string $resourceClass, $operationType /*, array $co
);

return $this->getCached($cacheKey, function () use ($resourceClass, $operationType, $context) {
/**
* @psalm-suppress TooManyArguments
*
* @phpstan-ignore-next-line
*/
/** @phpstan-ignore-next-line */
return $this->decorated->getRouteName($resourceClass, $operationType, $context);
});
}
Expand Down
Expand Up @@ -24,14 +24,14 @@ class ChangePaymentMethod implements OrderTokenValueAwareInterface, SubresourceI
public $orderTokenValue;

/**
* @psalm-immutable
* @immutable
*
* @var string|null
*/
public $paymentId;

/**
* @psalm-immutable
* @immutable
*
* @var string
*/
Expand Down
Expand Up @@ -22,21 +22,21 @@ class ChangeShopUserPassword implements ShopUserIdAwareInterface
public $shopUserId;

/**
* @psalm-immutable
* @immutable
*
* @var string|null
*/
public $newPassword;

/**
* @psalm-immutable
* @immutable
*
* @var string|null
*/
public $confirmNewPassword;

/**
* @psalm-immutable
* @immutable
*
* @var string|null
*/
Expand Down

0 comments on commit c227331

Please sign in to comment.