Skip to content

fix: ensure theme codes are indexed correctly in commands#149

Merged
dermatz merged 1 commit intomainfrom
fix-search-input-type
Mar 12, 2026
Merged

fix: ensure theme codes are indexed correctly in commands#149
dermatz merged 1 commit intomainfrom
fix-search-input-type

Conversation

@dermatz
Copy link
Collaborator

@dermatz dermatz commented Mar 12, 2026

This pull request makes a small but important adjustment to how theme codes are collected and indexed in several theme-related console commands. The change ensures that the arrays of theme codes always have sequential numeric indexes, which can prevent potential issues with array handling in downstream logic.

The main change is:

  • Standardized the creation of the $options array in BuildCommand.php, CleanCommand.php, and TokensCommand.php by wrapping the array_map call with array_values, ensuring that theme code arrays use zero-based sequential indexes. [1] [2] [3]

@dermatz dermatz marked this pull request as ready for review March 12, 2026 14:43
Copilot AI review requested due to automatic review settings March 12, 2026 14:43
@dermatz dermatz enabled auto-merge (squash) March 12, 2026 14:43
Copy link
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 fixes potential array indexing issues in theme-related console commands by ensuring theme code arrays always have sequential numeric indexes when passed to Laravel Prompts search components.

Changes:

  • Wrapped array_map calls with array_values in BuildCommand, CleanCommand, and TokensCommand to guarantee zero-based sequential indexes for the $options array used in interactive search prompts.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Console/Command/Theme/BuildCommand.php Added array_values() wrap around theme code mapping for MultiSearchPrompt options
src/Console/Command/Theme/CleanCommand.php Added array_values() wrap around theme code mapping for MultiSearchPrompt options
src/Console/Command/Theme/TokensCommand.php Added array_values() wrap around theme code mapping for SearchPrompt options

@dermatz dermatz disabled auto-merge March 12, 2026 14:48
@dermatz dermatz merged commit f9175a7 into main Mar 12, 2026
15 checks passed
@dermatz dermatz deleted the fix-search-input-type branch March 12, 2026 14:48
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