00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00021 class PEIP_Content_Type_Selector
00022 implements PEIP_INF_Message_Selector {
00023
00024 protected
00025 $type;
00026
00027 protected static
00028 $types = array(
00029 'string' => 'is_string',
00030 'int' => 'is_int',
00031 'float' => 'is_float',
00032 'numeric' => 'is_numeric',
00033 'bool' => 'is_bool',
00034 'boolean' => 'is_bool',
00035 'array' => 'is_array',
00036 'scalar' => 'is_scalar',
00037 'object' => 'is_object',
00038 'resource' => 'is_resource'
00039 );
00040
00041
00047 public function __construct($type){
00048 $this->type = $type;
00049 }
00050
00051
00057 public function acceptMessage(PEIP_INF_Message $message){
00058 return call_user_func(self::$types[$this->type], $message->getContent());
00059 }
00060
00061 }
00062