[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. * Default constructor.
*/ */
function __construct() { public function __construct() {
} }

View File

@ -43,7 +43,7 @@ class Client_ClientManager {
* Default constructor. * Default constructor.
* @return void * @return void
*/ */
function __construct() { public function __construct() {
$this->connectionPool = new Connection_ConnectionPool(); $this->connectionPool = new Connection_ConnectionPool();
$this->clientPool = array(); $this->clientPool = array();
$this->registeredProtocols = array(); $this->registeredProtocols = array();
@ -55,7 +55,7 @@ class Client_ClientManager {
* Default destructor. Closes connections before being killed. * Default destructor. Closes connections before being killed.
* @return void * @return void
*/ */
function __destruct() { public function __destruct() {
unset($this->clientPool); unset($this->clientPool);
unset($this->connectionPool); unset($this->connectionPool);
} }

View File

@ -7,18 +7,41 @@
*/ */
class Client_IrcClient extends Client_AbstractClient { class Client_IrcClient extends Client_AbstractClient {
/**
* @var boolean
*/
protected $got_001; protected $got_001;
/**
* @var boolean
*/
protected $joined; protected $joined;
/**
* @var boolean
*/
protected $authed; protected $authed;
/**
* @var string
*/
protected $nick; protected $nick;
/**
* @var array
*/
protected $channels; protected $channels;
/**
* @var int
*/
protected $lines; protected $lines;
/** /**
* Default constructor. * Default constructor.
* @return void * @return void
*/ */
function __construct() { public function __construct() {
$this->nick = "Serena"; $this->nick = "Serena";
$this->channels = array(); $this->channels = array();
$this->resetConnectionStatus(); $this->resetConnectionStatus();

View File

@ -87,7 +87,7 @@ class Connection_ConnectionHandler {
* @param $linebreak * @param $linebreak
* @return void * @return void
*/ */
function __construct($socket, $id, $group = "", $protocol = "") { public function __construct($socket, $id, $group = "", $protocol = "") {
$this->buffer_incoming = new Misc_Buffer(); $this->buffer_incoming = new Misc_Buffer();
$this->buffer_outgoing = new Misc_Buffer(); $this->buffer_outgoing = new Misc_Buffer();
$this->socketHandler = new Socket_SocketHandler($socket); $this->socketHandler = new Socket_SocketHandler($socket);
@ -105,7 +105,7 @@ class Connection_ConnectionHandler {
* Calls parent destructor. * Calls parent destructor.
* @return void * @return void
*/ */
function __destruct() { public function __destruct() {
unset($this->socketHandler); unset($this->socketHandler);
} }

View File

@ -28,7 +28,7 @@ class Connection_ConnectionPool {
* Creates an Instance of SocketPool * Creates an Instance of SocketPool
* @return void * @return void
*/ */
function __construct() { public function __construct() {
$this->connectionHandlers = array(); $this->connectionHandlers = array();
$this->socketPool = new Socket_SocketPool(); $this->socketPool = new Socket_SocketPool();
$this->nextID = 1; $this->nextID = 1;
@ -38,7 +38,7 @@ class Connection_ConnectionPool {
* Destroys the SocketPool * Destroys the SocketPool
* @return void * @return void
*/ */
function __destruct() { public function __destruct() {
unset($this->socketPool); unset($this->socketPool);
} }

View File

@ -13,7 +13,7 @@ class Exception_GeneralException extends Exception {
* @param string $message * @param string $message
* @param int $code * @param int $code
*/ */
function __construct($message = "", $code = 0) { public function __construct($message = "", $code = 0) {
if ($message === "") { if ($message === "") {
throw new $this('Unknown '. get_class($this)); throw new $this('Unknown '. get_class($this));
} }

View File

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

View File

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

View File

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

View File

@ -34,7 +34,7 @@ class Socket_SocketHandler {
* @param ressource $socket * @param ressource $socket
* @return void * @return void
*/ */
function __construct($socket) { public function __construct($socket) {
if(is_resource($socket) === FALSE) throw new Exception_SocketException("Invalid socket ressource!", 1289663108); if(is_resource($socket) === FALSE) throw new Exception_SocketException("Invalid socket ressource!", 1289663108);
$this->socket = $socket; $this->socket = $socket;
$this->is_bound = FALSE; $this->is_bound = FALSE;
@ -46,7 +46,7 @@ class Socket_SocketHandler {
* Destructor. Closes socket. * Destructor. Closes socket.
* @return void * @return void
*/ */
function __destruct() { public function __destruct() {
$this->close(); $this->close();
} }

View File

@ -17,7 +17,7 @@ class Socket_SocketPool {
* Creates sockets. * Creates sockets.
* @return void * @return void
*/ */
function __construct() { public function __construct() {
$this->sockets = array(); $this->sockets = array();
} }
@ -25,7 +25,7 @@ class Socket_SocketPool {
* Closes all connections. * Closes all connections.
* @return void * @return void
*/ */
function __destruct() { public function __destruct() {
unset($this->sockets); unset($this->sockets);
} }