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

Catch errors due to malformed tags #527

Merged
merged 1 commit into from
May 12, 2021
Merged

Catch errors due to malformed tags #527

merged 1 commit into from
May 12, 2021

Conversation

villfa
Copy link
Contributor

@villfa villfa commented Jan 26, 2021

Fix for #526

@villfa villfa marked this pull request as ready for review January 26, 2021 14:10
$doc = $this->factory->create($docblock);
} catch (InvalidArgumentException $e) {
// happens with malformed tags
return [];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@theofidry I'm not sure that returning an empty array here it's the best solution. Alternatively we can throw UnexpectedValueException, that way it will be caught in the PHP compactor. WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

let's go for a try/catch: it's slightly more explicit what is happening but it may be better with a custom exception (that can extend UnexpectedValueException)

Copy link
Member

Choose a reason for hiding this comment

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

edit: it's not a big deal so feel free to ignore this if you don't want to spend more time on it

@theofidry
Copy link
Member

For some reasons looks like I never submitted my comment. Could you do a merge of the upstream?

@theofidry theofidry merged commit b4b98c7 into box-project:master May 12, 2021
@theofidry
Copy link
Member

Thankyou @villfa

@villfa
Copy link
Contributor Author

villfa commented May 12, 2021

Sorry for the delay and the lack of communication, I have been pretty busy in the last months.
I hope I'll be able to able to add non-regression tests for this case soon.

@villfa villfa deleted the patch-1 branch May 12, 2021 07:25
@theofidry
Copy link
Member

No worries :)

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

Successfully merging this pull request may close these issues.

2 participants