Skip to content

Commit c63aae7

Browse files
authored
ci: remove psalm and replace annotations with phpstan (#2031)
1 parent e79c3bd commit c63aae7

29 files changed

Lines changed: 73 additions & 275 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373

7474
# These dependencies are not used running the tests but can cause deprecation warnings so we remove them before running the tests
7575
- name: Remove unused dependencies
76-
run: composer remove vimeo/psalm phpstan/phpstan friendsofphp/php-cs-fixer --dev --no-interaction --no-update
76+
run: composer remove phpstan/phpstan friendsofphp/php-cs-fixer --dev --no-interaction --no-update
7777

7878
- name: Remove RoadRunner dependencies on unsupported PHP versions
7979
if: ${{ matrix.os == 'windows-latest' || matrix.php.version == '7.2' || matrix.php.version == '7.3' || matrix.php.version == '7.4' || matrix.php.version == '8.0' }}

.github/workflows/static-analysis.yaml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,3 @@ jobs:
4747
- name: Run script
4848
run: vendor/bin/phpstan analyse
4949

50-
psalm:
51-
name: Psalm
52-
runs-on: ubuntu-latest
53-
steps:
54-
- name: Checkout
55-
uses: actions/checkout@v6
56-
57-
- name: Setup PHP
58-
uses: shivammathur/setup-php@v2
59-
with:
60-
php-version: '8.3'
61-
62-
- name: Install dependencies
63-
run: composer update --no-progress --no-interaction --prefer-dist
64-
65-
- name: Run script
66-
run: vendor/bin/psalm

composer.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
"phpstan/phpstan": "^1.3",
4242
"phpunit/phpunit": "^8.5.52|^9.6.34",
4343
"spiral/roadrunner-http": "^3.6",
44-
"spiral/roadrunner-worker": "^3.6",
45-
"vimeo/psalm": "^4.17"
44+
"spiral/roadrunner-worker": "^3.6"
4645
},
4746
"suggest": {
4847
"monolog/monolog": "Allow sending log messages to Sentry by using the included Monolog handler."
@@ -67,14 +66,12 @@
6766
"check": [
6867
"@cs-check",
6968
"@phpstan",
70-
"@psalm",
7169
"@tests"
7270
],
7371
"tests": "vendor/bin/phpunit --verbose",
7472
"cs-check": "vendor/bin/php-cs-fixer fix --verbose --diff --dry-run",
7573
"cs-fix": "vendor/bin/php-cs-fixer fix --verbose --diff",
76-
"phpstan": "vendor/bin/phpstan analyse",
77-
"psalm": "vendor/bin/psalm"
74+
"phpstan": "vendor/bin/phpstan analyse"
7875
},
7976
"config": {
8077
"sort-packages": true

psalm-baseline.xml

Lines changed: 0 additions & 100 deletions
This file was deleted.

psalm.xml.dist

Lines changed: 0 additions & 75 deletions
This file was deleted.

src/Breadcrumb.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public function withTimestamp(float $timestamp): self
323323
*
324324
* @param array $data Data used to populate the breadcrumb
325325
*
326-
* @psalm-param array{
326+
* @phpstan-param array{
327327
* level: string,
328328
* type?: string,
329329
* category: string,

src/Client.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Client implements ClientInterface
5858
/**
5959
* @var array<string, IntegrationInterface> The stack of integrations
6060
*
61-
* @psalm-var array<class-string<IntegrationInterface>, IntegrationInterface>
61+
* @phpstan-var array<class-string<IntegrationInterface>, IntegrationInterface>
6262
*/
6363
private $integrations;
6464

@@ -224,11 +224,11 @@ public function captureLastError(?Scope $scope = null, ?EventHint $hint = null):
224224
/**
225225
* {@inheritdoc}
226226
*
227-
* @psalm-template T of IntegrationInterface
227+
* @phpstan-template T of IntegrationInterface
228228
*/
229229
public function getIntegration(string $className): ?IntegrationInterface
230230
{
231-
/** @psalm-var T|null */
231+
/** @phpstan-var T|null */
232232
return $this->integrations[$className] ?? null;
233233
}
234234

src/ClientInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ public function captureEvent(Event $event, ?EventHint $hint = null, ?Scope $scop
6161
*
6262
* @param string $className The FQCN of the integration
6363
*
64-
* @psalm-template T of IntegrationInterface
64+
* @phpstan-template T of IntegrationInterface
6565
*
66-
* @psalm-param class-string<T> $className
66+
* @phpstan-param class-string<T> $className
6767
*
68-
* @psalm-return T|null
68+
* @phpstan-return T|null
6969
*/
7070
public function getIntegration(string $className): ?IntegrationInterface;
7171

src/ErrorHandler.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* error handler more than once is not supported and will lead to nasty
1414
* problems. The code is based on the Symfony ErrorHandler component.
1515
*
16-
* @psalm-import-type StacktraceFrame from FrameBuilder
16+
* @phpstan-import-type StacktraceFrame from FrameBuilder
1717
*/
1818
final class ErrorHandler
1919
{
@@ -44,21 +44,21 @@ final class ErrorHandler
4444
/**
4545
* @var callable[] List of listeners that will act on each captured error
4646
*
47-
* @psalm-var (callable(\ErrorException): void)[]
47+
* @phpstan-var (callable(\ErrorException): void)[]
4848
*/
4949
private $errorListeners = [];
5050

5151
/**
5252
* @var callable[] List of listeners that will act of each captured fatal error
5353
*
54-
* @psalm-var (callable(FatalErrorException): void)[]
54+
* @phpstan-var (callable(FatalErrorException): void)[]
5555
*/
5656
private $fatalErrorListeners = [];
5757

5858
/**
5959
* @var callable[] List of listeners that will act on each captured exception
6060
*
61-
* @psalm-var (callable(\Throwable): void)[]
61+
* @phpstan-var (callable(\Throwable): void)[]
6262
*/
6363
private $exceptionListeners = [];
6464

@@ -76,7 +76,7 @@ final class ErrorHandler
7676
/**
7777
* @var callable|null The previous exception handler, if any
7878
*
79-
* @psalm-var null|callable(\Throwable): void
79+
* @phpstan-var null|callable(\Throwable): void
8080
*/
8181
private $previousExceptionHandler;
8282

@@ -250,7 +250,7 @@ public static function registerOnceExceptionHandler(): self
250250
* and that must accept a single argument
251251
* of type \ErrorException
252252
*
253-
* @psalm-param callable(\ErrorException): void $listener
253+
* @phpstan-param callable(\ErrorException): void $listener
254254
*/
255255
public function addErrorHandlerListener(callable $listener): void
256256
{
@@ -265,7 +265,7 @@ public function addErrorHandlerListener(callable $listener): void
265265
* and that must accept a single argument
266266
* of type \Sentry\Exception\FatalErrorException
267267
*
268-
* @psalm-param callable(FatalErrorException): void $listener
268+
* @phpstan-param callable(FatalErrorException): void $listener
269269
*/
270270
public function addFatalErrorHandlerListener(callable $listener): void
271271
{
@@ -280,7 +280,7 @@ public function addFatalErrorHandlerListener(callable $listener): void
280280
* and that must accept a single argument
281281
* of type \Throwable
282282
*
283-
* @psalm-param callable(\Throwable): void $listener
283+
* @phpstan-param callable(\Throwable): void $listener
284284
*/
285285
public function addExceptionHandlerListener(callable $listener): void
286286
{
@@ -460,7 +460,7 @@ private function handleException(\Throwable $exception): void
460460
* @param string $file The filename the backtrace was raised in
461461
* @param int $line The line number the backtrace was raised at
462462
*
463-
* @psalm-param list<StacktraceFrame> $backtrace
463+
* @phpstan-param list<StacktraceFrame> $backtrace
464464
*
465465
* @return array<int, mixed>
466466
*/

src/Event.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -908,13 +908,13 @@ public function setSdkMetadata(string $name, $data): self
908908
/**
909909
* Gets the SDK metadata.
910910
*
911-
* @psalm-template T of string|null
911+
* @phpstan-template T of string|null
912912
*
913-
* @psalm-param T $name
913+
* @phpstan-param T $name
914914
*
915915
* @return mixed
916916
*
917-
* @psalm-return (T is string ? mixed : array<string, mixed>|null)
917+
* @phpstan-return (T is string ? mixed : array<string, mixed>|null)
918918
*/
919919
public function getSdkMetadata(?string $name = null)
920920
{

0 commit comments

Comments
 (0)