-
Notifications
You must be signed in to change notification settings - Fork 23
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
Remove %n in front and back of string #24
Conversation
So if `RECIPIENT` or `ORGANIZATION` are not filled or empty, then this results in only a `STREET_ADDRESS` that's prefix with an `%n` which will be replace by a `<br>` which results in an address that's starts a line lower then needed. Fixes adamlc#23
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.
Thanks for your PR!
It looks like the tests are now failing. Would you mind updating them please?
@adamlc, Ah yes I see that now. As it's not related to the scope of this issue, shall I update them in a different branch so those can be merged first before proceding with this PR's.
Looks like we be needing |
I'll be honest I haven't used this library or php for years, but it looks like the unit test is actually broken.
The final |
Otherwise you could end up with 2 `%n%n` after each other that get converted to `<br><br>`
So you don't end up with '%n%n' which gets converted to `<br><br>`
Sorry for the slow response, new dad here :) You're right, I updated the PR and also added a test for this scenario 👍 |
tests/FormatTest.php
Outdated
$this->assertEquals( | ||
$this->container->formatAddress(), | ||
"Schulstrasse 4\n32547 Oyenhausen" | ||
); |
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.
Just a small niggle to fix the indent, otherwise test looks good I think!
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.
Like this? On 1 line? Because I copied it from the test about and just removed the Eberhard Wellhausen\nWittekindshof\n
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.
@jmslbam sorry I meant indentation, you can see from the diff above it just needs bumping right
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.
Hmmz, which line exactly? Because in the div/panel of the PR makes it so that the lines visually jump to a new line. If you just view the file by itself / raw I don't see any issues with the new Code/Test
Can you screenshot / point which line it is?
To much indention
What I do see it that the other test have an extra indention which should be there from any kind of coding standard. I added a screenshot.
Thank you for taking the time and I can fix the overal indention in a new PR, no problemo
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.
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 changed the tabs to spaces, will fix the other spacing / indention issues in a different PR and will add a .editorconfig
to the repo which defines the settings for this project (spaces).
The FormatTest.php file mixes tabs and spaces as indentions.
Or if you ok, I can fix it in this same PR, save you time.
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.
Feel free to add it into this PR. Greatly appreciated @jmslbam. The issues must have slipped through the net over the years and I've not noticed!
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.
Done 👍
Amazing thanks for all your work @jmslbam |
@adamlc you're welcome! Thank you for the initial work of the package! |
So if
RECIPIENT
orORGANIZATION
are not filled or empty, then this results in only aSTREET_ADDRESS
that's prefix with an%n
which will be replace by a<br>
which results in an address that's starts a line lower then needed.Fixes #23