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

Added Factory, see #25 #37

Merged
merged 3 commits into from
May 18, 2018
Merged

Added Factory, see #25 #37

merged 3 commits into from
May 18, 2018

Conversation

hiqsol
Copy link
Member

@hiqsol hiqsol commented Apr 9, 2018

Q A
Is bugfix? no
New feature? yes
Breaks BC? no
Tests pass? yes
Related issues #25, #26

Actually changes are minimal but are shown huge because of renamed file. Done in three commits to allow explore diffs.

Highlights:

  • AbstractContainer
    • protected build($id, $config)
    • protected buildFromDefinition($definition)
    • Factory
      • public create($id, $config) - new instance every time
    • Container implements PSR11
      • private $instances
      • public get($id) - same instance every time

Copy link
Member

@samdark samdark left a comment

Choose a reason for hiding this comment

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

Looks good to me but need docs and readme adjustments.

@samdark samdark requested review from SilverFire and a team April 12, 2018 21:47
@SilverFire
Copy link
Member

Yii::$di->get() and Yii::createObject() methods with old container implementation work as factory. This pull request does not restore the original behavior, but make is theoretically possible. How are we going to keep a sort of behavioral BC with the existing user-side code?

@hiqsol
Copy link
Member Author

hiqsol commented Apr 13, 2018

Please refine what behavior can not be reproduced?

@samdark samdark added type:bug Bug and removed type:bug Bug labels Apr 16, 2018
@SilverFire SilverFire merged commit 469d57e into yiisoft:master May 18, 2018
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