-
Notifications
You must be signed in to change notification settings - Fork 108
Allow using dot separated field names for Identity::get() #766
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
base: 4.x
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request enhances the Identity::get() method to support dot-separated field names for accessing nested data, aligning its functionality with the existing IdentityHelper::get() pattern. The method signature is updated to make the field parameter optional, allowing retrieval of the entire identity data when called without arguments.
Changes:
- Modified
Identity::get()to accept nullable field parameter and useHash::get()for dot notation support - Added
cakephp/utilitypackage as a required dependency for theHashutility class - Added comprehensive test coverage for the new dot notation functionality
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Identity.php | Updated get() method signature to accept optional field parameter and replaced direct array access with Hash::get() for dot notation support |
| tests/TestCase/IdentityTest.php | Added new test method testGet() to verify dot notation functionality with Entity objects |
| composer.json | Added cakephp/utility ^5.0 as a required dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.