Develop one-liner in Item\Compose

2022.09-rc
Hypolite Petovan 2019-07-27 18:06:47 -04:00
rodzic 361958ad04
commit cb38fe4e72
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -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;
}
}