Skip to content

Add strict types to Specialty System#43

Merged
NB-Core merged 1 commit into
masterfrom
codex/add-strict-types-and-type-hints-to-php-files
Jul 15, 2025
Merged

Add strict types to Specialty System#43
NB-Core merged 1 commit into
masterfrom
codex/add-strict-types-and-type-hints-to-php-files

Conversation

@NB-Core
Copy link
Copy Markdown
Owner

@NB-Core NB-Core commented Jul 15, 2025

Summary

  • enable strict typing in specialty system modules
  • add typed parameters and return types
  • document all functions with docblocks

Testing

  • php -l systems/specialtysystem/specialtysystem_wind.php
  • php -l systems/specialtysystem/specialtysystem/functions.php
  • php -l systems/specialtysystem/specialtysystem/datafunctions.php
  • php -l systems/specialtysystem/specialtysystem/register.php
  • php -l systems/specialtysystem/specialtysystem/uninstall.php
  • php -l systems/specialtysystem/specialtysystem_water.php
  • php -l systems/specialtysystem/specialtysystem_sand.php
  • php -l systems/specialtysystem/specialtysystem_medical.php
  • php -l systems/specialtysystem/specialtysystem.php
  • php -l systems/specialtysystem/specialtysystem_fire.php
  • php -l systems/specialtysystem/specialtysystem_lightning.php
  • php -l systems/specialtysystem/specialtysystem_ice.php
  • php -l systems/specialtysystem/specialtysystem_basic.php
  • php -l systems/specialtysystem/specialtysystem_genjutsu.php
  • php -l systems/specialtysystem/specialtysystem_earth.php

https://chatgpt.com/codex/tasks/task_e_68767274371c832984104e297552b20d

@NB-Core NB-Core requested a review from Copilot July 15, 2025 17:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

@NB-Core NB-Core merged commit 7b43b25 into master Jul 15, 2025
@NB-Core NB-Core deleted the codex/add-strict-types-and-type-hints-to-php-files branch July 15, 2025 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants