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

Optimize calls for getting child items within the loops #209

Merged
merged 6 commits into from
Dec 6, 2023

Conversation

arogachev
Copy link
Contributor

Q A
Is bugfix?
New feature?
Breaks BC? ✔️

@arogachev arogachev self-assigned this Dec 6, 2023
@arogachev arogachev added the type:enhancement Enhancement label Dec 6, 2023
Copy link

what-the-diff bot commented Dec 6, 2023

PR Summary

  • Enhancements to the procedure of fetching child items within code loops
    The routine for fetching child items has been optimized for better performance, allowing for quicker process execution and efficiency.

  • Introduction of array functionality for ItemsStorageInterface methods
    The methods getAllChildren(), getAllChildRoles(), and getAllChildPermissions() have been improved to accept an array of names, as opposed to just a single name previously. This gives flexibility and enhanced performance when retrieving multiple items.

  • Refactoring code lines in Manager.php
    Here, we have replaced detailed code structures with more concise, readable expressions to improve code maintainability. It makes understanding and maintaining the code simpler, alongside optimizing for better performance.

  • Code upgrades in FakeItemsStorage.php
    In line with the upgrades in ItemsStorageInterface, we also updated the parameters in getAllChildren(), getAllChildRoles(), and getAllChildPermissions() methods to accept an array of names. Furthermore, the internal getAllChildrenInternal() method was introduced to handle multiple name requests more efficiently.

These changes in totality focus on enhancing code performance, readability, and maintainability without altering the product functionality.

Copy link

codecov bot commented Dec 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8b1ef5d) 100.00% compared to head (f37af3a) 100.00%.
Report is 5 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##              master      #209   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity        98       120   +22     
===========================================
  Files             10        11    +1     
  Lines            288       326   +38     
===========================================
+ Hits             288       326   +38     

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

@arogachev arogachev linked an issue Dec 6, 2023 that may be closed by this pull request
@arogachev arogachev merged commit 713fdbf into master Dec 6, 2023
26 of 29 checks passed
@arogachev arogachev deleted the 206-get-children-loops branch December 6, 2023 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize calls for getting child items within the loops
2 participants