Deprecate: ake()
Problem Statement
The ake()
helper function in the Hazaar framework is now redundant due to the introduction of the null coalescing operator in PHP. Additionally, ake()
currently provides dot-notation access for arrays—a useful feature that should be retained but separated into its own dedicated function. To modernize the framework and promote clarity, we propose deprecating ake()
and moving its dot-notation access functionality into a new function called array_get()
.
Who will benefit?
- Developers using Hazaar who will benefit from a cleaner, more modern codebase.
- Teams aiming to reduce maintenance overhead by leveraging native PHP features.
- Users who need robust dot-notation access for arrays through a dedicated and well-documented function.
Benefits and risks
Benefits
- Removes redundant functionality by replacing
ake()
with a native PHP feature for null coalescing. - Retains useful dot-notation access by introducing a dedicated
array_get()
function. - Improves code clarity and maintainability by separating concerns into distinct functions.
- Encourages developers to adopt best practices and use the updated API.
Risks
- Existing codebases relying on
ake()
may require minor refactoring. - Transitioning to the new
array_get()
function might introduce a short-term learning curve for developers. - Careful documentation and migration support are necessary to mitigate disruption.
Proposed solution
- Deprecate the
ake()
function in the next release of Hazaar, with clear documentation and deprecation warnings. - Implement a new function
array_get()
that encapsulates the dot-notation access functionality formerly provided byake()
. - Update the framework documentation to reflect these changes, instructing developers on the migration path from
ake()
toarray_get()
. - Log warnings when
ake()
is used, guiding users to adoptarray_get()
and PHP's null coalescing operator where appropriate. - Plan for the complete removal of
ake()
in a future major release after an adequate deprecation period.
Priority/Severity
-
High (This will bring a huge increase in performance/productivity/usability/legislative cover) -
Medium (This will bring a good increase in performance/productivity/usability) -
Low (anything else e.g., trivial, minor improvements)