Repository navigation
refactor: split the engine base classes and constants out of WeatherMap.class.php - #344
Merged
Merged
Conversation
Each define() is wrapped in defined() so loading the file after a caller or test has already declared IN/OUT no longer warns. Values, order and the point at which WeatherMap.class.php defines them are unchanged. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
WeatherMapDataSource, WeatherMapPreProcessor, WeatherMapPostProcessor, WeatherMapBase, WeatherMapConfigItem and WeatherMapItem each move to their own lib/*.class.php file with their bodies unchanged. WeatherMap.class.php requires them before WeatherMapNode and WeatherMapLink, which extend WeatherMapItem and previously relied on it being hoisted from the same file. Existing callers keep including WeatherMap.class.php only. The source-scanning ReadData contract tests now read WeatherMapDataSource.class.php, and the syntax smoke list covers the new files. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
The harness declared its own WeatherMapDataSource and IN/OUT, so any later test in the same process that loaded WeatherMap.class.php hit a class redeclaration fatal. It now requires the guarded constants file and the real base class, which are require_once-safe, and the stub is dropped. The real base adds only no-op Register() and Prefetch(). The patch-coverage allowlist note for lib/editor.actions.php no longer cites the collision. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Class and method summaries for the files moved out of WeatherMap.class.php, and a docblock per constant group. Comment-only; kept separate from the move so that commit stays a verbatim copy. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
EngineFileLoadingTest loads each split file in a fresh PHP process: the constants file twice and after a caller-defined IN, each base class on its own, and the datasource base, harness and engine in that order. EngineRenderEndToEndTest reads the published traffic-pulse example from a temp dir, then runs ReadData, DrawMap and MakeHTML and checks the PNG and the imagemap areas for both nodes and the link. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
This was referenced Nov 9, 2026
The standalone-load checks run in child processes, so patch coverage does not see the moved base-class defaults. Exercise them in-process. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
|
Contributor
|
Tested No new failure found from the class split in those checks. The combined batch also passed its PHP suite after correcting the separate test-fixture issues in #348. |
alcatron
approved these changes
Nov 10, 2026
alcatron
left a comment
Contributor
There was a problem hiding this comment.
Rechecked in the combined batch: 648 PHP tests and all 33 browser test files pass, including the engine loading and rendering checks. No further issue found from the class split. Looks good to me.
TheWitness
approved these changes
Nov 11, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Fixes #342
Move the global constants into lib/WeatherMap.constants.php, where every define is guarded, and move each base class into its own lib file: WeatherMapDataSource, PreProcessor, PostProcessor, Base, ConfigItem and Item. WeatherMap.class.php still requires them all, so existing callers are unchanged.
#345 is stacked on this PR, so merge this one first.