Skip to content

🔄 Refactor: standardise service binding patterns in service providers#4577

Open
MrAdder wants to merge 3 commits intoVATSIM-UK:mainfrom
MrAdder:standardise-service-bindings
Open

🔄 Refactor: standardise service binding patterns in service providers#4577
MrAdder wants to merge 3 commits intoVATSIM-UK:mainfrom
MrAdder:standardise-service-bindings

Conversation

@MrAdder
Copy link
Contributor

@MrAdder MrAdder commented Mar 6, 2026

Summary

Standardises service provider binding patterns where safe, while preserving permission security behavior and removing no-op provider boilerplate.

Refs #4550

Changes

  • AppServiceProvider
    • Moved direct class mappings to $bindings / $singletons
    • Kept only the factory-based Discord OAuth binding in register()
  • AuthServiceProvider
    • Kept PermissionRegistrar override in boot() (not moved to $singletons) to avoid package boot-order override risk
    • Removed empty register() override (no-op)

Impact

No intended functional change.
Permission registration behaviour remains explicitly unchanged/safe.

Copilot AI review requested due to automatic review settings March 16, 2026 02:00
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

Standardises Laravel service container registration in core service providers by shifting direct bindings into the framework-supported $bindings / $singletons properties while keeping the Discord OAuth factory binding explicit, and removing no-op provider boilerplate.

Changes:

  • Moved simple container bindings in AppServiceProvider from register() into $bindings and $singletons.
  • Kept the Discord OAuth provider binding as an explicit factory singleton in AppServiceProvider::register().
  • Removed the empty register() method from AuthServiceProvider, leaving the PermissionRegistrar override in boot().

Reviewed changes

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

File Description
app/Providers/AppServiceProvider.php Refactors simple bindings into $bindings/$singletons; keeps Discord OAuth provider factory singleton in register().
app/Providers/AuthServiceProvider.php Removes empty no-op register() method; keeps permission override behavior in boot().

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

You can also share your feedback on Copilot code review. Take the survey.

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.

2 participants