Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix @throws DocBlock about LogicException#29699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@gido
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#...
LicenseMIT
Doc PRsymfony/symfony-docs#...

This is a follow-up of#28536.\RuntimeException were replaced by\LogicException but the DocBlock documentation wasn't updated accordingly.

When working on it, I found some inconsistency: In some component the exception raised is from the SPL (\LogicException) and in other the exception is from the component itself (when theLogicException exist). What is the policy in this case ?

@ogizanagi
Copy link
Contributor

Well, logic exceptions aren't even supposed to be documented actually. It makes no sense as it represents a broken code path (either a misconfiguration or developer mistake) and should never be caught.
When it occurs, the exception message should be explicit enough. I'm not sure documenting it in the docblock is of any interest.

unkind reacted with thumbs up emoji

/**
* Create a new Transport Serializer.
*
* @return self
Copy link
Member

Choose a reason for hiding this comment

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

We tend to avoid adding docs that do not add any additional information (here everything is in the method signature). The same goes for the description above.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Make sense, done.

@chalasr
Copy link
Member

I agree with@ogizanagi, such exceptions are thrown to provide a meaningful error instead of a fatal one (class not found). Documenting them would not bring any value. 👎 for me

@fabpot
Copy link
Member

Closing as 2 member of the core voted against this PR.

@fabpotfabpot closed thisJan 1, 2019
@gido
Copy link
ContributorAuthor

gido commentedJan 1, 2019

I understand the point about non documenting LogicException in this case.

But the current DocBlock is still wrong (mentions of RuntimeException). Would you accept a PR that remove them?

ogizanagi reacted with thumbs up emoji

@fabpot
Copy link
Member

Yes, removing docblocks is always great!

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

Reviewers

@fabpotfabpotfabpot left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@gido@ogizanagi@chalasr@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp