[TASK] Made all constuctors and destructors public.
[TASK] Added some DocComments for the IrcClient.
This commit is contained in:
parent
03a4dfff71
commit
26036e9994
|
@ -10,7 +10,7 @@ class Client_BotClient extends Client_AbstractClient {
|
|||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
public function __construct() {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class Client_ClientManager {
|
|||
* Default constructor.
|
||||
* @return void
|
||||
*/
|
||||
function __construct() {
|
||||
public function __construct() {
|
||||
$this->connectionPool = new Connection_ConnectionPool();
|
||||
$this->clientPool = array();
|
||||
$this->registeredProtocols = array();
|
||||
|
@ -55,7 +55,7 @@ class Client_ClientManager {
|
|||
* Default destructor. Closes connections before being killed.
|
||||
* @return void
|
||||
*/
|
||||
function __destruct() {
|
||||
public function __destruct() {
|
||||
unset($this->clientPool);
|
||||
unset($this->connectionPool);
|
||||
}
|
||||
|
|
|
@ -7,18 +7,41 @@
|
|||
*/
|
||||
class Client_IrcClient extends Client_AbstractClient {
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*/
|
||||
protected $got_001;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*/
|
||||
protected $joined;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*/
|
||||
protected $authed;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $nick;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $channels;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $lines;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
* @return void
|
||||
*/
|
||||
function __construct() {
|
||||
public function __construct() {
|
||||
$this->nick = "Serena";
|
||||
$this->channels = array();
|
||||
$this->resetConnectionStatus();
|
||||
|
|
|
@ -87,7 +87,7 @@ class Connection_ConnectionHandler {
|
|||
* @param $linebreak
|
||||
* @return void
|
||||
*/
|
||||
function __construct($socket, $id, $group = "", $protocol = "") {
|
||||
public function __construct($socket, $id, $group = "", $protocol = "") {
|
||||
$this->buffer_incoming = new Misc_Buffer();
|
||||
$this->buffer_outgoing = new Misc_Buffer();
|
||||
$this->socketHandler = new Socket_SocketHandler($socket);
|
||||
|
@ -105,7 +105,7 @@ class Connection_ConnectionHandler {
|
|||
* Calls parent destructor.
|
||||
* @return void
|
||||
*/
|
||||
function __destruct() {
|
||||
public function __destruct() {
|
||||
unset($this->socketHandler);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class Connection_ConnectionPool {
|
|||
* Creates an Instance of SocketPool
|
||||
* @return void
|
||||
*/
|
||||
function __construct() {
|
||||
public function __construct() {
|
||||
$this->connectionHandlers = array();
|
||||
$this->socketPool = new Socket_SocketPool();
|
||||
$this->nextID = 1;
|
||||
|
@ -38,7 +38,7 @@ class Connection_ConnectionPool {
|
|||
* Destroys the SocketPool
|
||||
* @return void
|
||||
*/
|
||||
function __destruct() {
|
||||
public function __destruct() {
|
||||
unset($this->socketPool);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class Exception_GeneralException extends Exception {
|
|||
* @param string $message
|
||||
* @param int $code
|
||||
*/
|
||||
function __construct($message = "", $code = 0) {
|
||||
public function __construct($message = "", $code = 0) {
|
||||
if ($message === "") {
|
||||
throw new $this('Unknown '. get_class($this));
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class Misc_Buffer {
|
|||
* @param $linebreak
|
||||
* @return void
|
||||
*/
|
||||
function __construct($linebreak = "") {
|
||||
public function __construct($linebreak = "") {
|
||||
$this->buffer = "";
|
||||
$this->linebreak = $linebreak;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ abstract class Protocol_AbstractProtocolContentObject {
|
|||
* Sets the raw data.
|
||||
* @return void
|
||||
*/
|
||||
function __construct($rawData) {
|
||||
public function __construct($rawData) {
|
||||
$this->rawData = $rawData;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ abstract class Protocol_AbstractProtocolHandler {
|
|||
* Calls createBuffers()
|
||||
* @return void
|
||||
*/
|
||||
function __construct() {
|
||||
public function __construct() {
|
||||
$this->createBuffers();
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ class Socket_SocketHandler {
|
|||
* @param ressource $socket
|
||||
* @return void
|
||||
*/
|
||||
function __construct($socket) {
|
||||
public function __construct($socket) {
|
||||
if(is_resource($socket) === FALSE) throw new Exception_SocketException("Invalid socket ressource!", 1289663108);
|
||||
$this->socket = $socket;
|
||||
$this->is_bound = FALSE;
|
||||
|
@ -46,7 +46,7 @@ class Socket_SocketHandler {
|
|||
* Destructor. Closes socket.
|
||||
* @return void
|
||||
*/
|
||||
function __destruct() {
|
||||
public function __destruct() {
|
||||
$this->close();
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class Socket_SocketPool {
|
|||
* Creates sockets.
|
||||
* @return void
|
||||
*/
|
||||
function __construct() {
|
||||
public function __construct() {
|
||||
$this->sockets = array();
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ class Socket_SocketPool {
|
|||
* Closes all connections.
|
||||
* @return void
|
||||
*/
|
||||
function __destruct() {
|
||||
public function __destruct() {
|
||||
unset($this->sockets);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue