-
Notifications
You must be signed in to change notification settings - Fork 134
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
#139 - use your own regex pattern #160
Conversation
0732789
to
92455be
Compare
README.md
Outdated
@@ -420,9 +420,11 @@ layers: | |||
collectors: | |||
- type: className | |||
regex: .*Controller.* | |||
predefined_delimiter: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a hint, that default is true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a better solution: have a classNameRegex
type that takes a plain regex as argument (no fiddling with the regex besides validating it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the patch solves the issue, but complicates an already complex matcher.
I'd first look at having completely alternative matchers (specialised) rather than even more configurable ones.
README.md
Outdated
@@ -420,9 +420,11 @@ layers: | |||
collectors: | |||
- type: className |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something unrelated that I just noticed: this could simply be the class FQN, and then customising all this stuff would be a breeze.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opened an issue #164
README.md
Outdated
``` | ||
|
||
Every classname that matches the regular expression `.*Controller.*` becomes a part of the *controller* layer. | ||
Every class name that matches the regular expression `.*Controller.*` becomes a part of the *controller* layer. | ||
Set `predefined_delimiter` to `false` to use your own delimiters and/or modifiers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires a practical example of how the generated regex looks like before/after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
README.md
Outdated
@@ -420,9 +420,11 @@ layers: | |||
collectors: | |||
- type: className | |||
regex: .*Controller.* | |||
predefined_delimiter: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a better solution: have a classNameRegex
type that takes a plain regex as argument (no fiddling with the regex besides validating it)
@@ -11,10 +11,12 @@ | |||
|
|||
class ClassNameCollectorTest extends TestCase | |||
{ | |||
public function dataProviderStatisfy() | |||
public function dataProviderSatisfy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of denglish here: satisfiedRegexDataProvider
maybe?
*/ | ||
public function testStatisfy($configuration, $className, $expected) | ||
public function testSatisfy(array $configuration, string $className, bool $expected) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zame here about denglish: something wrong about the naming of this method
ad61b47
to
047c796
Compare
@Ocramius I have updated this PR. I will fix the language issues in a follow-up PR :) |
fixes #139