@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | 'ZW' => array(), // Zimbabwe, Notes: System is being planned. |
| 285 | 285 | ); |
| 286 | 286 | |
| 287 | - public function isValid($countryCode, $postalCode, $ignoreSpaces = false) { |
|
| 287 | + public function isValid($countryCode, $postalCode, $ignoreSpaces = FALSE) { |
|
| 288 | 288 | //$postalCode = str_replace('-', '', $postalCode); |
| 289 | 289 | if (!isset($this->formats[$countryCode])) { |
| 290 | 290 | throw new ValidationException(sprintf('Invalid country code: "%s"', $countryCode)); |
@@ -293,15 +293,15 @@ discard block |
||
| 293 | 293 | foreach ($this->formats[$countryCode] as $format) { |
| 294 | 294 | #echo $postalCode . ' - ' . $this->getFormatPattern($format)."\n"; |
| 295 | 295 | if (preg_match($this->getFormatPattern($format, $ignoreSpaces), $postalCode)) { |
| 296 | - return true; |
|
| 296 | + return TRUE; |
|
| 297 | 297 | } |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | if (!count($this->formats[$countryCode])) { |
| 301 | - return true; |
|
| 301 | + return TRUE; |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | - return false; |
|
| 304 | + return FALSE; |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | public function getFormats($countryCode) { |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | return (isset($this->formats[$countryCode])); |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | - protected function getFormatPattern($format, $ignoreSpaces = false) { |
|
| 319 | + protected function getFormatPattern($format, $ignoreSpaces = FALSE) { |
|
| 320 | 320 | //$format = str_replace('-', '', $format); |
| 321 | 321 | $pattern = str_replace('#', '\d', $format); |
| 322 | 322 | $pattern = str_replace('@', '[a-zA-Z]', $pattern); |