Add strict types to Specialty System#43
Merged
NB-Core merged 1 commit intoJul 15, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enables strict typing and improves documentation for the Specialty System modules, ensuring explicit parameter and return types and adding docblocks to all functions.
- Added
declare(strict_types=1)to all module and helper files - Updated function signatures with typed parameters and return types
- Inserted PHPDoc docblocks for better code clarity and IDE support
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| systems/specialtysystem/specialtysystem_wind.php | Add strict types, typed signatures, and docblocks |
| systems/specialtysystem/specialtysystem_water.php | Add strict types, typed signatures, and docblocks |
| systems/specialtysystem/specialtysystem_sand.php | Add strict types, typed signatures, and docblocks |
| systems/specialtysystem/specialtysystem_medical.php | Add strict types, typed signatures, and docblocks |
| systems/specialtysystem/specialtysystem_lightning.php | Add strict types, typed signatures, and docblocks |
| systems/specialtysystem/specialtysystem_ice.php | Add strict types, typed signatures, and docblocks |
| systems/specialtysystem/specialtysystem_genjutsu.php | Add strict types, typed signatures, and docblocks |
| systems/specialtysystem/specialtysystem_fire.php | Add strict types, typed signatures, and docblocks |
| systems/specialtysystem/specialtysystem_earth.php | Add strict types, typed signatures, and docblocks |
| systems/specialtysystem/specialtysystem_basic.php | Add strict types, typed signatures, and docblocks |
| systems/specialtysystem/specialtysystem/uninstall.php | Add strict types and docblock |
| systems/specialtysystem/specialtysystem/register.php | Add strict types, adjust return usage, and docblock |
| systems/specialtysystem/specialtysystem/functions.php | Add strict types, typed signatures, and docblocks |
| systems/specialtysystem/specialtysystem/datafunctions.php | Add strict types, typed signatures, and docblocks |
| systems/specialtysystem/specialtysystem.php | Add strict types, typed signatures, and docblocks |
Comments suppressed due to low confidence (3)
systems/specialtysystem/specialtysystem/functions.php:130
- The check if (is_array('name')) is always false since 'name' is a string literal. It should likely verify that $specialtycollector is an array, e.g., if (is_array($specialtycollector)) {
/**
systems/specialtysystem/specialtysystem_wind.php:85
- Docblock for specialtysystem_wind_apply is missing a @return void annotation. Please add it to reflect the function's return type.
* @param string $skillname
systems/specialtysystem/specialtysystem/register.php:29
- Function specialtysystem_register no longer returns the result of db_query(), which may break existing callers expecting a boolean return. Consider restoring the return or updating callers and the docblock to reflect a void return.
db_query($sql);
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.
Summary
Testing
php -l systems/specialtysystem/specialtysystem_wind.phpphp -l systems/specialtysystem/specialtysystem/functions.phpphp -l systems/specialtysystem/specialtysystem/datafunctions.phpphp -l systems/specialtysystem/specialtysystem/register.phpphp -l systems/specialtysystem/specialtysystem/uninstall.phpphp -l systems/specialtysystem/specialtysystem_water.phpphp -l systems/specialtysystem/specialtysystem_sand.phpphp -l systems/specialtysystem/specialtysystem_medical.phpphp -l systems/specialtysystem/specialtysystem.phpphp -l systems/specialtysystem/specialtysystem_fire.phpphp -l systems/specialtysystem/specialtysystem_lightning.phpphp -l systems/specialtysystem/specialtysystem_ice.phpphp -l systems/specialtysystem/specialtysystem_basic.phpphp -l systems/specialtysystem/specialtysystem_genjutsu.phpphp -l systems/specialtysystem/specialtysystem_earth.phphttps://chatgpt.com/codex/tasks/task_e_68767274371c832984104e297552b20d