PHP Class Longman\TelegramBot\Entities\ServerResponse

Inheritance: extends Entity
Exibir arquivo Open project: akalongman/php-telegram-bot Class Usage Examples

Public Methods

Method Description
__construct ( array $data, string $bot_name ) ServerResponse constructor.
isOk ( ) : boolean If response is ok
printError ( ) : string Print error

Protected Methods

Method Description
isAssoc ( array $array ) : boolean Check if array is associative

Private Methods

Method Description
createResultObject ( array $result, string $bot_name ) : Chat | ChatMember | Longman\TelegramBot\Entities\File | Message | Longman\TelegramBot\Entities\User | UserProfilePhotos | Longman\TelegramBot\Entities\WebhookInfo Create and return the object of the received result
createResultObjects ( array $result, string $bot_name ) : null | ChatMember[] | Update[] Create and return the objects array of the received result

Method Details

__construct() public method

ServerResponse constructor.
public __construct ( array $data, string $bot_name )
$data array
$bot_name string

isAssoc() protected method

Check if array is associative
protected isAssoc ( array $array ) : boolean
$array array
return boolean

isOk() public method

If response is ok
public isOk ( ) : boolean
return boolean

printError() public method

Print error
public printError ( ) : string
return string