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

Support toProvider, toInstance() bind in multibindings #264

Merged
merged 31 commits into from
Mar 9, 2022

Conversation

koriym
Copy link
Member

@koriym koriym commented Mar 3, 2022

マルチバインディングでのAPI変更

$engineBinder = MultiBinder::newInstance($this, FakeEngineInterface::class);
$engineBinder->addBinding('one')->to(FakeEngine::class);
$engineBinder->addBinding()->to(FakeEngine3::class);

$robotBinder = MultiBinder::newInstance($this, FakeRobotInterface::class);
$robotBinder->addBinding()->to(FakeRobot::class);
$robotBinder->addBinding()->toProvider(FakeRobotProvider::class);
$robotBinder->addBinding()->toInstance(new FakeRobot());

@codecov
Copy link

codecov bot commented Mar 3, 2022

Codecov Report

Merging #264 (867d223) into 2.x (ae2cb52) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 867d223 differs from pull request most recent head e985a38. Consider uploading reports for the commit e985a38 to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##                 2.x      #264   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       341       357   +16     
===========================================
  Files             46        49    +3     
  Lines            888       937   +49     
===========================================
+ Hits             888       937   +49     
Impacted Files Coverage Δ
src/di/Di/Set.php 100.00% <ø> (ø)
src/di/MultiBinding/LazyTo.php 100.00% <ø> (ø)
src/di/MultiBinding/Map.php 100.00% <ø> (ø)
src/di/Container.php 100.00% <100.00%> (ø)
src/di/ContainerFactory.php 100.00% <100.00%> (ø)
src/di/Injector.php 100.00% <100.00%> (ø)
src/di/MultiBinder.php 100.00% <100.00%> (ø)
src/di/MultiBinding/LazyInstance.php 100.00% <100.00%> (ø)
src/di/MultiBinding/LazyProvider.php 100.00% <100.00%> (ø)
src/di/MultiBinding/MapProvider.php 100.00% <100.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae2cb52...e985a38. Read the comment docs.

@koriym koriym changed the title More multibindings Support toProvider, toInstance() bind in multibindings Mar 3, 2022
@koriym koriym marked this pull request as ready for review March 3, 2022 14:29
composer.json Outdated
"ray/aop": "^2.10"
},
"require-dev": {
"ext-pdo": "*",
"phpunit/phpunit": "^9.5.10",
"phpunit/phpunit": "^8.5.23",
Copy link
Member

Choose a reason for hiding this comment

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

8系はPHP 8 のカバレッジが取れないみたいです。

https://github.com/ray-di/Ray.Di/runs/5456812078?check_suite_focus=true

Error: This version of PHPUnit does not support code coverage on PHP 8

Copy link
Member Author

Choose a reason for hiding this comment

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

そうでしたね。9にするとPHP 7.2がサポートされずでどうしましょうかね。

Copy link
Member Author

Choose a reason for hiding this comment

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

というか、7.2をサポートできてないのにcomposer.jsonの表記が間違ってます><

Copy link
Member Author

Choose a reason for hiding this comment

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

@NaokiTsuchiya PHP 7.2をサポートしました。Auraと同じくRay.*はPHP 7.2+、BEARはポリシー通り7.4+にします。

@sonarcloud
Copy link

sonarcloud bot commented Mar 9, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@koriym koriym merged commit acdcc2e into ray-di:2.x Mar 9, 2022
@koriym koriym deleted the more_multibindings branch March 9, 2022 10:03
@koriym
Copy link
Member Author

koriym commented Mar 9, 2022

@NaokiTsuchiya Thanks for the review! (should be hard)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants