PermissionParser: remove hardcoded default strings in defaultFromString()

This commit is contained in:
Dylan K. Taylor 2022-12-23 16:03:01 +00:00
parent 43e69041fc
commit 51a684c0ea
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -64,11 +64,7 @@ class PermissionParser{
*/
public static function defaultFromString($value) : string{
if(is_bool($value)){
if($value){
return "true";
}else{
return "false";
}
return $value ? self::DEFAULT_TRUE : self::DEFAULT_FALSE;
}
$lower = strtolower($value);
if(isset(self::DEFAULT_STRING_MAP[$lower])){