https://github.com/struggle-for-php/sfp-psalm-psr-log-plugin
Stubs to let Psalm understand psr/log (Psr-3) strictly
https://github.com/struggle-for-php/sfp-psalm-psr-log-plugin
psalm psr psr-3
Last synced: 5 months ago
JSON representation
Stubs to let Psalm understand psr/log (Psr-3) strictly
- Host: GitHub
- URL: https://github.com/struggle-for-php/sfp-psalm-psr-log-plugin
- Owner: struggle-for-php
- Created: 2019-11-03T03:23:45.000Z (over 6 years ago)
- Default Branch: 0.5.x
- Last Pushed: 2023-03-18T10:23:51.000Z (over 3 years ago)
- Last Synced: 2025-09-05T00:21:47.900Z (10 months ago)
- Topics: psalm, psr, psr-3
- Language: Gherkin
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
sfp-psalm-psr-log-plugin
========================
PSR-3 (psr/log) plugin for [Psalm](https://github.com/vimeo/psalm)
Installation:
```console
$ composer require --dev struggle-for-php/sfp-psalm-psr-log-plugin
$ vendor/bin/psalm-plugin enable struggle-for-php/sfp-psalm-psr-log-plugin
```
## Example
```php
logger->error('error happened.', ['exception' => $e->getMessage()]);
}
}
}
```
would be ERROR output:
```php
ERROR: InvalidArgument - src/Foo.php:14:45 - Argument 2 of Psr\Log\LoggerInterface::error expects array{exception?: Exception}, array{exception: string} provided
$this->logger->error('error happened.', ['exception' => $e->getMessage()]);
```
## Configure
If you want to allow `Throwable` to pass logger context's `exception`.
```xml
1
```