1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 09:04:38 +02:00

Generated PHPDoc for all classes in e107_handlers where one was missing. toNumber() updated to always return int or float.

This commit is contained in:
Cameron
2022-04-04 10:54:24 -07:00
parent 813f2bf38f
commit 55980a29a8
104 changed files with 5498 additions and 1221 deletions

View File

@@ -142,8 +142,14 @@ class MagpieRSS {
$this->normalize();
}
function feed_start_element($p, $element, $attrs) {
/**
* @param $p
* @param $element
* @param $attrs
* @return void
*/
function feed_start_element($p, $element, $attrs) {
$el = $element = strtolower($element);
$attrs = array_change_key_case($attrs, CASE_LOWER);
@@ -254,10 +260,14 @@ class MagpieRSS {
array_unshift($this->stack, $el);
}
}
function feed_cdata ($p, $text) {
/**
* @param $p
* @param $text
* @return void
*/
function feed_cdata ($p, $text) {
if ($this->feed_type == ATOM and $this->incontent)
{
@@ -268,8 +278,13 @@ class MagpieRSS {
$this->append($current_el, $text);
}
}
function feed_end_element ($p, $el) {
/**
* @param $p
* @param $el
* @return void
*/
function feed_end_element ($p, $el) {
$el = strtolower($el);
if ( $el == 'item' or $el == 'entry' )
@@ -313,17 +328,25 @@ class MagpieRSS {
$this->current_namespace = false;
}
function concat (&$str1, $str2 = "") {
/**
* @param $str1
* @param $str2
* @return void
*/
function concat (&$str1, $str2 = "") {
if (!isset($str1) ) {
$str1 = "";
}
$str1 .= $str2;
}
function append_content($text) {
/**
* @param $text
* @return void
*/
function append_content($text) {
if ( $this->initem ) {
$this->concat( $this->current_item[ $this->incontent ], $text );
}
@@ -333,7 +356,13 @@ class MagpieRSS {
}
// smart append - field and namespace aware
function append($el, $text) {
/**
* @param $el
* @param $text
* @return void
*/
function append($el, $text) {
if (!$el) {
return;
}
@@ -376,8 +405,11 @@ class MagpieRSS {
}
}
function normalize () {
/**
* @return void
*/
function normalize () {
// if atom populate rss fields
if ( $this->is_atom() ) {
$this->channel['description'] = $this->channel['tagline'];
@@ -425,9 +457,12 @@ class MagpieRSS {
}
}
}
function is_rss () {
/**
* @return false
*/
function is_rss () {
if ( $this->feed_type == RSS ) {
return $this->feed_version;
}
@@ -435,8 +470,11 @@ class MagpieRSS {
return false;
}
}
function is_atom() {
/**
* @return false
*/
function is_atom() {
if ( $this->feed_type == ATOM ) {
return $this->feed_version;
}
@@ -546,8 +584,12 @@ class MagpieRSS {
return array(xml_parser_create(), $source);
}
function known_encoding($enc) {
/**
* @param $enc
* @return false|string
*/
function known_encoding($enc) {
$enc = strtoupper($enc);
if ( in_array($enc, $this->_KNOWN_ENCODINGS) ) {
return $enc;
@@ -557,7 +599,12 @@ class MagpieRSS {
}
}
function error ($errormsg, $lvl=E_USER_WARNING) {
/**
* @param $errormsg
* @param $lvl
* @return void
*/
function error ($errormsg, $lvl=E_USER_WARNING) {
// append PHP's error message if track_errors enabled
/* if ( $php_errormsg ) {
$errormsg .= " ({$php_errormsg})";
@@ -580,11 +627,20 @@ class MagpieRSS {
} // end class RSS
/**
* @param $k
* @param $v
* @return string
*/
function map_attrs($k, $v) {
return "$k=\"$v\"";
}
function parse_w3cdtf ( $date_str ) {
/**
* @param $date_str
* @return false|float|int
*/
function parse_w3cdtf ($date_str ) {
# regex to match wc3dtf
$pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/";