本文整理汇总了PHP中Symfony\Component\HttpFoundation\Response::isInformational方法的典型用法代码示例。如果您正苦于以下问题:PHP Response::isInformational方法的具体用法?PHP Response::isInformational怎么用?PHP Response::isInformational使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\HttpFoundation\Response
的用法示例。
在下文中一共展示了Response::isInformational方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getParameters
/**
* {@inheritdoc}
*/
public function getParameters()
{
$code = null;
$codeType = null;
$cacheable = null;
if (null !== $this->response) {
$code = sprintf('%d', $this->response->getStatusCode());
$cacheable = $this->response->isCacheable() ? 'cacheable' : 'not_cacheable';
if ($this->response->isInformational()) {
$codeType = 'informational';
} elseif ($this->response->isSuccessful()) {
$codeType = 'successful';
} elseif ($this->response->isRedirection()) {
$codeType = 'redirection';
} elseif ($this->response->isClientError()) {
$codeType = 'client_error';
} elseif ($this->response->isServerError()) {
$codeType = 'server_error';
} else {
$codeType = 'other';
}
}
return array('response_code' => $code, 'response_code_type' => $codeType, 'response_cacheable' => $cacheable);
}
示例2: testIsInformational
public function testIsInformational()
{
$response = new Response('', 100);
$this->assertTrue($response->isInformational());
$response = new Response('', 200);
$this->assertFalse($response->isInformational());
}