[TASK] Made all constuctors and destructors public.

[TASK] Added some DocComments for the IrcClient.
This commit is contained in:
Jan Philipp Timme 2010-12-18 14:42:56 +00:00
parent 03a4dfff71
commit 26036e9994
11 changed files with 39 additions and 16 deletions

View File

@ -10,7 +10,7 @@ class Client_BotClient extends Client_AbstractClient {
/**
* Default constructor.
*/
function __construct() {
public function __construct() {
}

View File

@ -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);
}

View File

@ -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();

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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));
}

View File

@ -26,7 +26,7 @@ class Misc_Buffer {
* @param $linebreak
* @return void
*/
function __construct($linebreak = "") {
public function __construct($linebreak = "") {
$this->buffer = "";
$this->linebreak = $linebreak;
}

View File

@ -20,7 +20,7 @@ abstract class Protocol_AbstractProtocolContentObject {
* Sets the raw data.
* @return void
*/
function __construct($rawData) {
public function __construct($rawData) {
$this->rawData = $rawData;
}

View File

@ -36,7 +36,7 @@ abstract class Protocol_AbstractProtocolHandler {
* Calls createBuffers()
* @return void
*/
function __construct() {
public function __construct() {
$this->createBuffers();
}

View File

@ -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();
}

View File

@ -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);
}