Skip to content

Add Psalm capability annotations to LoggerInterface - #87

Open
danog wants to merge 1 commit into
php-fig:masterfrom
danog:psalm-capabilities
Open

danog wants to merge 1 commit into
php-fig:masterfrom
danog:psalm-capabilities

Conversation

@danog

@danog danog commented Oct 23, 2026

Copy link
Copy Markdown

Adds a Psalm @psalm-capabilities annotation to the methods of LoggerInterface, which says what an implementation may do. A logger may write files, sockets and buffers, read the request, the process and the clock, and count in static state: every capability but writing the caller's references (write-refs). Without it, Psalm assumes a call may do anything, so code that declares its own capabilities can't log through the interface.

Docblock only, no change to the interface or its behaviour. @psalm-capabilities is a Psalm 7 annotation; other tools ignore it. Psalm ships the same annotation in a stub for this package (vimeo/psalm#12480).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant