TeamSpeak 3 PHP Framework
Modern use-at-will framework that provides individual components to manage TeamSpeak 3 Server instances
TeamSpeak3_Helper_Signal_Handler Class Reference

Helper class providing handler functions for signals. More...

Public Member Functions

 __construct ($signal, $callback)
 The TeamSpeak3_Helper_Signal_Handler constructor. More...
 
 call (array $args=array())
 Invoke the signal handler. More...
 

Detailed Description

Helper class providing handler functions for signals.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $signal,
  $callback 
)

The TeamSpeak3_Helper_Signal_Handler constructor.

Parameters
string$signal
mixed$callback
Exceptions
TeamSpeak3_Helper_Signal_Exception
Returns
TeamSpeak3_Helper_Signal_Handler
54  {
55  $this->signal = (string) $signal;
56 
57  if(!is_callable($callback))
58  {
59  throw new TeamSpeak3_Helper_Signal_Exception("invalid callback specified for signal '" . $signal . "'");
60  }
61 
62  $this->callback = $callback;
63  }
Enhanced exception class for TeamSpeak3_Helper_Signal objects.
Definition: Exception.php:29

Member Function Documentation

◆ call()

call ( array  $args = array())

Invoke the signal handler.

Parameters
array$args
Returns
mixed
72  {
73  return call_user_func_array($this->callback, $args);
74  }

The documentation for this class was generated from the following file: