Skip to content

Conversation

@Fleshgrinder
Copy link
Contributor

PSR-3 clearly states that the log method MUST throw a Psr\Log\InvalidArgumentException if a level is given that is not known. However, the interface and the various base implementations are missing the corresponding @throws annotation. Consequently IDEs do not know that such an exception could be thrown. This PR is meant to fix this circumstance.

Please note that I refrained from adding any additional documentation to the annotation, simply because everything else is completely undocumented as well.

Copy link
Member

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm 👍 on this but it requires an errata on the PSR

@Fleshgrinder
Copy link
Contributor Author

@Jean85 ping? Otherwise I close this because it's there since ages.

@GrahamCampbell
Copy link
Contributor

It's usual for throws annotations to be before return annotations?

@GrahamCampbell
Copy link
Contributor

@Fleshgrinder
Copy link
Contributor Author

@GrahamCampbell I don't mind, just let me know if I should change it and I change it. 😉

@GrahamCampbell
Copy link
Contributor

Well, it's not up to me, but if it were, I'd change it. ;)

@Jean85
Copy link
Member

Jean85 commented Jun 27, 2019

It's not up to me, but to the editor.

@Jean85 Jean85 requested a review from Seldaek June 27, 2019 11:20
@Seldaek
Copy link
Collaborator

Seldaek commented Jun 27, 2019

I personally don't care much for @throws annotation, and thus care even less if they appear before or after @return ones, sorry :p

Seems fine to me as is tho, if it helps the IDE folks, go for merge I would say.

@Fleshgrinder
Copy link
Contributor Author

@Seldaek ping

@Seldaek Seldaek merged commit fb0003b into php-fig:master Oct 25, 2019
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.

4 participants