From f02c4aa4c4cf778ea72c822c1075abbb629f3cb6 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 12 Jun 2020 23:53:09 +0900 Subject: [PATCH] Remove object return type declaration for compatibility with PHP < 7.2 --- common/framework/parsers/moduleactionparser.php | 8 ++++---- common/framework/parsers/moduleinfoparser.php | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/framework/parsers/moduleactionparser.php b/common/framework/parsers/moduleactionparser.php index 8fd6912a2..98e520658 100644 --- a/common/framework/parsers/moduleactionparser.php +++ b/common/framework/parsers/moduleactionparser.php @@ -24,15 +24,15 @@ class ModuleActionParser * Load an XML file. * * @param string $filename - * @return object + * @return object|false */ - public static function loadXML(string $filename): object + public static function loadXML(string $filename) { // Load the XML file. $xml = simplexml_load_file($filename); if ($xml === false) { - return new \stdClass; + return false; } // Get the current language. @@ -178,7 +178,7 @@ class ModuleActionParser * @param string $route * @return object */ - public static function analyzeRoute(string $route): object + public static function analyzeRoute(string $route) { // Replace variables in the route definition into appropriate regexp. $var_regexp = '#\\$([a-z0-9_]+)(?::(' . implode('|', array_keys(self::$_shortcuts)) . '))?#i'; diff --git a/common/framework/parsers/moduleinfoparser.php b/common/framework/parsers/moduleinfoparser.php index 618f30e5d..c8cfd018e 100644 --- a/common/framework/parsers/moduleinfoparser.php +++ b/common/framework/parsers/moduleinfoparser.php @@ -11,15 +11,15 @@ class ModuleInfoParser * Load an XML file. * * @param string $filename - * @return object + * @return object|false */ - public static function loadXML(string $filename): object + public static function loadXML(string $filename) { // Load the XML file. $xml = simplexml_load_file($filename); if ($xml === false) { - return new \stdClass; + return false; } // Get the current language.