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
Update phpdoc.dist.xml loading issue #1380
Update phpdoc.dist.xml loading issue #1380
Conversation
When ran phpdoc without parameters it can't load phpdoc.dist.xml directly and show a "No parsable files were found" Exception. Change userConfig file path search to take dist even if the user do not give a specific parameter. Signed-off-by: Stéphane HULARD <s.hulard@chstudio.fr>
@@ -110,9 +110,9 @@ private function isValidFile($path) | |||
private function createConfigurationObject($templatePath, $defaultUserConfigPath, $customUserConfigPath, $class) | |||
{ | |||
$config = $this->serializer->deserialize(file_get_contents($templatePath), $class, 'xml'); | |||
$customUserConfigPath = $customUserConfigPath ? : $defaultUserConfigPath; |
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 will throw an error on line 116 if both $customUserconfigPath and $defaultUserConfigPath contain a non-existing path; at the very least should a is_readable check be added to the if-statement below (in addition to the null check)
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.
Ok, I've added the is_readable in a new commit.
Thank you for the comment, I do not think this test missed 👍
…d file If $defaultUserConfigPath and $customUserConfigPath are null or contain invalid path we should not try to load it... Signed-off-by: Stéphane HULARD <s.hulard@chstudio.fr>
Thanks for adding that! You might be right but it never hurts to be a little defensive (that check should have been there in the original version as well). I have merged this item |
Update phpdoc.dist.xml loading issue
Thanks, don't worry I'm not hurted, maybe my english is not so good to use the right words... |
When ran phpdoc without parameters it can't load phpdoc.dist.xml directly and show a "No parsable files were found" Exception.
Change userConfig file path search to take dist even if the user do not give a specific parameter.