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

Request: Pass wildcard characters when generating model docs #41

Closed
abishekrsrikaanth opened this issue Nov 6, 2013 · 7 comments
Closed

Comments

@abishekrsrikaanth
Copy link

Hi Barry,

This is a request for a good to have feature, not sure how easy or difficult this is to implement. Is it possible to have wildcard characters when generating model docs

For example:

php artisan ide-helper:models User*

which will look for all the Models that starts with User and generate the docs for all of them

or

php artisan ide-helper:models %User

which will look for all the Models ending with User and generate the docs for all of them

or

php artisan ide-helper:models %User%

which will look for all the Models containing the characters User and generate the docs for all of them

@abishekrsrikaanth
Copy link
Author

@barryvdh any luck looking into this?

@barryvdh
Copy link
Owner

Yeah it is on my list but pretty busy.
Op 12 nov. 2013 06:05 schreef "Abishek R Srikaanth" <
[email protected]>:

@barryvdh https://github.com/barryvdh any luck looking into this?


Reply to this email directly or view it on GitHubhttps://github.com//issues/41#issuecomment-28268560
.

@abishekrsrikaanth
Copy link
Author

OK, np. I will look forward to this.

@barryvdh
Copy link
Owner

You are free to create a PR if you want off course.

@bytestream
Copy link

@barryvdh not sure that this is quite the same request, but I could do with the ability to either exclude directories similar to #135 or the ability to wildcard directories

Something simple like this might work?

$models = array();
foreach ($this->dirs as $dir) {
    foreach(glob((base_path() . '/' . $dir), GLOB_ONLYDIR) as $dir) {
        foreach (ClassMapGenerator::createMap($dir) as $model => $path) {
            $models[] = $model;
        }
    }
}

I say simple, because that allows you to only wildcard single subdirectories. You couldn't use ** any number of subdirectories. But there is this: https://gist.github.com/funkjedi/3feee27d873ae2297b8e2370a7082aad

Thoughts?

@mfn
Copy link
Collaborator

mfn commented Jun 25, 2020

@abishekrsrikaanth is this still relevant? What's the use-case for generating the phpdoc for only certain models?

I checked the issues (open/closed) and this is the only one suggesting such a feature. It sounds edge-case/y and might not be worth the adding/maintaining.

@bytestream there's a config model_locations and it recently has received support for glob patterns to recursively descent into directories => #921
So I think your use-case is covered.

@mfn
Copy link
Collaborator

mfn commented Jun 25, 2020

Furthermore I just realized the config already has ignored_models so I think it's already possible to achieve everything here anyway.

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

No branches or pull requests

4 participants