Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -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' }}
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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
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 @@ -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;
}

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
* @phpstan-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 @@ -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<string, mixed>|null)
* @phpstan-return (T is string ? mixed : array<string, mixed>|null)
*/
public function getSdkMetadata(?string $name = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/EventHint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading
Loading