Class PHPFIT_TypeAdapter

Description

FIT TypeAdapter

The type adapter makes it possible to "cast" from HTML input into PHP variables. Even if PHP is sort of type-free and does automatic casts, this class makes it possible to check and validate variables including their types.

  • version: 0.1.0

Located in /TypeAdapter.php (line 27)


	
			
Direct descendents
Class Description
 class PHPFIT_TypeAdapter_Double FIT TypeAdapter
 class PHPFIT_TypeAdapter_Boolean FIT TypeAdapter
 class PHPFIT_TypeAdapter_Integer FIT TypeAdapter
 class PHPFIT_TypeAdapter_String FIT TypeAdapter
Variable Summary
 string $field
 object $fixture
 string $method
 object $target
 string $type
Method Summary
 object an adapterFor (string $type)
 boolean equals (mixed $a, mixed $b)
 void get ()
 void init (mixed $fixture, mixed $type)
 void invoke ()
 true is_bool (string $type)
 true is_double (string $type)
 true is_int (string $type)
 true is_string (string $type)
 object an loadAdapter (mixed $name, string $type)
 void on (Fixture $fixture, string $type)
 void onField (Fixture $fixture, string $name)
 void onMethod (Fixture $fixture, string $name)
 Object parse (string $s)
 void scientificEquals (mixed $a, mixed $b)
 void set (mixed $value)
 void toString (mixed $o)
Variables
string $field (line 45)

named field

  • access: public
object $fixture (line 39)

fixture object

  • access: public
string $method (line 51)

named method

  • access: public
object $target (line 33)

target fixture object

  • access: public
string $type = null (line 57)

adapter class

  • access: public
Methods
adapterFor (line 121)

load actual adaptor for a specified type

  • return: instance of PHPFIT_TypeAdapter
  • static:
  • access: public
object an adapterFor (string $type)
  • string $type
equals (line 241)
  • access: public
boolean equals (mixed $a, mixed $b)

Redefined in descendants as:
get (line 208)
  • access: public
void get ()
init (line 195)
  • access: public
void init (mixed $fixture, mixed $type)
invoke (line 221)
  • access: public
void invoke ()
is_bool (line 152)

check for adapter type: boolean

  • return: if type matches, false otherwise
  • static:
  • access: public
true is_bool (string $type)
  • string $type
is_double (line 179)

check for adapter type: double

  • return: if type matches, false otherwise
  • static:
  • access: public
true is_double (string $type)
  • string $type
is_int (line 166)

check for adapter type: integer

  • return: if type matches, false otherwise
  • static:
  • access: public
true is_int (string $type)
  • string $type
is_string (line 190)

check for adapter type: string

  • return: if type matches, false otherwise
  • static:
  • access: public
true is_string (string $type)
  • string $type
loadAdapter (line 106)

auxiliary function to include requested adapter

  • return: instance of PHPFIT_TypeAdapter
  • static:
  • access: private
object an loadAdapter (mixed $name, string $type)
  • string $type
on (line 93)

Create generic adapter for fixture

  • static:
  • access: public
void on (Fixture $fixture, string $type)
  • Fixture $fixture: target
  • string $type: type of variables
onField (line 79)

Create adapter for fixture's field

  • static:
  • access: public
void onField (Fixture $fixture, string $name)
  • Fixture $fixture: target
  • string $name: variable name
onMethod (line 65)

Create adapter for fixture's method

  • static:
  • access: public
void onMethod (Fixture $fixture, string $name)
  • Fixture $fixture: target
  • string $name: variable name
parse (line 233)
  • access: public
Object parse (string $s)
  • string $s: s

Redefined in descendants as:
scientificEquals (line 246)
  • static:
  • access: public
void scientificEquals (mixed $a, mixed $b)
set (line 201)
  • access: public
void set (mixed $value)
toString (line 250)
  • access: public
void toString (mixed $o)

Documentation generated on Sun, 02 Apr 2006 23:20:53 +0000 by phpDocumentor 1.3.0RC5