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

move on instead of splittingException? #39

Open
cloudswitch opened this issue Jan 17, 2024 · 1 comment
Open

move on instead of splittingException? #39

cloudswitch opened this issue Jan 17, 2024 · 1 comment

Comments

@cloudswitch
Copy link

cloudswitch commented Jan 17, 2024

Hi,

awesome work guys, thank you!
It's not really an issue however I have massive problems with this right now. We are testing the whole order process of the shop and someone has put xyz as street in the last order without house number. I'm getting of course splitting exception from line 290. The problem is I have no rights to delete this order from the shop and the whole download process is not working because of this.
Would it be possible, that if the address is not splittable, simpy to just put street into streetName and create the array without houseNumber? I have tried it but had no luck. I would greatly appreciate any help. Thanks

@larsbo
Copy link

larsbo commented Jan 18, 2024

Why don't you handle the exception like you want? This is just a library and not a complete shop plugin.
You can do something linke this

            try {
                $address = AddressSplitter::splitAddress($street);
            } catch (InvalidArgumentException $exception) {
                $address['streetName'] = $street;
                $address['houseNumber'] = '';
            }

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

No branches or pull requests

2 participants