Skip to content

Conversation

@uesley
Copy link
Contributor

@uesley uesley commented Feb 27, 2025

it allows laravel service container to use mocked class instead concrete manager

Changes In Code

FeatureGuard is the class that resolve when middleware like feature:my-feature is declared in routes

the parameter $manager in the construct method is for a concrete class. Substituting that for the YlsIdeas\FeatureFlags\Contracts\Features interface allows the service container of laravel to replace with a fake instance when use the fake of facade Features::fake(['my-feature' => true]).

Issue ticket number / Business Case

#70

Checklist before requesting a review

  • I have written PHPUnit tests.
  • I have updated the documentation and opened a pull request within
    the feature flags documentation repo.
  • I have checked code styles, PHPStan etc. pass.
  • I have provided an issue/business case.
  • I have added the enhancement label for a new feature.

it allows laravel service container to use mocked class instead concrete manager
@peterfox peterfox marked this pull request as ready for review March 1, 2025 19:25
@peterfox peterfox self-requested a review as a code owner March 1, 2025 19:25
@peterfox peterfox merged commit 77f6801 into ylsideas:main Mar 1, 2025
14 checks passed
@peterfox peterfox added the bug Something isn't working label Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants