Skip to content

Commit acf1b2e

Browse files
authored
fix: allow ark3 as number suffix (#515)
1 parent 0213266 commit acf1b2e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/Helper/ValidateStreet.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class ValidateStreet
1717
'\s' . // Separator between street and number
1818
'(?P<number>\d{1,5})' . // Number can contain a maximum of 5 numbers
1919
'[/\s\-]{0,2}' . // Separators between number and addition
20-
'(?P<number_suffix>' .
21-
'[a-z]{1}[/\-]?\d{1,3}|' . // Numbers suffix starts with a letter with optional - or / followed by numbers or
20+
'(?P<number_suffix>' . // Number Suffix
21+
'[a-z][/\-\da-z]{1,5}|' . // starts with a letter, followed by numbers, letters, - or / with a maximum of 5 chars or
2222
'-\d{1,4}|' . // starts with - and has up to 4 numbers or
2323
'(?=.{2,6}$)\d{1,6}[/\-a-z]{1,5}|'. // starts with numbers followed by letters with a maximum of 6 chars, or
2424
'[a-z][a-z\s]{0,5}'. // has up to 6 letters with a space

test/Model/Consignment/ConsignmentSplitStreetTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ class ConsignmentSplitStreetTest extends ConsignmentTestCase
2323
public function provideSplitStreetData(): array
2424
{
2525
return $this->createConsignmentProviderDataset([
26+
[
27+
self::FULL_STREET => 'Oosteinderweg 97 Ark3',
28+
self::expected(self::FULL_STREET) => 'Oosteinderweg 97 Ark3',
29+
self::expected(self::STREET) => 'Oosteinderweg',
30+
self::expected(self::NUMBER) => 97,
31+
self::expected(self::NUMBER_SUFFIX) => 'Ark3',
32+
],
2633
[
2734
self::FULL_STREET => 'Graan voor Visch 19905',
2835
self::expected(self::FULL_STREET) => 'Graan voor Visch 19905',

0 commit comments

Comments
 (0)