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

RouteMatcher config option ignored #745

Closed
1 task done
Floppy012 opened this issue Oct 12, 2023 · 1 comment
Closed
1 task done

RouteMatcher config option ignored #745

Floppy012 opened this issue Oct 12, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Floppy012
Copy link
Contributor

Scribe version

4.25.0

PHP version

8.2.9

Framework

Laravel

Framework version

10.26.2

Scribe config

routeMatcher => "App\\Docs\\CustomRouteMatcher"

What happened?

When generating docs, the custom route matcher is not called. I am using a custom configuration file scribe-v1 with the --config option when generating. Generating itself works fine but its not using my custom route matcher. I've tried to find where that config option is being read but couldn't find anything.

Docs

@Floppy012 Floppy012 added bug Something isn't working triage labels Oct 12, 2023
@shalvah
Copy link
Contributor

shalvah commented Oct 12, 2023

It's used here:

$this->app->bind(RouteMatcherInterface::class, config('scribe.routeMatcher', RouteMatcher::class));

I think it doesn't work because it's looking for scribe (so it doesn't support custom config).

I don't really like that config option anyway. Will probably deprecate it in future. I'm thinking, maybe it's better to just bind your preferred object yourself? Something like:

$this->app->bind(RouteMatcherInterface::class, RouteMatcher::class)

Although you have to ensure it's in a service provider loaded after Scribe's (or use contextual binding: when(GenerateDocumentation)->needs(...)->give(...)).

@shalvah shalvah closed this as completed Oct 12, 2023
@shalvah shalvah removed the triage label Oct 12, 2023
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

No branches or pull requests

2 participants