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

Factor directory iterator as a trait #54

Merged
merged 4 commits into from
Jul 31, 2018

Conversation

drzraf
Copy link

@drzraf drzraf commented Jul 24, 2018

Factor directory iterator as a trait so that other extractor can rely on it and make extension generic so that test (<extension> === 'php') can be overridden if needed.

… on it.

and make extension generic so that test (<extension> === 'php') can be overriden if needed.
@drzraf drzraf changed the title Factor directory iterator as a trait so that other extractor can rely… Factor directory iterator as a trait Jul 24, 2018
@swissspidy
Copy link
Member

That would need the same change for the JS extractor to make things DRY.

private static $dir = '';

/**
* {@inheritdoc}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use the docs from the ExtractorInterface here as there's nothing to inherit from otherwise.

Plus, we could describe the possible options a bit better. Perhaps the way WordPress core does it: https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#1-1-parameters-that-are-arrays

*
* @param string $dir Root path to start the recursive traversal in.
* @param Translations $translations The translations instance to append the new translations.
* @param array $options
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted above, we could describe the possible options a bit better. Perhaps the way WordPress core does it: https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#1-1-parameters-that-are-arrays

@swissspidy swissspidy requested a review from schlessera July 28, 2018 12:08
@schlessera schlessera added this to the 0.1.0 milestone Jul 31, 2018
@schlessera schlessera merged commit f9e94e8 into wp-cli:master Jul 31, 2018
@schlessera
Copy link
Member

Thanks for the pull-request, @drzraf !

schlessera added a commit that referenced this pull request Jan 6, 2022
Factor directory iterator as a trait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants