-
Notifications
You must be signed in to change notification settings - Fork 293
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
Parse default option for translation_domain #65
Parse default option for translation_domain #65
Conversation
} | ||
|
||
// check if options were passed | ||
// FIXME: Maybe we should throw an exception here? Options are required |
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.
Does the option resolver not throw an exception here?
General static code analysis is beyond what this bundle can do, I think. It is much more complex :)
I think we can also remove the comment a few lines below.
…ass. Add a test for reusing a FormExtractor with and without a translation_domain form option.
Ignore incorrect usage the Form component in the files we scan. In this case: Don't admire to warn when required options are missing or of an unsupported type.
Hi |
{ | ||
$extractor = $this->createFormExtractor(); | ||
|
||
$this->testExtractWithDefaultDomain($extractor); |
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.
Calling two other test functions here looks a bit weird. Could you refactor this to make the individual tests a bit more independent?
Maybe moving the createFormExtractor
method to a setUp
method and adding form extractor as a property of this class would help.
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.
I can create the setUp method and the class property, but would be calling the two other test functions without parameters be okay?
This is a cleaner way to share the same form extractor.
As discussed in PR #64 we can parse the default translation_domain from options.
I did not want to add a setDomain to the
Message
model as that isn't really supported, so I've delayed construction theMessage
objects until after parsing all the files.TODO:
enterNode
to a newparseAddCall
method.