Skip to content

[DI] ContainerInterface lacks documentation regarding behavior constants #8759

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

Closed
kiler129 opened this issue Nov 28, 2017 · 7 comments · Fixed by #17903
Closed

[DI] ContainerInterface lacks documentation regarding behavior constants #8759

kiler129 opened this issue Nov 28, 2017 · 7 comments · Fixed by #17903
Labels
actionable Clear and specific issues ready for anyone to take them. DependencyInjection
Milestone

Comments

@kiler129
Copy link
Contributor

kiler129 commented Nov 28, 2017

\Symfony\Component\DependencyInjection\ContainerInterface contains the following constants:

    const EXCEPTION_ON_INVALID_REFERENCE = 1;
    const NULL_ON_INVALID_REFERENCE = 2;
    const IGNORE_ON_INVALID_REFERENCE = 3;
    const IGNORE_ON_UNINITIALIZED_REFERENCE = 4;

The documentation for their usage with get() is nowhere to be found. I tried looking for their usage in the Symfony code, but deciphering what they precisely do (and what's the actual intention of using them) is rather hard.

Maybe we should document that?

@nicolas-grekas
Copy link
Member

For reference, uninitialized refs have been introduced in symfony/symfony#24033
4.1 also introduced \RUNTIME_EXCEPTION_ON_INVALID_REFERENCE = 0` in symfony/symfony#26627

Up for a doc PR @kiler129?

@HeahDude HeahDude added actionable Clear and specific issues ready for anyone to take them. DependencyInjection labels Jul 1, 2018
@HeahDude HeahDude added this to the 2.8 milestone Jul 1, 2018
@HeahDude HeahDude modified the milestones: 2.8, 3.4 Feb 12, 2020
@geek-merlin
Copy link

This is an issue for me when i want to inject an optional service via static constructor injection in Drupal. (Not sure if this is the richt component though, maybe it should be filed against DI component.)

@carsonbot
Copy link
Collaborator

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@carsonbot
Copy link
Collaborator

Friendly reminder that this issue exists. If I don't hear anything I'll close this.

@geek-merlin
Copy link

Yes, this is still an issue.

@carsonbot carsonbot removed the Stalled label Apr 24, 2021
@carsonbot
Copy link
Collaborator

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@geek-merlin
Copy link

Still exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. DependencyInjection
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants