mirror of
https://github.com/slawkens/myaac.git
synced 2026-04-23 19:03:31 +02:00
[WIP] Refactoring - Uniform error message + TOML exception catch
This commit is contained in:
@@ -16,8 +16,12 @@ class Outfits
|
||||
return;
|
||||
}
|
||||
|
||||
$xml = new \DOMDocument;
|
||||
$xml->load($file);
|
||||
$xml = new \DOMDocument();
|
||||
if(!$xml->load($file)) {
|
||||
error('Error: Cannot load outfits.xml. More info in system/logs/error.log file.');
|
||||
log_append('error.log', "[" . __CLASS__ . "] Fatal error: Cannot load outfits.xml - $file. Error: " . print_r(error_get_last(), true));
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($xml->getElementsByTagName('outfit') as $outfit) {
|
||||
$this->outfits[] = $this->parseOutfitNode($outfit);
|
||||
@@ -43,7 +47,7 @@ class Outfits
|
||||
];
|
||||
}
|
||||
|
||||
public function getOutfits(): array {
|
||||
public function get(): array {
|
||||
return $this->outfits;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user