-
Notifications
You must be signed in to change notification settings - Fork 550
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
fix: allow to parse null or empty header element #560
Conversation
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.
@DogLoc thank you for this fix. I have a few things:
- Can you move the new if-clause before the switch-clause? I can not see why this check is only relevant for the
>>
case. - Please provide at least one test. If you need help here, let me know.
- Please fix failing CS workflow by running PHP-CS-Fixer.
- Out of curiosity: why not return
ElementNull
instead? Why do you usenull
?
Finally I use an empty array for input and output (<<, >>) because with the ElementNull class, the code tries to retrieve the header on a null element I don't have strong knowledge of this project, so if you have a better suggestion, I take it! ^^ I have provided a unit test for the parser, let me know if this is sufficient. |
@k00ni master merged in my branch 👍 |
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.
Thank you for your changes! There is only one thing and we are good to go.
Co-authored-by: Konrad Abicht <hi@inspirito.de>
Looks good to me. I will merge it next week if there are no objections. Thank you @DogLoc! |
Thanks you too ^^ ! @k00ni |
Why I open this pull request ?
When I pass a empty string value at the first arguments of
parseHeader
function, it throw an exception :that append when I provide a PDF like this : 20221025_debug_header_parse.pdf
If it helps, I have already opened a case for this problem. : #557
Have a good day ^^