Config: throw AssumptionFailedError if config type is invalid or DETECT during save()

this should never happen ... it was already checked in load()
This commit is contained in:
Dylan K. Taylor 2021-11-02 16:03:43 +00:00
parent 8b3565b75d
commit 4eef458d29
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -205,8 +205,6 @@ class Config{
/**
* Flushes the config to disk in the appropriate format.
*
* @throws \InvalidStateException if config type is not valid
*/
public function save() : void{
$content = null;
@ -227,7 +225,7 @@ class Config{
$content = self::writeList(array_keys($this->config));
break;
default:
throw new \InvalidStateException("Config type is unknown, has not been set or not detected");
throw new AssumptionFailedError("Config type is unknown, has not been set or not detected");
}
file_put_contents($this->file, $content);