Skip to content

Commit

Permalink
Merge pull request #349 from michalkleiner/bugfix/348
Browse files Browse the repository at this point in the history
FIX Reset class from the actual SearchVariant instance to respect Injector
  • Loading branch information
GuySartorelli committed May 10, 2023
2 parents 6fe2143 + 831438f commit 776c99b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Search/Variants/SearchVariant.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public static function variants($class = null, $includeSubclasses = true)
$ref = new ReflectionClass($variantclass);
if ($ref->isInstantiable()) {
$variant = singleton($variantclass);
// reassign actual class since Injector could be involved when creating the singleton
$variantclass = get_class($variant);

if ($variant->appliesToEnvironment()) {
$concrete[$variantclass] = $variant;
}
Expand Down

0 comments on commit 776c99b

Please sign in to comment.