phpDocumentor Swift
[ class tree: Swift ] [ index: Swift ] [ all elements ]

Class: SwiftValidator

Source Location: /classes/SwiftValidator.php

Class SwiftValidator

Class Overview

The SwiftValidator class contains functions and code to help validate and decipher user input (or any input for that matter).

Located in /classes/SwiftValidator.php [line 43]



		
		
		
		

Methods

[ Top ]
Method Summary
SwiftValidator   __construct()   Creates a new SwiftValidator object.
boolean   isAddress()   Checks whether a string contains only characters found in an street address
boolean   isAlpha()   Checks whether a given string contains only alpha characters.
boolean   isAlphaNumeric()   Checks whether a given string contains only alpha and/or numeric characters.
boolean   isDate()   Checks whether a string matches the format of a date. Mask: YYYY-MM-DD
boolean   isEmail()   Checks whether a string matches the format of an email address.
boolean   isLength()   Checks $str to see if its length is less than the $low and/or higher than the $high.
boolean   isName()   Checks whether a string contains only letters, dashes, and spaces only.
boolean   isNumeric()   Checks whether a given string contains only numeric characters.
boolean   isPassport()   Checks whether a string matches the format of a passport.
boolean   isPassword()   Checks to see if a password is at least $lenth characters and must contains at least one
boolean   isPhone()   Checks whether a string matches the format of a phone number. (e.g 1-800-999-9999)
boolean   isUsername()   Checks whether a string is within given length range and contains only digits and/or letters.
boolean   isZip()   Checks whether a string matches the format of a 5-digit zip code. (e.g. 49508)

[ Top ]
Methods
Constructor __construct  [line 49]

  SwiftValidator __construct( )

Creates a new SwiftValidator object.


API Tags:
Return:  The new SwiftValidator object.
Access:  public


[ Top ]
isAddress  [line 127]

  boolean isAddress( $address, string $name  )

Checks whether a string contains only characters found in an street address

(Such as alphanumeric, dash, underscore, period, coma, colon, etc)

Parameters:
string   $name:  The name to check
   $address: 

API Tags:
Return:  True if the string appears to be an address. False otherwise.
Access:  public


[ Top ]
isAlpha  [line 74]

  boolean isAlpha( string $str  )

Checks whether a given string contains only alpha characters.

Parameters:
string   $str:  The string to check

API Tags:
Return:  True if the string is only alpha characters. False otherwise.
Access:  public


[ Top ]
isAlphaNumeric  [line 100]

  boolean isAlphaNumeric( string $str  )

Checks whether a given string contains only alpha and/or numeric characters.

Parameters:
string   $str:  The string to check

API Tags:
Return:  True if the string is only alpha-numeric characters. False otherwise.
Access:  public


[ Top ]
isDate  [line 192]

  boolean isDate( string $date  )

Checks whether a string matches the format of a date. Mask: YYYY-MM-DD

Parameters:
string   $date: 

API Tags:
Return:  True if the string appears to be a date. False otherwise.
Access:  public


[ Top ]
isEmail  [line 140]

  boolean isEmail( string $email  )

Checks whether a string matches the format of an email address.

Parameters:
string   $email:  The string to check

API Tags:
Return:  True if the string appears to be an email. False otherwise.
Access:  public


[ Top ]
isLength  [line 58]

  boolean isLength( string $str, [integer $low = null], [integer $high = null]  )

Checks $str to see if its length is less than the $low and/or higher than the $high.

Parameters:
string   $str:  The string to check
integer   $low:  The low end of the range. Default = null
integer   $high:  The high end of the range. Default = null

API Tags:
Return:  False if the string's length is less than the $low and/or higher than the $high. True, otherwise.
Access:  public


[ Top ]
isName  [line 113]

  boolean isName( string $name  )

Checks whether a string contains only letters, dashes, and spaces only.

Parameters:
string   $name:  The name to check

API Tags:
Return:  True if the string is only letters, dashes, and spaces. False otherwise.
Access:  public


[ Top ]
isNumeric  [line 87]

  boolean isNumeric( string $str  )

Checks whether a given string contains only numeric characters.

Parameters:
string   $str:  The string to check

API Tags:
Return:  True if the string is only numeric characters. False otherwise.
Access:  public


[ Top ]
isPassport  [line 153]

  boolean isPassport( string $passport  )

Checks whether a string matches the format of a passport.

Parameters:
string   $passport:  The string to check

API Tags:
Return:  True if the string appears to be a passport. False otherwise.
Access:  public


[ Top ]
isPassword  [line 225]

  boolean isPassword( string $pass, [integer $len_min = null], [integer $len_max = null]  )

Checks to see if a password is at least $lenth characters and must contains at least one

lower case letter, one upper case letter, and one digit

Parameters:
string   $pass:  The password string to check.
integer   $len_min:  The minimum length of the $user. Default = null
integer   $len_max:  The maximum length of the $user. Default = null

API Tags:
Return:  True if the string appears to be a strong password. False otherwise.
Access:  public


[ Top ]
isPhone  [line 166]

  boolean isPhone( string $phone  )

Checks whether a string matches the format of a phone number. (e.g 1-800-999-9999)

Parameters:
string   $phone:  The string to check

API Tags:
Return:  True if the string appears to be a phone number. False otherwise.
Access:  public


[ Top ]
isUsername  [line 207]

  boolean isUsername( string $user, [integer $len_min = null], [integer $len_max = null]  )

Checks whether a string is within given length range and contains only digits and/or letters.

Parameters:
string   $user:  The string to check
integer   $len_min:  The minimum length of the $user. Default = null
integer   $len_max:  The maximum length of the $user. Default = null

API Tags:
Return:  True if the string appears to be a well formated username. False otherwise.
Access:  public


[ Top ]
isZip  [line 179]

  boolean isZip( string $zip  )

Checks whether a string matches the format of a 5-digit zip code. (e.g. 49508)

Parameters:
string   $zip: 

API Tags:
Return:  True if the string appears to be a 5-digit zip code. False otherwise.
Access:  public


[ Top ]

Documentation generated on Tue, 08 Oct 2013 05:37:16 +0200 by phpDocumentor 1.4.4