Skip to content

Refactor AlphabrowseController to an action.#5277

Open
EreMaijala wants to merge 1 commit into
vufind-org:dev-12.0from
EreMaijala:dev-12.0-refactor-alphabrowsecontroller
Open

Refactor AlphabrowseController to an action.#5277
EreMaijala wants to merge 1 commit into
vufind-org:dev-12.0from
EreMaijala:dev-12.0-refactor-alphabrowsecontroller

Conversation

@EreMaijala
Copy link
Copy Markdown
Contributor

This is a relatively straightforward conversion. I eliminated the need for AlphaBrowseTrait because it didn't add much, and the new call style is easier to follow.

@EreMaijala EreMaijala requested a review from demiankatz May 12, 2026 14:19
@demiankatz demiankatz changed the title Rafactor AlphabrowseController to an action. Refactor AlphabrowseController to an action. May 12, 2026
@demiankatz demiankatz added this to the 12.0 milestone May 12, 2026
@demiankatz demiankatz added the architecture pull requests that involve significant refactoring / architectural changes label May 12, 2026
Copy link
Copy Markdown
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Also haven't had time to look at this extremely closely, but see below for a quick first impression.

protected function applyTopicDelimiters(&$result): void
{
$config = $this->getConfigArray();
$config = $this->config;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe it's cleaner to just use $this->config in line 279 below; this assignment doesn't really seem necessary.

* @return void
*/
protected function applyHighlighting(ViewModel $view, int $rowsBefore): void
protected function applyHighlighting(array &$templateParams, int $rowsBefore): void
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it make sense to have this function return the modified array instead of changing it by reference? I don't have a strong preference, but I try to avoid manipulation by reference when feasible since it can be a little less clear.

(And, of course, same question applies to addResultsToTemplateParams above).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

architecture pull requests that involve significant refactoring / architectural changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants