Skip to content

Add back NotFoundException for BC #69

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 4, 2016
Merged

Add back NotFoundException for BC #69

merged 6 commits into from
Jul 4, 2016

Conversation

sagikazarmark
Copy link
Member

@sagikazarmark sagikazarmark commented Jul 3, 2016

As per the discussion here: #62 (comment)


namespace Http\Discovery;

@trigger_error('The '.__NAMESPACE__.'\NotFoundException class is deprecated since version 1.0 and will be removed in 2.0. Use Http\Discovery\Exception\NotFoundException instead.', E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

Do we need the NAMESPACE constant here?

Copy link
Contributor

Choose a reason for hiding this comment

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

i think as long as we ourselves throw the old exception, we can't trigger a warning.

RE: namespace or not: does not matter imo. writing the actual namespace seems more straightforward though

Copy link
Member Author

Choose a reason for hiding this comment

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

I took this namespace thing from symfony. Since the namespace declaration is just above the warning, I think we are allowed to make it shorter in the code. The message itself is what's important after all.

But you are right, maybe we shouldn't throw this as long as we actually throw this exception.

@Nyholm
Copy link
Member

Nyholm commented Jul 3, 2016

👍 Good, I had just one minor question.

* @author Márk Sági-Kazár <[email protected]>
*/
final class NotFoundException extends \RuntimeException
/*final */class NotFoundException extends \RuntimeException
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe add "(do not extend this class, it is only not final for BC reasons)"

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't this what the @final phpdoc is for?

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't this what the @final phpdoc is for?

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, makes sense. maybe add that comment after the @final then?i think explanations always are a good thing.

Copy link
Member Author

@sagikazarmark sagikazarmark Jul 4, 2016

Choose a reason for hiding this comment

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

done

@dbu
Copy link
Contributor

dbu commented Jul 4, 2016

looks good to me. squash and merge?

@sagikazarmark
Copy link
Member Author

Yup, but rebase first.

@sagikazarmark sagikazarmark merged commit d3667df into master Jul 4, 2016
@sagikazarmark sagikazarmark deleted the exception_bc branch July 4, 2016 07:46
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.

3 participants