Remove %n in front and back of string#24
Remove %n in front and back of string#24adamlc merged 6 commits intoadamlc:masterfrom jmslbam:patch-1
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 #23
adamlc
left a comment
There was a problem hiding this comment.
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.
Just a small niggle to fix the indent, otherwise test looks good I think!
There was a problem hiding this comment.
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.
@jmslbam sorry I meant indentation, you can see from the diff above it just needs bumping right
There was a problem hiding this comment.
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.
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.
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!
|
Amazing thanks for all your work @jmslbam |
|
@adamlc you're welcome! Thank you for the initial work of the package! |




So if
RECIPIENTorORGANIZATIONare not filled or empty, then this results in only aSTREET_ADDRESSthat's prefix with an%nwhich will be replace by a<br>which results in an address that's starts a line lower then needed.Fixes #23