Skip to content

Commit

Permalink
Merge pull request #11 from derrabus/deprecate-legacy-constructors
Browse files Browse the repository at this point in the history
Deprecate php-4-style constructors
  • Loading branch information
CloCkWeRX committed Nov 11, 2015
2 parents 51a84c7 + 40b6357 commit b1ec3a7
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 43 deletions.
4 changes: 4 additions & 0 deletions Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ class Log
'%{class}' => '%8$s',
'%\{' => '%%{');

public function __construct()
{
}

/**
* Attempts to return a concrete Log instance of type $handler.
*
Expand Down
12 changes: 6 additions & 6 deletions Log/composite.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ class Log_composite extends Log
/**
* Constructs a new composite Log object.
*
* @param boolean $name This parameter is ignored.
* @param boolean $ident This parameter is ignored.
* @param boolean $conf This parameter is ignored.
* @param boolean $level This parameter is ignored.
* @param string $name This parameter is ignored.
* @param string $ident This parameter is ignored.
* @param array $conf This parameter is ignored.
* @param int $level This parameter is ignored.
*
* @access public
*/
function Log_composite($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_ident = $ident;
}
Expand Down
6 changes: 3 additions & 3 deletions Log/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ class Log_console extends Log

/**
* Constructs a new Log_console object.
*
*
* @param string $name Ignored.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_console($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_ident = $ident;
Expand Down
13 changes: 6 additions & 7 deletions Log/daemon.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,17 @@ class Log_daemon extends Log
*/
var $_timeout = 1;


/**
* Constructs a new syslog object.
*
* @param string $name The syslog facility.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $maxLevel Maximum level at which to log.
* @param string $name The syslog facility.
* @param string $ident The identity string.
* @param array $conf The configuration array.
* @param int $level Maximum level at which to log.
* @access public
*/
function Log_daemon($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
/* Ensure we have a valid integer value for $name. */
if (empty($name) || !is_int($name)) {
Expand Down
4 changes: 2 additions & 2 deletions Log/display.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class Log_display extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_display($name = '', $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name = '', $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_ident = $ident;
Expand Down
4 changes: 2 additions & 2 deletions Log/error_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ class Log_error_log extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_error_log($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_type = $name;
Expand Down
4 changes: 2 additions & 2 deletions Log/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ class Log_file extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_file($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_filename = $name;
Expand Down
4 changes: 2 additions & 2 deletions Log/firebug.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class Log_firebug extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_firebug($name = '', $ident = 'PHP', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name = '', $ident = 'PHP', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_ident = $ident;
Expand Down
4 changes: 2 additions & 2 deletions Log/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ class Log_mail extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_mail($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_recipients = $name;
Expand Down
5 changes: 2 additions & 3 deletions Log/mcal.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class Log_mcal extends Log
*/
var $_name = LOG_SYSLOG;


/**
* Constructs a new Log_mcal object.
*
Expand All @@ -71,8 +70,8 @@ class Log_mcal extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_mcal($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_name = $name;
Expand Down
4 changes: 2 additions & 2 deletions Log/mdb2.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class Log_mdb2 extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_mdb2($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_table = $name;
Expand Down
4 changes: 2 additions & 2 deletions Log/null.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class Log_null extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_null($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_ident = $ident;
Expand Down
2 changes: 1 addition & 1 deletion Log/observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Log_observer
*
* @access public
*/
function Log_observer($priority = PEAR_LOG_INFO)
public function __construct($priority = PEAR_LOG_INFO)
{
$this->_id = md5(microtime());
$this->_priority = $priority;
Expand Down
5 changes: 2 additions & 3 deletions Log/sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ class Log_sql extends Log
*/
var $_identLimit = 16;


/**
* Constructs a new sql logging object.
*
Expand All @@ -117,8 +116,8 @@ class Log_sql extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_sql($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_table = $name;
Expand Down
3 changes: 1 addition & 2 deletions Log/sqlite.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class Log_sqlite extends Log
*/
var $_table = 'log_table';


/**
* Constructs a new sql logging object.
*
Expand All @@ -71,7 +70,7 @@ class Log_sqlite extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_sqlite($name, $ident = '', &$conf, $level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', &$conf, $level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_table = $name;
Expand Down
4 changes: 2 additions & 2 deletions Log/syslog.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class Log_syslog extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_syslog($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
/* Ensure we have a valid integer value for $name. */
if (empty($name) || !is_int($name)) {
Expand Down
4 changes: 2 additions & 2 deletions Log/win.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class Log_win extends Log
* @param int $level Log messages up to and including this level.
* @access public
*/
function Log_win($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
public function __construct($name, $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$this->_id = md5(microtime());
$this->_name = str_replace(' ', '_', $name);
Expand Down

0 comments on commit b1ec3a7

Please sign in to comment.