mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
Fix potential type error in editor component XML handling logic
This commit is contained in:
parent
db4e874660
commit
df6fdd3bc3
2 changed files with 9 additions and 7 deletions
|
|
@ -13,15 +13,15 @@ class EditorComponentParser extends BaseParser
|
|||
* @param string $filename
|
||||
* @param string $component_name
|
||||
* @param string $lang
|
||||
* @return object|false
|
||||
* @return ?object
|
||||
*/
|
||||
public static function loadXML(string $filename, string $component_name, string $lang = '')
|
||||
public static function loadXML(string $filename, string $component_name, string $lang = ''): ?object
|
||||
{
|
||||
// Load the XML file.
|
||||
$xml = simplexml_load_string(file_get_contents($filename));
|
||||
if ($xml === false)
|
||||
{
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Get the current language.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue