Develop one-liner in Item\Compose

This commit is contained in:
Hypolite Petovan 2019-07-27 18:06:47 -04:00
parent 361958ad04
commit cb38fe4e72

View file

@ -47,8 +47,12 @@ class Compose extends BaseModule
$posttype = $a->argv[1] ?? Item::PT_ARTICLE;
if (!in_array($posttype, [Item::PT_ARTICLE, Item::PT_PERSONAL_NOTE])) {
switch ($posttype) {
case 'note': $posttype = Item::PT_PERSONAL_NOTE; break;
default: $posttype = Item::PT_ARTICLE; break;
case 'note':
$posttype = Item::PT_PERSONAL_NOTE;
break;
default:
$posttype = Item::PT_ARTICLE;
break;
}
}