mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-25 13:22:16 +09:00
Clean up missing or inconsistent types in Lang, ModuleAction, ModuleInfo parser classes
This commit is contained in:
parent
df6fdd3bc3
commit
141ee7f7e1
3 changed files with 17 additions and 14 deletions
|
|
@ -25,15 +25,15 @@ class ModuleActionParser extends BaseParser
|
|||
* Load an XML file.
|
||||
*
|
||||
* @param string $filename
|
||||
* @return object|false
|
||||
* @return ?object
|
||||
*/
|
||||
public static function loadXML(string $filename)
|
||||
public static function loadXML(string $filename): ?object
|
||||
{
|
||||
// Load the XML file.
|
||||
$xml = simplexml_load_string(file_get_contents($filename));
|
||||
if ($xml === false)
|
||||
{
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Get the current language.
|
||||
|
|
@ -323,7 +323,7 @@ class ModuleActionParser extends BaseParser
|
|||
* @param array $route
|
||||
* @return object
|
||||
*/
|
||||
public static function analyzeRoute(array $route)
|
||||
public static function analyzeRoute(array $route): object
|
||||
{
|
||||
// Replace variables in the route definition into appropriate regexp.
|
||||
$var_regexp = '#\\$([a-zA-Z0-9_]+)(?::(' . implode('|', array_keys(self::$_shortcuts)) . '))?#';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue