You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhanced directory check for class types
Instead of using a "switch" statement, which is a control flow statement, to handle the different types of classes we have, we improved it by creating a specialized directory for each class type. We use a function 'is_dir()' to verify if a specified directory for a class type exists.
Logic addition to ascertain existence of specialized directory
We added a decision-making process to verify if a specialized directory is already available for the class type at hand. This is done to manage folders in an organized way. Our code now adjusts the $structure array based on whether or not the directory exists.
Simplified class type handling by removing the default case
The default action in the "switch" statement, which assumed responsibility when none of the specified cases matched, has been removed. This is an intentional decision to make the management of class types more straightforward. We're streamlining the process, avoiding unnecessary pathways in the code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
Replace hardcoded switch statement with automatic directory detection, allowing new class types to be added without modifying the autoloader code.
How to test the Change
All classes still load via autoloader without fatal error.
Changelog Entry
Credits
Props @mauteri
Checklist: