Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.x] Fixes switch cases namespace resolution #80

Merged
merged 25 commits into from
Nov 8, 2023

Conversation

nunomaduro
Copy link
Member

@nunomaduro nunomaduro commented Nov 7, 2023

This pull request fixes #78, witch is related to the usage of switch cases cases combined with namespace resolution.

So, prior to this pull request, the following scenario was not possible:

use Laravel\Scout\Searchable;

Route::get('show', function (User|Product $model) {
    switch(true) {
        $user instanceof Searchable: // bug here, because Searchable was not converted to $user instanceof \Laravel\Scout\Searchable;
            return view('search-view');
    return view('regular');
});

@nunomaduro nunomaduro marked this pull request as ready for review November 8, 2023 11:09
@taylorotwell taylorotwell merged commit 3dbf8a8 into master Nov 8, 2023
9 checks passed
@taylorotwell taylorotwell deleted the fix/switch-statments-cases branch November 8, 2023 14:15
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.

Syntax errors caused by namespace resolution
3 participants