Remove object return type declaration for compatibility with PHP < 7.2

This commit is contained in:
Kijin Sung 2020-06-12 23:53:09 +09:00
parent eb2c9d0aed
commit f02c4aa4c4
2 changed files with 7 additions and 7 deletions

View file

@ -24,15 +24,15 @@ class ModuleActionParser
* Load an XML file. * Load an XML file.
* *
* @param string $filename * @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. // Load the XML file.
$xml = simplexml_load_file($filename); $xml = simplexml_load_file($filename);
if ($xml === false) if ($xml === false)
{ {
return new \stdClass; return false;
} }
// Get the current language. // Get the current language.
@ -178,7 +178,7 @@ class ModuleActionParser
* @param string $route * @param string $route
* @return object * @return object
*/ */
public static function analyzeRoute(string $route): object public static function analyzeRoute(string $route)
{ {
// Replace variables in the route definition into appropriate regexp. // Replace variables in the route definition into appropriate regexp.
$var_regexp = '#\\$([a-z0-9_]+)(?::(' . implode('|', array_keys(self::$_shortcuts)) . '))?#i'; $var_regexp = '#\\$([a-z0-9_]+)(?::(' . implode('|', array_keys(self::$_shortcuts)) . '))?#i';

View file

@ -11,15 +11,15 @@ class ModuleInfoParser
* Load an XML file. * Load an XML file.
* *
* @param string $filename * @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. // Load the XML file.
$xml = simplexml_load_file($filename); $xml = simplexml_load_file($filename);
if ($xml === false) if ($xml === false)
{ {
return new \stdClass; return false;
} }
// Get the current language. // Get the current language.