Fix: Remove \Hazaar\Map
Problem Statement
The \Hazaar\Map
class in the Hazaar MVC framework is an outdated piece of code that was originally designed to handle features that are now natively supported in PHP 8. Its presence is causing issues with Xdebug, leading to segmentation faults during debugging. This makes it problematic for developers who rely on Xdebug for troubleshooting and debugging.
Who will benefit?
- Developers using Hazaar MVC who encounter Xdebug segmentation faults caused by the
\Hazaar\Map
class. - Developers maintaining the framework by reducing technical debt and ensuring compatibility with modern PHP features.
Benefits and risks
Benefits
- Eliminates Xdebug-related segmentation faults, improving the debugging experience.
- Removes obsolete code, simplifying the framework and reducing maintenance overhead.
- Improves compatibility with PHP 8, leveraging its native features for better performance and reliability.
Risks
- Potentially impacts any existing code that depends on
\Hazaar\Map
or indirectly relies on its behavior. - Refactoring dependent components (e.g.,
\Hazaar\Application\Config
) may introduce bugs if not thoroughly tested.
Proposed solution
Remove the \Hazaar\Map
class from the Hazaar MVC framework entirely. Refactor \Hazaar\Application\Config
and any other dependent components to use PHP 8 native features instead of relying on the \Hazaar\Map
class. Conduct thorough testing to ensure no unintended consequences occur due to this removal.
Examples
- Refactoring configuration handling to use PHP's built-in array handling or other native structures.
- Adopting modern PHP 8 features such as union types, named arguments, or improved array functions for handling configurations.
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)