| @@ 129-134 (lines=6) @@ | ||
| 126 | break; |
|
| 127 | ||
| 128 | // maximum 2 chars |
|
| 129 | case 'customerCountry': |
|
| 130 | if (mb_strlen($value) > 2) { |
|
| 131 | throw new BpostInvalidLengthException($key, mb_strlen($value), 2); |
|
| 132 | } |
|
| 133 | $this->parameters[$key] = (string) $value; |
|
| 134 | break; |
|
| 135 | ||
| 136 | // maximum 8 chars |
|
| 137 | case 'customerStreetNumber': |
|
| @@ 138-143 (lines=6) @@ | ||
| 135 | ||
| 136 | // maximum 8 chars |
|
| 137 | case 'customerStreetNumber': |
|
| 138 | case 'customerBox': |
|
| 139 | if (mb_strlen($value) > 8) { |
|
| 140 | throw new BpostInvalidLengthException($key, mb_strlen($value), 8); |
|
| 141 | } |
|
| 142 | $this->parameters[$key] = (string) $value; |
|
| 143 | break; |
|
| 144 | ||
| 145 | // maximum 20 chars |
|
| 146 | case 'customerPhoneNumber': |
|
| @@ 146-151 (lines=6) @@ | ||
| 143 | break; |
|
| 144 | ||
| 145 | // maximum 20 chars |
|
| 146 | case 'customerPhoneNumber': |
|
| 147 | if (mb_strlen($value) > 20) { |
|
| 148 | throw new BpostInvalidLengthException($key, mb_strlen($value), 20); |
|
| 149 | } |
|
| 150 | $this->parameters[$key] = (string) $value; |
|
| 151 | break; |
|
| 152 | ||
| 153 | // maximum 32 chars |
|
| 154 | case 'customerPostalCode': |
|
| @@ 154-159 (lines=6) @@ | ||
| 151 | break; |
|
| 152 | ||
| 153 | // maximum 32 chars |
|
| 154 | case 'customerPostalCode': |
|
| 155 | if (mb_strlen($value) > 32) { |
|
| 156 | throw new BpostInvalidLengthException($key, mb_strlen($value), 32); |
|
| 157 | } |
|
| 158 | $this->parameters[$key] = (string) $value; |
|
| 159 | break; |
|
| 160 | ||
| 161 | // maximum 40 chars |
|
| 162 | case 'customerFirstName': |
|
| @@ 166-171 (lines=6) @@ | ||
| 163 | case 'customerLastName': |
|
| 164 | case 'customerCompany': |
|
| 165 | case 'customerStreet': |
|
| 166 | case 'customerCity': |
|
| 167 | if (mb_strlen($value) > 40) { |
|
| 168 | throw new BpostInvalidLengthException($key, mb_strlen($value), 40); |
|
| 169 | } |
|
| 170 | $this->parameters[$key] = (string) $value; |
|
| 171 | break; |
|
| 172 | ||
| 173 | // maximum 50 chars |
|
| 174 | case 'orderReference': |
|
| @@ 176-181 (lines=6) @@ | ||
| 173 | // maximum 50 chars |
|
| 174 | case 'orderReference': |
|
| 175 | case 'costCenter': |
|
| 176 | case 'customerEmail': |
|
| 177 | if (mb_strlen($value) > 50) { |
|
| 178 | throw new BpostInvalidLengthException($key, mb_strlen($value), 50); |
|
| 179 | } |
|
| 180 | $this->parameters[$key] = (string) $value; |
|
| 181 | break; |
|
| 182 | ||
| 183 | // integers |
|
| 184 | case 'orderTotalPrice': |
|