From 730a7cebd562b004385bac27d3c78754b33e8f81 Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Thu, 19 Mar 2026 16:00:31 +0100 Subject: [PATCH 1/2] ci: remove psalm and replace annotations with phpstan --- .github/workflows/ci.yml | 2 +- .github/workflows/static-analysis.yaml | 17 --- composer.json | 7 +- psalm-baseline.xml | 100 ------------------ psalm.xml.dist | 75 ------------- src/Breadcrumb.php | 2 +- src/Client.php | 6 +- src/ClientInterface.php | 6 +- src/ErrorHandler.php | 18 ++-- src/Event.php | 6 +- src/EventHint.php | 2 +- src/FrameBuilder.php | 6 +- .../FrameContextifierIntegration.php | 2 +- src/Integration/RequestIntegration.php | 4 +- src/Monolog/BreadcrumbHandler.php | 2 - src/Monolog/LogsHandler.php | 7 -- src/Options.php | 30 +++--- src/SentrySdk.php | 6 +- src/Serializer/EnvelopItems/EventItem.php | 2 +- .../EnvelopItems/TransactionItem.php | 4 +- .../Traits/BreadcrumbSeralizerTrait.php | 2 +- .../Traits/StacktraceFrameSeralizerTrait.php | 2 +- src/StacktraceBuilder.php | 4 +- src/State/HubInterface.php | 12 +-- src/State/Scope.php | 4 +- src/Tracing/GuzzleTracingMiddleware.php | 1 - src/Tracing/Span.php | 2 +- src/functions.php | 12 +-- 28 files changed, 69 insertions(+), 274 deletions(-) delete mode 100644 psalm-baseline.xml delete mode 100644 psalm.xml.dist diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2939342fb5..fb07996426 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: # These dependencies are not used running the tests but can cause deprecation warnings so we remove them before running the tests - name: Remove unused dependencies - run: composer remove vimeo/psalm phpstan/phpstan friendsofphp/php-cs-fixer --dev --no-interaction --no-update + run: composer remove phpstan/phpstan friendsofphp/php-cs-fixer --dev --no-interaction --no-update - name: Remove RoadRunner dependencies on unsupported PHP versions 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' }} diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml index ba6ffe12cf..0c85d12a60 100644 --- a/.github/workflows/static-analysis.yaml +++ b/.github/workflows/static-analysis.yaml @@ -47,20 +47,3 @@ jobs: - name: Run script run: vendor/bin/phpstan analyse - psalm: - name: Psalm - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - - - name: Install dependencies - run: composer update --no-progress --no-interaction --prefer-dist - - - name: Run script - run: vendor/bin/psalm diff --git a/composer.json b/composer.json index b3878c9acb..ba94d3f138 100644 --- a/composer.json +++ b/composer.json @@ -41,8 +41,7 @@ "phpstan/phpstan": "^1.3", "phpunit/phpunit": "^8.5.52|^9.6.34", "spiral/roadrunner-http": "^3.6", - "spiral/roadrunner-worker": "^3.6", - "vimeo/psalm": "^4.17" + "spiral/roadrunner-worker": "^3.6" }, "suggest": { "monolog/monolog": "Allow sending log messages to Sentry by using the included Monolog handler." @@ -67,14 +66,12 @@ "check": [ "@cs-check", "@phpstan", - "@psalm", "@tests" ], "tests": "vendor/bin/phpunit --verbose", "cs-check": "vendor/bin/php-cs-fixer fix --verbose --diff --dry-run", "cs-fix": "vendor/bin/php-cs-fixer fix --verbose --diff", - "phpstan": "vendor/bin/phpstan analyse", - "psalm": "vendor/bin/psalm" + "phpstan": "vendor/bin/phpstan analyse" }, "config": { "sort-packages": true diff --git a/psalm-baseline.xml b/psalm-baseline.xml deleted file mode 100644 index 8dbbbbe277..0000000000 --- a/psalm-baseline.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - $parsedDsn['host'] - $parsedDsn['path'] - $parsedDsn['scheme'] - $parsedDsn['user'] - - - - - $userIntegration - $userIntegrations - - - - - $record['channel'] - $record['level'] - $record['level'] - $record['message'] - - - getTimestamp - - - Level|int - int|string|Level|LogLevel::* - - - - - CompatibilityLogLevelTrait - - - Level - - - - - CompatibilityProcessingHandlerTrait - - - Level - - - - - $record['channel'] - $record['level'] - $record['message'] - - - $record['context']['exception'] - - - $record['context'] - $record['context'] - - - - - $record['level'] - $record['level'] - $record['message'] - - - $record['context']['exception'] - - - $record['context'] - $record['context'] - - - - - - SentryProfile|null - - - - - (string) $value - - - - - $value - - - representationSerialize - - - - - $transaction - - - diff --git a/psalm.xml.dist b/psalm.xml.dist deleted file mode 100644 index ea60216a6e..0000000000 --- a/psalm.xml.dist +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Breadcrumb.php b/src/Breadcrumb.php index a5e3116dcd..c6d1fbf445 100644 --- a/src/Breadcrumb.php +++ b/src/Breadcrumb.php @@ -323,7 +323,7 @@ public function withTimestamp(float $timestamp): self * * @param array $data Data used to populate the breadcrumb * - * @psalm-param array{ + * @phpstan-param array{ * level: string, * type?: string, * category: string, diff --git a/src/Client.php b/src/Client.php index 23f546024a..d5b412bebc 100644 --- a/src/Client.php +++ b/src/Client.php @@ -58,7 +58,7 @@ class Client implements ClientInterface /** * @var array The stack of integrations * - * @psalm-var array, IntegrationInterface> + * @phpstan-var array, IntegrationInterface> */ private $integrations; @@ -224,11 +224,11 @@ public function captureLastError(?Scope $scope = null, ?EventHint $hint = null): /** * {@inheritdoc} * - * @psalm-template T of IntegrationInterface + * @phpstan-template T of IntegrationInterface */ public function getIntegration(string $className): ?IntegrationInterface { - /** @psalm-var T|null */ + /** @phpstan-var T|null */ return $this->integrations[$className] ?? null; } diff --git a/src/ClientInterface.php b/src/ClientInterface.php index 0aab383a4d..5d511519f7 100644 --- a/src/ClientInterface.php +++ b/src/ClientInterface.php @@ -61,11 +61,11 @@ public function captureEvent(Event $event, ?EventHint $hint = null, ?Scope $scop * * @param string $className The FQCN of the integration * - * @psalm-template T of IntegrationInterface + * @phpstan-template T of IntegrationInterface * - * @psalm-param class-string $className + * @phpstan-param class-string $className * - * @psalm-return T|null + * @phpstan-return T|null */ public function getIntegration(string $className): ?IntegrationInterface; diff --git a/src/ErrorHandler.php b/src/ErrorHandler.php index ba44df0c68..0839ce32b4 100644 --- a/src/ErrorHandler.php +++ b/src/ErrorHandler.php @@ -13,7 +13,7 @@ * error handler more than once is not supported and will lead to nasty * problems. The code is based on the Symfony ErrorHandler component. * - * @psalm-import-type StacktraceFrame from FrameBuilder + * @phpstan-import-type StacktraceFrame from FrameBuilder */ final class ErrorHandler { @@ -44,21 +44,21 @@ final class ErrorHandler /** * @var callable[] List of listeners that will act on each captured error * - * @psalm-var (callable(\ErrorException): void)[] + * @phpstan-var (callable(\ErrorException): void)[] */ private $errorListeners = []; /** * @var callable[] List of listeners that will act of each captured fatal error * - * @psalm-var (callable(FatalErrorException): void)[] + * @phpstan-var (callable(FatalErrorException): void)[] */ private $fatalErrorListeners = []; /** * @var callable[] List of listeners that will act on each captured exception * - * @psalm-var (callable(\Throwable): void)[] + * @phpstan-var (callable(\Throwable): void)[] */ private $exceptionListeners = []; @@ -76,7 +76,7 @@ final class ErrorHandler /** * @var callable|null The previous exception handler, if any * - * @psalm-var null|callable(\Throwable): void + * @phpstan-var null|callable(\Throwable): void */ private $previousExceptionHandler; @@ -250,7 +250,7 @@ public static function registerOnceExceptionHandler(): self * and that must accept a single argument * of type \ErrorException * - * @psalm-param callable(\ErrorException): void $listener + * @phpstan-param callable(\ErrorException): void $listener */ public function addErrorHandlerListener(callable $listener): void { @@ -265,7 +265,7 @@ public function addErrorHandlerListener(callable $listener): void * and that must accept a single argument * of type \Sentry\Exception\FatalErrorException * - * @psalm-param callable(FatalErrorException): void $listener + * @phpstan-param callable(FatalErrorException): void $listener */ public function addFatalErrorHandlerListener(callable $listener): void { @@ -280,7 +280,7 @@ public function addFatalErrorHandlerListener(callable $listener): void * and that must accept a single argument * of type \Throwable * - * @psalm-param callable(\Throwable): void $listener + * @phpstan-param callable(\Throwable): void $listener */ public function addExceptionHandlerListener(callable $listener): void { @@ -460,7 +460,7 @@ private function handleException(\Throwable $exception): void * @param string $file The filename the backtrace was raised in * @param int $line The line number the backtrace was raised at * - * @psalm-param list $backtrace + * @phpstan-param list $backtrace * * @return array */ diff --git a/src/Event.php b/src/Event.php index e236c82a79..822571a18a 100644 --- a/src/Event.php +++ b/src/Event.php @@ -908,13 +908,13 @@ public function setSdkMetadata(string $name, $data): self /** * Gets the SDK metadata. * - * @psalm-template T of string|null + * @phpstan-template T of string|null * - * @psalm-param T $name + * @phpstan-param T $name * * @return mixed * - * @psalm-return (T is string ? mixed : array|null) + * @phpstan-return (T is string ? mixed : array|null) */ public function getSdkMetadata(?string $name = null) { diff --git a/src/EventHint.php b/src/EventHint.php index 58b6ffc57e..71a9e577d0 100644 --- a/src/EventHint.php +++ b/src/EventHint.php @@ -40,7 +40,7 @@ final class EventHint /** * Create a EventHint instance from an array of values. * - * @psalm-param array{ + * @phpstan-param array{ * exception?: \Throwable|null, * mechanism?: ExceptionMechanism|null, * stacktrace?: Stacktrace|null, diff --git a/src/FrameBuilder.php b/src/FrameBuilder.php index 8c102ef283..99712435e8 100644 --- a/src/FrameBuilder.php +++ b/src/FrameBuilder.php @@ -12,7 +12,7 @@ * * @internal * - * @psalm-type StacktraceFrame array{ + * @phpstan-type StacktraceFrame array{ * function?: string, * line?: int, * file?: string, @@ -54,7 +54,7 @@ public function __construct(Options $options, RepresentationSerializerInterface * @param int $line The line at which the frame originated * @param array $backtraceFrame The raw frame * - * @psalm-param StacktraceFrame $backtraceFrame + * @phpstan-param StacktraceFrame $backtraceFrame */ public function buildFromBacktraceFrame(string $file, int $line, array $backtraceFrame): Frame { @@ -158,7 +158,7 @@ private function isFrameInApp(string $file, ?string $functionName): bool * * @param array $backtraceFrame The frame data * - * @psalm-param StacktraceFrame $backtraceFrame + * @phpstan-param StacktraceFrame $backtraceFrame * * @return array */ diff --git a/src/Integration/FrameContextifierIntegration.php b/src/Integration/FrameContextifierIntegration.php index 8a541d13df..f0ff6f59b3 100644 --- a/src/Integration/FrameContextifierIntegration.php +++ b/src/Integration/FrameContextifierIntegration.php @@ -114,7 +114,7 @@ private function addContextToStacktraceFrame(int $maxContextLines, Frame $frame) * * @return array * - * @psalm-return array{ + * @phpstan-return array{ * pre_context: string[], * context_line: string|null, * post_context: string[] diff --git a/src/Integration/RequestIntegration.php b/src/Integration/RequestIntegration.php index 72e17ac77e..de33a3f076 100644 --- a/src/Integration/RequestIntegration.php +++ b/src/Integration/RequestIntegration.php @@ -69,7 +69,7 @@ final class RequestIntegration implements IntegrationInterface /** * @var array The options * - * @psalm-var array{ + * @phpstan-var array{ * pii_sanitize_headers: string[] * } */ @@ -81,7 +81,7 @@ final class RequestIntegration implements IntegrationInterface * @param RequestFetcherInterface|null $requestFetcher PSR-7 request fetcher * @param array $options The options * - * @psalm-param array{ + * @phpstan-param array{ * pii_sanitize_headers?: string[] * } $options */ diff --git a/src/Monolog/BreadcrumbHandler.php b/src/Monolog/BreadcrumbHandler.php index fbda73c26d..29e166671b 100644 --- a/src/Monolog/BreadcrumbHandler.php +++ b/src/Monolog/BreadcrumbHandler.php @@ -42,8 +42,6 @@ public function __construct(HubInterface $hub, $level = Logger::DEBUG, bool $bub } /** - * @psalm-suppress MoreSpecificImplementedParamType - * * @param LogRecord|array{ * level: int, * channel: string, diff --git a/src/Monolog/LogsHandler.php b/src/Monolog/LogsHandler.php index 9eb49e440d..17c67d88d0 100644 --- a/src/Monolog/LogsHandler.php +++ b/src/Monolog/LogsHandler.php @@ -18,8 +18,6 @@ class LogsHandler implements HandlerInterface /** * The minimum logging level at which this handler will be triggered. * - * @psalm-suppress UndefinedDocblockClass - * * @var LogLevel|\Monolog\Level|int */ private $logLevel; @@ -34,8 +32,6 @@ class LogsHandler implements HandlerInterface /** * Creates a new Monolog handler that converts Monolog logs to Sentry logs. * - * @psalm-suppress UndefinedDocblockClass - * * @param LogLevel|\Monolog\Level|int|null $logLevel the minimum logging level at which this handler will be triggered and collects the logs * @param bool $bubble whether the messages that are handled can bubble up the stack or not */ @@ -46,9 +42,6 @@ public function __construct($logLevel = null, bool $bubble = true) } /** - * @psalm-suppress UndefinedDocblockClass - * @psalm-suppress UndefinedClass - * * @param array|LogRecord $record */ public function isHandling($record): bool diff --git a/src/Options.php b/src/Options.php index 5138b64892..fb43d42dcf 100644 --- a/src/Options.php +++ b/src/Options.php @@ -538,7 +538,7 @@ public function setServerName(string $serverName): self * * @return string[] * - * @psalm-return list> + * @phpstan-return list> */ public function getIgnoreExceptions(): array { @@ -587,7 +587,7 @@ public function setIgnoreTransactions(array $ignoreTransaction): self * Gets a callback that will be invoked before an event is sent to the server. * If `null` is returned it won't be sent. * - * @psalm-return callable(Event, ?EventHint): ?Event + * @phpstan-return callable(Event, ?EventHint): ?Event */ public function getBeforeSendCallback(): callable { @@ -600,7 +600,7 @@ public function getBeforeSendCallback(): callable * * @param callable $callback The callable * - * @psalm-param callable(Event, ?EventHint): ?Event $callback + * @phpstan-param callable(Event, ?EventHint): ?Event $callback */ public function setBeforeSendCallback(callable $callback): self { @@ -615,7 +615,7 @@ public function setBeforeSendCallback(callable $callback): self * Gets a callback that will be invoked before an transaction is sent to the server. * If `null` is returned it won't be sent. * - * @psalm-return callable(Event, ?EventHint): ?Event + * @phpstan-return callable(Event, ?EventHint): ?Event */ public function getBeforeSendTransactionCallback(): callable { @@ -628,7 +628,7 @@ public function getBeforeSendTransactionCallback(): callable * * @param callable $callback The callable * - * @psalm-param callable(Event, ?EventHint): ?Event $callback + * @phpstan-param callable(Event, ?EventHint): ?Event $callback */ public function setBeforeSendTransactionCallback(callable $callback): self { @@ -643,7 +643,7 @@ public function setBeforeSendTransactionCallback(callable $callback): self * Gets a callback that will be invoked before a check-in is sent to the server. * If `null` is returned it won't be sent. * - * @psalm-return callable(Event, ?EventHint): ?Event + * @phpstan-return callable(Event, ?EventHint): ?Event */ public function getBeforeSendCheckInCallback(): callable { @@ -656,7 +656,7 @@ public function getBeforeSendCheckInCallback(): callable * * @param callable $callback The callable * - * @psalm-param callable(Event, ?EventHint): ?Event $callback + * @phpstan-param callable(Event, ?EventHint): ?Event $callback */ public function setBeforeSendCheckInCallback(callable $callback): self { @@ -671,7 +671,7 @@ public function setBeforeSendCheckInCallback(callable $callback): self * Gets a callback that will be invoked before an log is sent to the server. * If `null` is returned it won't be sent. * - * @psalm-return callable(Log): ?Log + * @phpstan-return callable(Log): ?Log */ public function getBeforeSendLogCallback(): callable { @@ -684,7 +684,7 @@ public function getBeforeSendLogCallback(): callable * * @param callable $callback The callable * - * @psalm-param callable(Log): ?Log $callback + * @phpstan-param callable(Log): ?Log $callback */ public function setBeforeSendLogCallback(callable $callback): self { @@ -699,7 +699,7 @@ public function setBeforeSendLogCallback(callable $callback): self * Gets a callback that will be invoked before metrics are sent to the server. * If `null` is returned it won't be sent. * - * @psalm-return callable(Event, ?EventHint): ?Event + * @phpstan-return callable(Event, ?EventHint): ?Event * * @deprecated Metrics are no longer supported. Metrics API is a no-op and will be removed in 5.x. */ @@ -743,7 +743,7 @@ public function setBeforeSendMetricCallback(callable $callback): self * * @param callable $callback The callable * - * @psalm-param callable(Event, ?EventHint): ?Event $callback + * @phpstan-param callable(Event, ?EventHint): ?Event $callback * * @deprecated Metrics are no longer supported. Metrics API is a no-op and will be removed in 5.x. */ @@ -896,7 +896,7 @@ public function setMaxBreadcrumbs(int $maxBreadcrumbs): self /** * Gets a callback that will be invoked when adding a breadcrumb. * - * @psalm-return callable(Breadcrumb): ?Breadcrumb + * @phpstan-return callable(Breadcrumb): ?Breadcrumb */ public function getBeforeBreadcrumbCallback(): callable { @@ -912,7 +912,7 @@ public function getBeforeBreadcrumbCallback(): callable * * @param callable $callback The callback * - * @psalm-param callable(Breadcrumb): ?Breadcrumb $callback + * @phpstan-param callable(Breadcrumb): ?Breadcrumb $callback */ public function setBeforeBreadcrumbCallback(callable $callback): self { @@ -1296,7 +1296,7 @@ public function setClassSerializers(array $serializers): self /** * Gets a callback that will be invoked when we sample a Transaction. * - * @psalm-return null|callable(Tracing\SamplingContext): float + * @phpstan-return null|callable(Tracing\SamplingContext): float */ public function getTracesSampler(): ?callable { @@ -1309,7 +1309,7 @@ public function getTracesSampler(): ?callable * * @param ?callable $sampler The sampler * - * @psalm-param null|callable(Tracing\SamplingContext): float $sampler + * @phpstan-param null|callable(Tracing\SamplingContext): float $sampler */ public function setTracesSampler(?callable $sampler): self { diff --git a/src/SentrySdk.php b/src/SentrySdk.php index 75b2327083..c7cdb36af8 100644 --- a/src/SentrySdk.php +++ b/src/SentrySdk.php @@ -94,13 +94,13 @@ public static function endContext(?int $timeout = null): void * * @param callable $callback The callback to execute * - * @psalm-template T + * @phpstan-template T * - * @psalm-param callable(): T $callback + * @phpstan-param callable(): T $callback * * @return mixed * - * @psalm-return T + * @phpstan-return T */ public static function withContext(callable $callback, ?int $timeout = null) { diff --git a/src/Serializer/EnvelopItems/EventItem.php b/src/Serializer/EnvelopItems/EventItem.php index 49d58cabce..06fc00a3f3 100644 --- a/src/Serializer/EnvelopItems/EventItem.php +++ b/src/Serializer/EnvelopItems/EventItem.php @@ -148,7 +148,7 @@ public static function toEnvelopeItem(Event $event): string /** * @return array * - * @psalm-return array{ + * @phpstan-return array{ * type: string, * value: string, * stacktrace?: array{ diff --git a/src/Serializer/EnvelopItems/TransactionItem.php b/src/Serializer/EnvelopItems/TransactionItem.php index 9eb8eab226..28baf99ea0 100644 --- a/src/Serializer/EnvelopItems/TransactionItem.php +++ b/src/Serializer/EnvelopItems/TransactionItem.php @@ -134,7 +134,7 @@ public static function toEnvelopeItem(Event $event): string /** * @return array * - * @psalm-return array{ + * @phpstan-return array{ * span_id: string, * trace_id: string, * parent_span_id?: string, @@ -143,9 +143,9 @@ public static function toEnvelopeItem(Event $event): string * status?: string, * description?: string, * op?: string, + * origin: string, * data?: array, * tags?: array - * _metrics_summary?: array * } */ protected static function serializeSpan(Span $span): array diff --git a/src/Serializer/Traits/BreadcrumbSeralizerTrait.php b/src/Serializer/Traits/BreadcrumbSeralizerTrait.php index 23e840380a..19dc3503df 100644 --- a/src/Serializer/Traits/BreadcrumbSeralizerTrait.php +++ b/src/Serializer/Traits/BreadcrumbSeralizerTrait.php @@ -14,7 +14,7 @@ trait BreadcrumbSeralizerTrait /** * @return array * - * @psalm-return array{ + * @phpstan-return array{ * type: string, * category: string, * level: string, diff --git a/src/Serializer/Traits/StacktraceFrameSeralizerTrait.php b/src/Serializer/Traits/StacktraceFrameSeralizerTrait.php index 32e777f7bd..97207e8415 100644 --- a/src/Serializer/Traits/StacktraceFrameSeralizerTrait.php +++ b/src/Serializer/Traits/StacktraceFrameSeralizerTrait.php @@ -14,7 +14,7 @@ trait StacktraceFrameSeralizerTrait /** * @return array * - * @psalm-return array{ + * @phpstan-return array{ * filename: string, * lineno: int, * in_app: bool, diff --git a/src/StacktraceBuilder.php b/src/StacktraceBuilder.php index 6360c55601..41d97730e9 100644 --- a/src/StacktraceBuilder.php +++ b/src/StacktraceBuilder.php @@ -11,7 +11,7 @@ * This class builds {@see Stacktrace} objects from an instance of an exception * or from a backtrace. * - * @psalm-import-type StacktraceFrame from FrameBuilder + * @phpstan-import-type StacktraceFrame from FrameBuilder */ final class StacktraceBuilder { @@ -52,7 +52,7 @@ public function buildFromException(\Throwable $exception): Stacktrace * @param string $file The file where the backtrace originated from * @param int $line The line from which the backtrace originated from * - * @psalm-param list $backtrace + * @phpstan-param list $backtrace */ public function buildFromBacktrace(array $backtrace, string $file, int $line): Stacktrace { diff --git a/src/State/HubInterface.php b/src/State/HubInterface.php index 227a8451ed..af5704a65d 100644 --- a/src/State/HubInterface.php +++ b/src/State/HubInterface.php @@ -51,13 +51,13 @@ public function popScope(): bool; * * @param callable $callback The callback to be executed * - * @psalm-template T + * @phpstan-template T * - * @psalm-param callable(Scope): T $callback + * @phpstan-param callable(Scope): T $callback * * @return mixed|void The callback's return value, upon successful execution * - * @psalm-return T + * @phpstan-return T */ public function withScope(callable $callback); @@ -111,11 +111,11 @@ public function captureCheckIn(string $slug, CheckInStatus $status, $duration = * * @param string $className The FQCN of the integration * - * @psalm-template T of IntegrationInterface + * @phpstan-template T of IntegrationInterface * - * @psalm-param class-string $className + * @phpstan-param class-string $className * - * @psalm-return T|null + * @phpstan-return T|null */ public function getIntegration(string $className): ?IntegrationInterface; diff --git a/src/State/Scope.php b/src/State/Scope.php index 7d3736c421..6edaddf147 100644 --- a/src/State/Scope.php +++ b/src/State/Scope.php @@ -78,7 +78,7 @@ class Scope /** * @var callable[] List of event processors * - * @psalm-var array + * @phpstan-var array */ private $eventProcessors = []; @@ -90,7 +90,7 @@ class Scope /** * @var callable[] List of event processors * - * @psalm-var array + * @phpstan-var array */ private static $globalEventProcessors = []; diff --git a/src/Tracing/GuzzleTracingMiddleware.php b/src/Tracing/GuzzleTracingMiddleware.php index ee2ce0f0f6..b4268c0f7e 100644 --- a/src/Tracing/GuzzleTracingMiddleware.php +++ b/src/Tracing/GuzzleTracingMiddleware.php @@ -79,7 +79,6 @@ public static function trace(?HubInterface $hub = null): \Closure $response = null; - /** @psalm-suppress UndefinedClass */ if ($responseOrException instanceof ResponseInterface) { $response = $responseOrException; } elseif ($responseOrException instanceof GuzzleRequestException) { diff --git a/src/Tracing/Span.php b/src/Tracing/Span.php index f450506204..346b53b79c 100644 --- a/src/Tracing/Span.php +++ b/src/Tracing/Span.php @@ -426,7 +426,7 @@ public function setData(array $data) * * @return array * - * @psalm-return array{ + * @phpstan-return array{ * data?: array, * description?: string, * op?: string, diff --git a/src/functions.php b/src/functions.php index f146aa44c8..913778dafd 100644 --- a/src/functions.php +++ b/src/functions.php @@ -204,13 +204,13 @@ function configureScope(callable $callback): void * * @param callable $callback The callback to be executed * - * @psalm-template T + * @phpstan-template T * - * @psalm-param callable(Scope): T $callback + * @phpstan-param callable(Scope): T $callback * * @return mixed|void The callback's return value, upon successful execution * - * @psalm-return T + * @phpstan-return T */ function withScope(callable $callback) { @@ -235,13 +235,13 @@ function endContext(?int $timeout = null): void * @param callable $callback The callback to execute * @param int|null $timeout The maximum number of seconds to wait while flushing the client transport * - * @psalm-template T + * @phpstan-template T * - * @psalm-param callable(): T $callback + * @phpstan-param callable(): T $callback * * @return mixed * - * @psalm-return T + * @phpstan-return T */ function withContext(callable $callback, ?int $timeout = null) { From e2b244b6f3467304ea05e50f86783b42d73091d0 Mon Sep 17 00:00:00 2001 From: Martin Linzmayer Date: Thu, 19 Mar 2026 16:34:51 +0100 Subject: [PATCH 2/2] fix --- src/Integration/ModulesIntegration.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Integration/ModulesIntegration.php b/src/Integration/ModulesIntegration.php index 860d90151b..8148b37782 100644 --- a/src/Integration/ModulesIntegration.php +++ b/src/Integration/ModulesIntegration.php @@ -69,7 +69,10 @@ private static function getInstalledPackages(): array if (class_exists(Versions::class)) { // BC layer for Composer 1, using a transient dependency - return array_keys(Versions::VERSIONS); + /** @var string[] $packages */ + $packages = array_keys(Versions::VERSIONS); + + return $packages; } // this should not happen