From 8381d1c12c09df8fe72bac997487210bf08b8e5f Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Sat, 16 May 2015 12:49:55 +0200 Subject: update to __construct --- inc/cliopts.php | 4 ++-- inc/feedcreator.class.php | 52 ++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/inc/cliopts.php b/inc/cliopts.php index 7d71c7dc9..d7d06119a 100644 --- a/inc/cliopts.php +++ b/inc/cliopts.php @@ -447,7 +447,7 @@ class Doku_Cli_Opts_Error { var $code; var $msg; - function Doku_Cli_Opts_Error($code, $msg) { + function __construct($code, $msg) { $this->code = $code; $this->msg = $msg; } @@ -468,7 +468,7 @@ class Doku_Cli_Opts_Container { var $options = array(); var $args = array(); - function Doku_Cli_Opts_Container($options) { + function __construct($options) { foreach ( $options[0] as $option ) { if ( false !== ( strpos($option[0], '--') ) ) { $opt_name = substr($option[0], 2); diff --git a/inc/feedcreator.class.php b/inc/feedcreator.class.php index b90da5724..dd6da4465 100644 --- a/inc/feedcreator.class.php +++ b/inc/feedcreator.class.php @@ -129,6 +129,9 @@ class FeedItem extends HtmlDescribable { // var $source; } +/** + * Class EnclosureItem + */ class EnclosureItem extends HtmlDescribable { /* * @@ -226,7 +229,7 @@ class FeedHtmlField { * Creates a new instance of FeedHtmlField. * @param string $parFieldContent: if given, sets the rawFieldContent property */ - function FeedHtmlField($parFieldContent) { + function __construct($parFieldContent) { if ($parFieldContent) { $this->rawFieldContent = $parFieldContent; } @@ -604,6 +607,8 @@ class FeedCreator extends HtmlDescribable { /** * @since 1.4 * @access private + * + * @param string $filename */ function _redirect($filename) { // attention, heavily-commented-out-area @@ -697,7 +702,7 @@ class FeedDate { * Accepts RFC 822, ISO 8601 date formats as well as unix time stamps. * @param mixed $dateString optional the date this FeedDate will represent. If not specified, the current date and time is used. */ - function FeedDate($dateString="") { + function __construct($dateString="") { if ($dateString=="") $dateString = date("r"); if (is_numeric($dateString)) { @@ -878,7 +883,10 @@ class RSSCreator091 extends FeedCreator { */ var $RSSVersion; - function RSSCreator091() { + /** + * Constructor + */ + function __construct() { $this->_setRSSVersion("0.91"); $this->contentType = "application/rss+xml"; } @@ -886,6 +894,8 @@ class RSSCreator091 extends FeedCreator { /** * Sets this RSS feed's version number. * @access private + * + * @param $version */ function _setRSSVersion($version) { $this->RSSVersion = $version; @@ -1034,7 +1044,10 @@ class RSSCreator091 extends FeedCreator { */ class RSSCreator20 extends RSSCreator091 { - function RSSCreator20() { + /** + * Constructor + */ + function __construct() { parent::_setRSSVersion("2.0"); } @@ -1051,7 +1064,10 @@ class RSSCreator20 extends RSSCreator091 { */ class PIECreator01 extends FeedCreator { - function PIECreator01() { + /** + * Constructor + */ + function __construct() { $this->encoding = "utf-8"; } @@ -1113,7 +1129,10 @@ class PIECreator01 extends FeedCreator { */ class AtomCreator10 extends FeedCreator { - function AtomCreator10() { + /** + * Constructor + */ + function __construct() { $this->contentType = "application/atom+xml"; $this->encoding = "utf-8"; } @@ -1200,7 +1219,10 @@ class AtomCreator10 extends FeedCreator { */ class AtomCreator03 extends FeedCreator { - function AtomCreator03() { + /** + * Constructor + */ + function __construct() { $this->contentType = "application/atom+xml"; $this->encoding = "utf-8"; } @@ -1272,12 +1294,19 @@ class AtomCreator03 extends FeedCreator { * @author Kai Blankenhorn */ class MBOXCreator extends FeedCreator { - - function MBOXCreator() { + /** + * Constructor + */ + function __construct() { $this->contentType = "text/plain"; $this->encoding = "utf-8"; } + /** + * @param string $input + * @param int $line_max + * @return string + */ function qp_enc($input = "", $line_max = 76) { $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); $lines = preg_split("/(?:\r\n|\r|\n)/", $input); @@ -1363,7 +1392,10 @@ class MBOXCreator extends FeedCreator { */ class OPMLCreator extends FeedCreator { - function OPMLCreator() { + /** + * Constructor + */ + function __construct() { $this->encoding = "utf-8"; } -- cgit v1.2.3 From 4a0a77adb7e7e218beb1e58d7b0ef3ae17f4a612 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Sat, 16 May 2015 12:50:37 +0200 Subject: var declaration, static declaration --- inc/feedcreator.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/feedcreator.class.php b/inc/feedcreator.class.php index dd6da4465..fe444b39b 100644 --- a/inc/feedcreator.class.php +++ b/inc/feedcreator.class.php @@ -485,6 +485,8 @@ class FeedCreator extends HtmlDescribable { var $additionalElements = Array(); + var $_timeout; + /** * Adds an FeedItem to the feed. * @@ -508,7 +510,7 @@ class FeedCreator extends HtmlDescribable { * @param int $length the maximum length the string should be truncated to * @return string the truncated string */ - function iTrunc($string, $length) { + static function iTrunc($string, $length) { if (strlen($string)<=$length) { return $string; } -- cgit v1.2.3 From 144055c8fa7b544201172cc89abf15f8c443e6e9 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Sat, 16 May 2015 15:12:06 +0200 Subject: PHPDocs --- lib/plugins/action.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/plugins/action.php b/lib/plugins/action.php index 4b5eef60a..23d94a509 100644 --- a/lib/plugins/action.php +++ b/lib/plugins/action.php @@ -16,6 +16,8 @@ class DokuWiki_Action_Plugin extends DokuWiki_Plugin { /** * Registers a callback function for a given event + * + * @param Doku_Event_Handler $controller */ public function register(Doku_Event_Handler $controller) { trigger_error('register() not implemented in '.get_class($this), E_USER_WARNING); -- cgit v1.2.3 From c175e043e167877c54c7823870ab7a75141b062e Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Sat, 16 May 2015 19:57:56 +0200 Subject: __construct --- lib/plugins/config/settings/extra.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins/config/settings/extra.class.php b/lib/plugins/config/settings/extra.class.php index c6a3f9dae..2445577d1 100644 --- a/lib/plugins/config/settings/extra.class.php +++ b/lib/plugins/config/settings/extra.class.php @@ -15,7 +15,7 @@ if (!class_exists('setting_sepchar')) { * @param string $key * @param array|null $param array with metadata of setting */ - function setting_sepchar($key,$param=null) { + function __construct($key,$param=null) { $str = '_-.'; for ($i=0;$i_choices[] = $str{$i}; -- cgit v1.2.3