本文整理匯總了PHP中Assert::noMessages方法的典型用法代碼示例。如果您正苦於以下問題:PHP Assert::noMessages方法的具體用法?PHP Assert::noMessages怎麽用?PHP Assert::noMessages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Assert
的用法示例。
在下文中一共展示了Assert::noMessages方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: responseAction
public function responseAction()
{
$id = $this->dispatcher->getParam('id', 'uint', 0);
$file = $this->dispatcher->getParam('file', 'string', '');
$job = Job::findFirst(['executed_at is null and job_id = ?0', 'bind' => [$id]]);
if ($job) {
$job->save(['response' => file_get_contents($file), 'executed_at' => date('Y-m-d H:i:s')]);
Assert::noMessages($job);
} else {
echo "JOB {$id} NOT FOUND\n";
}
}
示例2: executeAction
public function executeAction()
{
Assert::found($id = (int) $this->dispatcher->getParam('0', 'uint'));
Assert::found($task = Task::findFirst($id), "Task not found");
$job = Job::findFirst(['task_id = ?0 and executed_at is null', 'bind' => [$task->task_id]]);
if (!$job) {
$job = new Job();
$job->save(['task_id' => $task->task_id]);
Assert::noMessages($job);
}
return $this->response->redirect('/task/run/' . $job->job_id, true);
}