summaryrefslogtreecommitdiff
path: root/inc/Sitemapper.php
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2012-08-24 14:20:07 +0200
committerMichael Hamann <michael@content-space.de>2012-08-24 16:50:07 +0200
commitb4cf5bda664e6bdb1dfeccc62fd6e24e573c5066 (patch)
tree8b03bd6570615f87b93ac9db80af8f8052421bf5 /inc/Sitemapper.php
parent65f6e7d681429606c80d257b157e2af13f11e67a (diff)
downloadrpg-b4cf5bda664e6bdb1dfeccc62fd6e24e573c5066.tar.gz
rpg-b4cf5bda664e6bdb1dfeccc62fd6e24e573c5066.tar.bz2
Fix return types and result value handling in Sitemapper.php
Diffstat (limited to 'inc/Sitemapper.php')
-rw-r--r--inc/Sitemapper.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/inc/Sitemapper.php b/inc/Sitemapper.php
index 1315ed448..bf89a311c 100644
--- a/inc/Sitemapper.php
+++ b/inc/Sitemapper.php
@@ -63,11 +63,11 @@ class Sitemapper {
$event = new Doku_Event('SITEMAP_GENERATE', $eventData);
if ($event->advise_before(true)) {
//save the new sitemap
- $result = io_saveFile($sitemap, Sitemapper::getXML($items));
+ $event->result = io_saveFile($sitemap, Sitemapper::getXML($items));
}
$event->advise_after();
- return $result;
+ return $event->result;
}
/**
@@ -82,6 +82,7 @@ class Sitemapper {
echo '<?xml version="1.0" encoding="UTF-8"?>'.NL;
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'.NL;
foreach ($items as $item) {
+ /** @var SitemapItem $item */
echo $item->toXML();
}
echo '</urlset>'.NL;
@@ -93,7 +94,7 @@ class Sitemapper {
/**
* Helper function for getting the path to the sitemap file.
*
- * @return The path to the sitemap file.
+ * @return string The path to the sitemap file.
* @author Michael Hamann
*/
public static function getFilePath() {
@@ -185,7 +186,7 @@ class SitemapItem {
* @param $id string A wikipage id.
* @param $changefreq string How frequently the item is likely to change. Valid values: always, hourly, daily, weekly, monthly, yearly, never.
* @param $priority float|string The priority of the item relative to other URLs on your site. Valid values range from 0.0 to 1.0.
- * @return The sitemap item.
+ * @return SitemapItem The sitemap item.
*/
public static function createFromID($id, $changefreq = null, $priority = null) {
$id = trim($id);
@@ -197,7 +198,7 @@ class SitemapItem {
/**
* Get the XML representation of the sitemap item.
*
- * @return The XML representation.
+ * @return string The XML representation.
*/
public function toXML() {
$result = ' <url>'.NL