Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove psalm in favor of phpstan #550

Merged
merged 2 commits into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ infection.json export-ignore
Makefile export-ignore
phpstan.neon.dist export-ignore
phpstan-baseline.neon export-ignore
psalm-baseline.xml export-ignore
psalm.xml export-ignore
phpunit.xml.dist export-ignore
/docs export-ignore
/tests export-ignore
Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
'import_functions' => false,
],
'phpdoc_to_comment' => [
'ignored_tags' => ['psalm-suppress'],
'ignored_tags' => [],
],
])
->setFinder($finder)
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ cs: vendor-bin/tools/vendor
cs-fix: vendor-bin/tools/vendor
vendor/bin/php-cs-fixer fix --verbose

.PHONY: psalm
psalm: vendor-bin/tools/vendor
vendor/bin/psalm --config=psalm.xml --diff --shepherd --show-info=false --stats --threads=4

.PHONY: phpstan
phpstan: vendor-bin/tools/vendor
vendor/bin/phpstan analyse
Expand Down
2,089 changes: 2,089 additions & 0 deletions phpstan-baseline.neon

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions psalm-baseline.xml

This file was deleted.

15 changes: 0 additions & 15 deletions psalm.xml

This file was deleted.

2 changes: 1 addition & 1 deletion src/Action/RegistrationConfirmedAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private function getTargetUrlFromSession(SessionInterface $session): ?string
return null;
}

$key = sprintf('_security.%s.target_path', $token->getProviderKey());
$key = \sprintf('_security.%s.target_path', $token->getProviderKey());

if ($session->has($key)) {
return $session->get($key);
Expand Down
2 changes: 0 additions & 2 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public function getConfigTreeBuilder(): TreeBuilder

private function addRegistrationSection(ArrayNodeDefinition $node): void
{
/** @psalm-suppress UndefinedInterfaceMethod */
$node
->children()
->arrayNode('registration')
Expand All @@ -52,7 +51,6 @@ private function addRegistrationSection(ArrayNodeDefinition $node): void

private function addServiceSection(ArrayNodeDefinition $node): void
{
/** @psalm-suppress UndefinedInterfaceMethod */
$node
->addDefaultsIfNotSet()
->children()
Expand Down
2 changes: 1 addition & 1 deletion src/Event/GetResponseRegistrationEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class GetResponseRegistrationEvent extends Event

private ?Response $response = null;

public function __construct(UserInterface $user, Request $request = null)
public function __construct(UserInterface $user, ?Request $request = null)
{
$this->user = $user;
$this->request = $request;
Expand Down
2 changes: 1 addition & 1 deletion src/Mailer/Mail/RegistrationMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class RegistrationMail extends TemplatedEmail

private UserInterface $user;

public function __construct(Headers $headers = null, AbstractPart $body = null)
public function __construct(?Headers $headers = null, ?AbstractPart $body = null)
{
parent::__construct($headers, $body);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private function getFullConfig(): array

private function assertAlias(string $value, string $key): void
{
self::assertSame($value, (string) $this->configuration->getAlias($key), sprintf('%s alias is correct', $key));
self::assertSame($value, (string) $this->configuration->getAlias($key), \sprintf('%s alias is correct', $key));
}

private function assertHasDefinition(string $id): void
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Action/RegistrationWebTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private function performRegister(KernelBrowser $client): void

private function performConfirm(KernelBrowser $client, TestUser $user): void
{
$client->request('GET', sprintf('/register/confirm/%s', $user->getConfirmationToken()));
$client->request('GET', \sprintf('/register/confirm/%s', $user->getConfirmationToken()));

self::assertResponseRedirects('/register/confirmed');

Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/DoctrineSetupTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ trait DoctrineSetupTrait
* @param string[] $roles
*/
public static function createUser(
string $username = null,
?string $username = null,
array $roles = []
): TestUser {
$entity = new TestUser();
Expand All @@ -32,7 +32,7 @@ public static function createUser(
$username ??= ('my-user'.$entity->getId());

$entity->setUsername($username);
$entity->setEmail(sprintf('%[email protected]', $username));
$entity->setEmail(\sprintf('%[email protected]', $username));
$entity->setRoles($roles);

return $entity;
Expand Down
6 changes: 3 additions & 3 deletions tests/Resources/XliffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testXliff(string $locale): void
$this->validateXliff($locale);

if (\count($this->errors) > 0) {
self::fail(sprintf('Unable to parse xliff files: %s', implode(', ', $this->errors)));
self::fail(\sprintf('Unable to parse xliff files: %s', implode(', ', $this->errors)));
}
}

Expand All @@ -49,7 +49,7 @@ public function testXliff(string $locale): void
*/
public static function provideXliffCases(): iterable
{
$files = glob(sprintf('%s/*.xlf', __DIR__.'/../../src/Resources/translations'));
$files = glob(\sprintf('%s/*.xlf', __DIR__.'/../../src/Resources/translations'));

if (false === $files) {
return;
Expand All @@ -69,7 +69,7 @@ private function validateXliff(string $file): void

self::assertGreaterThan(0, $catalogue->getResources());
} catch (InvalidResourceException $e) {
$this->errors[] = sprintf('%s => %s', $locale, $e->getMessage());
$this->errors[] = \sprintf('%s => %s', $locale, $e->getMessage());
}
}
}
2 changes: 1 addition & 1 deletion tests/Routing/RoutingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testLoadRouting(string $routeName, string $path, array $methods)
$collection->addCollection($subCollection);

$route = $collection->get($routeName);
self::assertNotNull($route, sprintf('The route "%s" should exists', $routeName));
self::assertNotNull($route, \sprintf('The route "%s" should exists', $routeName));
self::assertSame($path, $route->getPath());
self::assertSame($methods, $route->getMethods());
}
Expand Down
5 changes: 1 addition & 4 deletions vendor-bin/tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
"phpstan/phpstan-strict-rules": "^1.5.1",
"phpstan/phpstan-symfony": "^1.3.1",
"phpunit/phpunit": "^10.1.2",
"psalm/plugin-phpunit": "^0.19.0",
"psalm/plugin-symfony": "^5.0.3",
"symfony/phpunit-bridge": "^7.0",
"vimeo/psalm": "^5.9"
"symfony/phpunit-bridge": "^7.0"
},
"config": {
"allow-plugins": {
Expand Down
Loading
Loading