Skip to content

[WIP] Update setSpinnerColor for method chaining#98

Merged
SimonBarrettACT merged 1 commit intomainfrom
copilot/update-set-spinner-color-return
Feb 16, 2026
Merged

[WIP] Update setSpinnerColor for method chaining#98
SimonBarrettACT merged 1 commit intomainfrom
copilot/update-set-spinner-color-return

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

  • Update setSpinnerColor in src/Support/Concerns/WithIndicator.php to return static instead of void and add return $this
  • Run code review and security checks
Original prompt

This section details on the original issue you should resolve

<issue_title>Update setSpinnerColor to return $this for method chaining</issue_title>
<issue_description>## Suggestion

To support method chaining and maintain consistency with other methods in the trait (like loadingIndicator), update the setSpinnerColor method so that it returns $this instead of void.

Current Implementation

$this->spinnerColor = $color;
}
public function showOverlay(): bool

The method currently returns void, which breaks method chaining:

public function setSpinnerColor($color): void
{
    $this->spinnerColor = $color;
}

Proposed Change

public function setSpinnerColor($color): static
{
    $this->spinnerColor = $color;
    return $this;
}

Benefits

  • Enables fluent API pattern for method chaining
  • Maintains consistency with the loadingIndicator() method in the same trait
  • Does not break existing code (backward compatible)
  • Allows for more concise configuration:
    $builder->setSpinnerColor('text-green-500')
            ->loadingIndicator(true);
    ```</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link

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.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SimonBarrettACT SimonBarrettACT merged commit 4ac149b into main Feb 16, 2026
2 of 11 checks passed
Copilot stopped work on behalf of SimonBarrettACT due to an error February 16, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update setSpinnerColor to return $this for method chaining

3 participants