cvs: pear /Validate/Validate BE.php

From: Date: Fri, 16 Sep 2005 21:50:42 +0000
Subject: cvs: pear /Validate/Validate BE.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-34813@lists.php.net to get a copy of this message
moosh Fri Sep 16 17:50:42 2005 EDT Modified files: /pear/Validate/Validate BE.php Log: - coding standards http://cvs.php.net/diff.php/pear/Validate/Validate/BE.php?r1=1.2&r2=1.3&ty=u Index: pear/Validate/Validate/BE.php diff -u pear/Validate/Validate/BE.php:1.2 pear/Validate/Validate/BE.php:1.3 --- pear/Validate/Validate/BE.php:1.2 Tue Jun 14 06:30:46 2005 +++ pear/Validate/Validate/BE.php Fri Sep 16 17:50:39 2005 @@ -16,7 +16,7 @@ * @author Christophe Gesché <moosh@php.net> * @copyright 2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: BE.php,v 1.2 2005/06/14 10:30:46 moosh Exp $ + * @version CVS: $Id: BE.php,v 1.3 2005/09/16 21:50:39 moosh Exp $ * @link http://pear.php.net/package/Validate_BE */ //require_once 'PEAR.php'; @@ -45,7 +45,7 @@ * @package version@ * @link http://pear.php.net/package/Validate_BE */ -class Validate_BE +class Validate_BE { /** * Validate a Belgian social security number @@ -60,7 +60,7 @@ * @param string ssn to validate * @return bool true on success */ - function ssn($ssn) + function ssn($ssn) { if (!(bool) ereg('^[0-9]{11}$', $ssn)) return false; $year = substr($ssn,0,2); @@ -245,7 +245,7 @@ $zoneprefixes['littlezone'] = array ('010', '011', '012', '013', '014', '015', '016', '019', '050', '051', '052', '053', '054', '055', '056', '057', '058', '059', '060', '061', '063', '064', '065', '067', '068', '069', '071', '080', '081', '082', '083', '084', '085', '086', '087', '089'); $zoneprefixes['bigzone'] = array ('02', '03', '04', '09'); $zoneprefixes['mobile'] = array('0472', '0473', '0474', '0475', '0476', '0477', '0478', '0479 ', '0485', '0486 ', '0494', '0495', '0496', '0497', '0498', '0499'); - + $result = false; $phonenumber = trim($phonenumber); if ($phonenumber[0]=='+' && $phonenumber[1]!='+' ) $phonenumber = '+'.$phonenumber; @@ -275,29 +275,23 @@ if (!$is_mobile && !$in_bigzone && !$in_littlezone) return false; // wrong prefix - if ($type == VALIDATE_BE_PHONENUMBER_TYPE_ANY || $type == VALIDATE_BE_PHONENUMBER_TYPE_NORMAL ) - { + if ($type == VALIDATE_BE_PHONENUMBER_TYPE_ANY || $type == VALIDATE_BE_PHONENUMBER_TYPE_NORMAL ) { if(!$is_mobile && strlen($phonenumber) == 9 && is_numeric($phonenumber)) $result = true; //we have a 9 digit numeric number. } - if ($type == VALIDATE_BE_PHONENUMBER_TYPE_ANY || $type == VALIDATE_BE_PHONENUMBER_TYPE_MOBILE ) - { + if ($type == VALIDATE_BE_PHONENUMBER_TYPE_ANY || $type == VALIDATE_BE_PHONENUMBER_TYPE_MOBILE ) { if($is_mobile && strlen($phonenumber) == 10 && is_numeric($phonenumber)) $result = true; //we have a 9 digit numeric number. } //we need at least 9 digits - if (ereg('^[+0-9]{9,}$', $phonenumber)) - { + if (ereg('^[+0-9]{9,}$', $phonenumber)) { $phonenumber = substr($phonenumber, strlen($phonenumber) - 10); //we only use the last 9 digits (so no troubles with international numbers) if (strlen($phonenumber) >= 9) { - } } - return $result; } - } ?> \ No newline at end of file

« previous php.pear.cvs (#34813) next »