feat: 중원 정세에 메시지를 출력하는 Event Action 추가

This commit is contained in:
2022-05-11 01:58:12 +09:00
parent 4ca929d47d
commit 5bc31c91fa
@@ -0,0 +1,23 @@
<?php
namespace sammo\Event\Action;
use RuntimeException;
use sammo\ActionLogger;
class NoticeToHistoryLog extends \sammo\Event\Action
{
public function __construct(private string $msg)
{
}
public function run(array $env)
{
if(!key_exists('year', $env) && !key_exists('month', $env)){
throw new RuntimeException('year, month가 없음');
}
$logger = new ActionLogger(0, 0, $env['year'], $env['month']);
$logger->pushGlobalHistoryLog($this->msg);
$logger->flush();
}
}