-
Notifications
You must be signed in to change notification settings - Fork 536
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
Refactor: declare pdf whitespaces in global variable to avoid bug #411
Conversation
… of bug using regular whitespace
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.
@LucianoHanna thank you for the PR.
I welcome your changes in general but have to ask you to move $pdfWhitespaces
and $pdfWhitespacesRegex
to Config.php. Are these the "global" variables you meant in the title?
Its purpose is to hold default values which can be overridden by the user. For some PDFs it may require to change a default value. Here is a basic example how to setup and use Config
instance.
Also which bug does this PR avoid?
Another remark: Please create a separate branch for each pull request in the future. It limits our options if you are using |
@k00ni thank you for your remarks! I refactored the code to remove hardcoded whitespaces and use a config variable, this way we avoid having some line of code considering only %20 as a white space |
@k00ni I made these changes but there's one test failing, maybe should open another PR to remove "CI / Tests alternative autoloader (PHP 5.6)" |
#409 already targets the outdated alternative autoloader tests. Can you merge it and try again? In the end I will squash your PR, so it shouldn't matter |
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.
Good to go 👍🏿
Will merge it soon.
We had to fix some problems in our testing environment (Github workflow + Scrutinizer). All fixes are now in |
I merged master and everything looks ok but there's nothing left to commit... |
There should be a merge commit to push. Anyway. |
Hi,
I made some refactor in RawDataParser, I declared a global variable containing pdf whitespaces so we don't need to hardcode were use whitespace, avoiding bug if forget to consider all pdf whitespaces