From 4b5894817e459cdb08b5774e8f4ab97dbddd677d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 17 Dec 2017 15:29:16 -0500 Subject: [PATCH] Fix class methods staticity/return value --- src/App.php | 6 ++---- src/Protocol/Diaspora.php | 4 ++-- src/Protocol/Feed.php | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/App.php b/src/App.php index b16786140..95a2e99d6 100644 --- a/src/App.php +++ b/src/App.php @@ -312,10 +312,8 @@ class App { * * @return string */ - public static function get_basepath() { - if (isset($this)) { - $basepath = $this->basepath; - } + public function get_basepath() { + $basepath = $this->basepath; if (! $basepath) { $basepath = Config::get('system', 'basepath'); diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 5ae63bd7a..321df6d28 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -1094,7 +1094,7 @@ class Diaspora preg_replace_callback( $expression, function ($match) use ($item) { - return self::fetchGuidSub($match, $item); + self::fetchGuidSub($match, $item); }, $item["body"] ); @@ -1102,7 +1102,7 @@ class Diaspora preg_replace_callback( "&\[url=/posts/([^\[\]]*)\](.*)\[\/url\]&Usi", function ($match) use ($item) { - return self::fetchGuidSub($match, $item); + self::fetchGuidSub($match, $item); }, $item["body"] ); diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index 629c2bfdd..63706dcd6 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -32,7 +32,7 @@ class Feed { * * @return array In simulation mode it returns the header and the first item */ - function import($xml, $importer, &$contact, &$hub, $simulate = false) { + public static function import($xml, $importer, &$contact, &$hub, $simulate = false) { $a = get_app();