Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pulyaevskiy
Copy link
Contributor

Hi,

Sometimes when class implementation changes and container definition is out of date it really gets hard to debug where is the issue. Currently exception message contains this:

The parameter specified by its name could not be found

Also it throws \ReflectionException currently. There is nothing in the stack trace which can help in finding invalid definition as well.

This PR improves this situation by:

  • Adding name of the argument in the exception message
  • Throwing DefinitionException which makes more sense since we actually have invalid container definition.

@mnapoli
Copy link
Member

mnapoli commented Jul 24, 2015

That looks really good thank you!

mnapoli added a commit that referenced this pull request Jul 24, 2015
…efined-parameter

Improve exception message on unknown method argument
@mnapoli mnapoli merged commit cc10862 into PHP-DI:4.x Jul 24, 2015
@mnapoli
Copy link
Member

mnapoli commented Jul 24, 2015

Ah I just realized you made the PR against the 4.x branch, do you want this released as a new 4.x version? I'll port it to the master branch (5.0) anyway.

@pulyaevskiy
Copy link
Contributor Author

@mnapoli thanks!

Yes, we still haven't upgraded to 5.0 so having new version tag in 4.x would be very helpful!

@pulyaevskiy
Copy link
Contributor Author

@mnapoli just checking in here: any ETA on new version tag for 4.x?

@mnapoli
Copy link
Member

mnapoli commented Jul 27, 2015

Done, sorry for the delay :) https://github.com/PHP-DI/PHP-DI/releases/tag/4.4.9

@pulyaevskiy
Copy link
Contributor Author

no worries! Thanks a lot!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants