Skip to content
Draft
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: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,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: Set phpunit/phpunit version constraint
run: composer require phpunit/phpunit:'${{ matrix.php.phpunit }}' --dev --no-interaction --no-update
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,3 @@ jobs:

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

psalm:
name: Psalm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5

- 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
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
"phpbench/phpbench": "^1.0",
"phpstan/phpstan": "^1.3",
"phpunit/phpunit": "^8.5|^9.6",
"symfony/phpunit-bridge": "^5.2|^6.0|^7.0",
"vimeo/psalm": "^4.17"
"symfony/phpunit-bridge": "^5.2|^6.0|^7.0"
},
"suggest": {
"monolog/monolog": "Allow sending log messages to Sentry by using the included Monolog handler."
Expand All @@ -64,14 +63,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
Expand Down
10 changes: 0 additions & 10 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,6 @@ parameters:
count: 1
path: src/Serializer/AbstractSerializer.php

-
message: "#^Call to method getResponse\\(\\) on an unknown class GuzzleHttp\\\\Exception\\\\RequestException\\.$#"
count: 1
path: src/Tracing/GuzzleTracingMiddleware.php

-
message: "#^Class GuzzleHttp\\\\Exception\\\\RequestException not found\\.$#"
count: 1
path: src/Tracing/GuzzleTracingMiddleware.php

-
message: "#^Property Sentry\\\\Tracing\\\\PropagationContext\\:\\:\\$parentSampled is never read, only written\\.$#"
count: 1
Expand Down
100 changes: 0 additions & 100 deletions psalm-baseline.xml

This file was deleted.

75 changes: 0 additions & 75 deletions psalm.xml.dist

This file was deleted.

2 changes: 1 addition & 1 deletion src/Breadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Client implements ClientInterface
/**
* @var array<string, IntegrationInterface> The stack of integrations
*
* @psalm-var array<class-string<IntegrationInterface>, IntegrationInterface>
* @phpstan-var array<class-string<IntegrationInterface>, IntegrationInterface>
*/
private $integrations;

Expand Down Expand Up @@ -221,11 +221,11 @@ public function captureLastError(?Scope $scope = null, ?EventHint $hint = null):
/**
* {@inheritdoc}
*
* @psalm-template T of IntegrationInterface
* @template T of IntegrationInterface
*/
public function getIntegration(string $className): ?IntegrationInterface
{
/** @psalm-var T|null */
/** @phpstan-var T|null */
return $this->integrations[$className] ?? null;
}

Expand Down
6 changes: 3 additions & 3 deletions src/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
* @template T of IntegrationInterface
*
* @psalm-param class-string<T> $className
* @phpstan-param class-string<T> $className
*
* @psalm-return T|null
* @phpstan-return T|null
*/
public function getIntegration(string $className): ?IntegrationInterface;

Expand Down
18 changes: 9 additions & 9 deletions src/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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 = [];

Expand All @@ -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;

Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand Down Expand Up @@ -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<StacktraceFrame> $backtrace
* @phpstan-param list<StacktraceFrame> $backtrace
*
* @return array<int, mixed>
*/
Expand Down
6 changes: 3 additions & 3 deletions src/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -852,13 +852,13 @@ public function setSdkMetadata(string $name, $data): self
/**
* Gets the SDK metadata.
*
* @psalm-template T of string|null
* @template T of string|null
*
* @psalm-param T $name
* @phpstan-param T $name
*
* @return mixed
*
* @psalm-return (T is string ? mixed : array<string, mixed>|null)
* @phpstan-return (T is string ? mixed : array<string, mixed>|null)
*/
public function getSdkMetadata(?string $name = null)
{
Expand Down
Loading