{"id":44411301,"url":"https://github.com/struggle-for-php/sfp-psalm-psr-log-plugin","last_synced_at":"2026-02-12T07:39:40.464Z","repository":{"id":57060521,"uuid":"219245706","full_name":"struggle-for-php/sfp-psalm-psr-log-plugin","owner":"struggle-for-php","description":"Stubs to let Psalm understand psr/log (Psr-3) strictly","archived":false,"fork":false,"pushed_at":"2023-03-18T10:23:51.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"0.5.x","last_synced_at":"2025-09-05T00:21:47.900Z","etag":null,"topics":["psalm","psr","psr-3"],"latest_commit_sha":null,"homepage":null,"language":"Gherkin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/struggle-for-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-03T03:23:45.000Z","updated_at":"2022-09-14T13:42:07.000Z","dependencies_parsed_at":"2022-08-24T07:30:39.757Z","dependency_job_id":null,"html_url":"https://github.com/struggle-for-php/sfp-psalm-psr-log-plugin","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/struggle-for-php/sfp-psalm-psr-log-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/struggle-for-php%2Fsfp-psalm-psr-log-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/struggle-for-php%2Fsfp-psalm-psr-log-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/struggle-for-php%2Fsfp-psalm-psr-log-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/struggle-for-php%2Fsfp-psalm-psr-log-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/struggle-for-php","download_url":"https://codeload.github.com/struggle-for-php/sfp-psalm-psr-log-plugin/tar.gz/refs/heads/0.5.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/struggle-for-php%2Fsfp-psalm-psr-log-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29361780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["psalm","psr","psr-3"],"created_at":"2026-02-12T07:39:39.668Z","updated_at":"2026-02-12T07:39:40.459Z","avatar_url":"https://github.com/struggle-for-php.png","language":"Gherkin","funding_links":[],"categories":[],"sub_categories":[],"readme":"sfp-psalm-psr-log-plugin\n========================\n\nPSR-3 (psr/log) plugin for [Psalm](https://github.com/vimeo/psalm)\n\nInstallation:\n\n```console\n$ composer require --dev struggle-for-php/sfp-psalm-psr-log-plugin\n$ vendor/bin/psalm-plugin enable struggle-for-php/sfp-psalm-psr-log-plugin\n```\n\n## Example\n\n```php\n\u003c?php\n\nuse Psr\\Log\\LoggerInterface;\n\nclass FooController\n{\n    /** @var LoggerInterface */\n    private $logger;\n\n    public function anyAction()\n    {\n        try {\n            // do something\n        } catch (\\Exception $e) {\n            $this-\u003elogger-\u003eerror('error happened.', ['exception' =\u003e $e-\u003egetMessage()]);\n        }\n    }\n}\n```\n\nwould be ERROR output:\n```php\nERROR: InvalidArgument - src/Foo.php:14:45 - Argument 2 of Psr\\Log\\LoggerInterface::error expects array{exception?: Exception}, array{exception: string} provided\n            $this-\u003elogger-\u003eerror('error happened.', ['exception' =\u003e $e-\u003egetMessage()]);\n```\n\n## Configure\n\nIf you want to allow `Throwable` to pass logger context's `exception`.\n\n```xml\n        \u003cplugins\u003e\n          \u003cpluginClass class=\"Sfp\\Psalm\\PsrLogPlugin\\Plugin\"\u003e\n            \u003cthrowable\u003e1\u003c/throwable\u003e\n          \u003c/pluginClass\u003e\n        \u003c/plugins\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstruggle-for-php%2Fsfp-psalm-psr-log-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstruggle-for-php%2Fsfp-psalm-psr-log-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstruggle-for-php%2Fsfp-psalm-psr-log-plugin/lists"}