Skip to content
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

[ContainerBuilder] getDefinitionByType() method added #137

Merged
merged 1 commit into from Jan 7, 2017

Conversation

@TomasVotruba
Copy link
Contributor

TomasVotruba commented Jan 4, 2017

  • bug fix? no #130
  • new feature? yes
  • BC break? no

All is described in the issue: #130

Behavior is compatible with with getDefiniton() - exception is thrown when not found.
This method is called in cases where Definition is required.

@TomasVotruba

This comment has been minimized.

Copy link
Contributor Author

TomasVotruba commented Jan 7, 2017

Ping @dg

@TomasVotruba

This comment has been minimized.

Copy link
Contributor Author

TomasVotruba commented Jan 7, 2017

What needs to be done here?

@dg

This comment has been minimized.

Copy link
Member

dg commented Jan 7, 2017

Can it return NULL?

@TomasVotruba

This comment has been minimized.

Copy link
Contributor Author

TomasVotruba commented Jan 7, 2017

Well, that was my first idea. But having getDefiniton() throwing exception and getDefinitonByType() giving NULL seems inconsistent.

What do you think?

@dg

This comment has been minimized.

Copy link
Member

dg commented Jan 7, 2017

So annotation @return should be fixed.

@TomasVotruba

This comment has been minimized.

Copy link
Contributor Author

TomasVotruba commented Jan 7, 2017

I see. That is leftover from 1st idea.

Fixed!

@dg

This comment has been minimized.

Copy link
Member

dg commented Jan 7, 2017

Great, thanks!

@dg dg merged commit 5ea207b into nette:master Jan 7, 2017
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
coverage/coveralls Coverage increased (+0.02%) to 90.476%
Details
@TomasVotruba

This comment has been minimized.

Copy link
Contributor Author

TomasVotruba commented Jan 7, 2017

Awesome, thanks a lot!

@TomasVotruba

This comment has been minimized.

Copy link
Contributor Author

TomasVotruba commented Jan 28, 2017

For others, here are all use cases I used it in:

Symplify/Symplify@1e8854c

Requires nette\di 2.4.6+

* Gets the service definition of the specified type.
* @param string
* @return ServiceDefinition|NULL
*/

This comment has been minimized.

Copy link
@dg

dg May 2, 2017

Member

Can it return NULL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.