File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 1111/**
1212 * Validates and formats postcodes in Paraguay.
1313 *
14- * Postcodes consist of 4 digits, without separator.
14+ * Postcodes consist of 4 digits before June 2018 and 6 digits thereafter , without a separator.
1515 *
1616 * @see https://en.wikipedia.org/wiki/List_of_postal_codes
17- * @see https://en.wikipedia.org/wiki/List_of_postal_codes_of_Paraguay
1817 */
1918final class PYFormatter implements CountryPostcodeFormatter
2019{
2120 public function format (string $ postcode ): ?string
2221 {
23- if (preg_match ('/^[0-9]{4}$/ ' , $ postcode ) !== 1 ) {
22+ if (preg_match ('/^(?: [0-9]{4}|[0-9]{6}) $/ ' , $ postcode ) !== 1 ) {
2423 return null ;
2524 }
2625
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ public function providerFormat(): array
2323 ['123 ' , null ],
2424 ['1234 ' , '1234 ' ],
2525 ['12345 ' , null ],
26+ ['123456 ' , '123456 ' ],
27+ ['1234567 ' , null ],
2628
2729 ['A ' , null ],
2830 ['AB ' , null ],
You can’t perform that action at this time.
0 commit comments