Skip to content

Refactor wizard operations into service#21

Merged
NB-Core merged 1 commit into
tlwizardfrom
codex/refactor-translationwizard-zur-verwendung-von-wizardservice
Jul 13, 2025
Merged

Refactor wizard operations into service#21
NB-Core merged 1 commit into
tlwizardfrom
codex/refactor-translationwizard-zur-verwendung-von-wizardservice

Conversation

@NB-Core
Copy link
Copy Markdown
Owner

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

Summary

  • migrate several wizard actions from PHP includes into WizardService
  • use the new service methods from list.php and main dispatcher
  • remove the old helper PHP files

Testing

  • php -l systems/translationwizard/translationwizard/WizardService.php
  • php -l systems/translationwizard/translationwizard/list.php
  • php -l systems/translationwizard/translationwizard.php

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

@NB-Core NB-Core requested a review from Copilot July 13, 2025 20:05
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 refactors several procedural wizard operations into the new WizardService class and removes the old helper PHP files.

  • Migrated delete, insert, and view-toggle logic into WizardService methods
  • Updated list.php and main dispatcher to call service methods instead of includes
  • Removed outdated switchview.php, deleteempty.php, deletechecked.php, and insert_central.php files

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
systems/translationwizard/translationwizard/switchview.php Removed; replaced by WizardService::toggleView
systems/translationwizard/translationwizard/list.php Updated delete-checked handler to use WizardService::deleteCheckedRows
systems/translationwizard/translationwizard/insert_central.php Removed; logic moved to WizardService::insertCentral
systems/translationwizard/translationwizard/deleteempty.php Removed; logic moved to WizardService::deleteEmpty
systems/translationwizard/translationwizard/deletechecked.php Removed; logic moved to WizardService::deleteCheckedRows
systems/translationwizard/translationwizard/WizardService.php Added service methods: deleteCheckedRows, toggleView, deleteEmpty, insertCentral
systems/translationwizard/translationwizard.php Main dispatcher updated to call new WizardService methods
Comments suppressed due to low confidence (3)

systems/translationwizard/translationwizard/WizardService.php:184

  • No tests accompany the new service methods. Consider adding unit or integration tests for deleteCheckedRows, toggleView, deleteEmpty, and insertCentral to verify behavior.
    public static function deleteCheckedRows(string $language, string $namespace, array $texts): void {

systems/translationwizard/translationwizard/WizardService.php:203

  • [nitpick] The method name deleteEmpty may not clearly convey its purpose. Consider renaming it to deleteRowsWithoutNamespace for clarity.
    public static function toggleView(bool $currentView, string $from): void {

systems/translationwizard/translationwizard/list.php:8

  • WizardService::ensureArray is not defined in WizardService. Implement this helper method or use a cast to array to avoid a fatal error.
                WizardService::ensureArray($transintext)

Comment thread systems/translationwizard/translationwizard/WizardService.php
Comment thread systems/translationwizard/translationwizard/WizardService.php
@NB-Core NB-Core merged commit 204d0c4 into tlwizard Jul 13, 2025
@NB-Core NB-Core deleted the codex/refactor-translationwizard-zur-verwendung-von-wizardservice branch July 13, 2025 20:10
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