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

Parameters name binding #352

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Parameters name binding #352

wants to merge 6 commits into from

Conversation

xepozz
Copy link
Member

@xepozz xepozz commented Feb 13, 2024

Q A
Is bugfix?
New feature? ✔️
Breaks BC?
Fixed issues comma-separated list of tickets # fixed by the PR, if any
Related PR yiisoft/definitions#87

Copy link

what-the-diff bot commented Feb 13, 2024

PR Summary

  • Introduction of a new dependency
    Our composer.json file has been updated to introduce a new package "yiisoft/definitions": "dev-parameter-name-binding". This update aids in the proper maintenance and documentation of numerous packages used in our software.

  • Addition of a new file for testing
    A new supporting file called ArgumentNameBinding.php has been added in the tests/Support directory. This addition will facilitate specific testing procedures within our platform.

  • Improvements to an existing test file
    Changes have been made to the ContainerTest.php file to create a new test known as testArgumentNameBinding(). This new test will enable us to verify the functionality of the argument name binding feature in our system. This feature binds/links arguments to their expected types, ensuring that the operations of our programs are being performed accurately.
    Through this test, we're making sure that specific definitions relating to our software's engine are properly assigned with the expected types for seamless execution. In other words, it is now possible to verify that the correct types of inputs are assigned to specific parts of our engine, ensuring accurate and efficient performance.

@xepozz xepozz linked an issue Feb 13, 2024 that may be closed by this pull request
@xepozz xepozz mentioned this pull request Feb 13, 2024
@samdark
Copy link
Member

samdark commented Feb 14, 2024

Need docs.

Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (aeb0856) to head (6f397c5).

Additional details and impacted files
@@             Coverage Diff             @@
##              master      #352   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity       161       161           
===========================================
  Files             11        11           
  Lines            466       466           
===========================================
  Hits             466       466           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -341,6 +341,41 @@ $config = ContainerConfig::create()
$container = new Container($config);
```

## Name binding

Name binding is a way to bind a name to a definition. It is used to resolve a definition not by its class name but by a name.
Copy link
Member

Choose a reason for hiding this comment

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

Parameter name? Just a "name" is vague in this context.


Name binding is a way to bind a name to a definition. It is used to resolve a definition not by its class name but by a name.

Set a definitions with a specific name. It may be typed or untyped reference like:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Set a definitions with a specific name. It may be typed or untyped reference like:
Set definitions with a specific name. It may be typed or untyped reference like:

]
```

So now you can resolve a definition by its name:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
So now you can resolve a definition by its name:
So now you can resolve a definition by parameter name:

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.

Dynamic bindings
2 participants