初始化仓库
This commit is contained in:
36
vendor/guzzlehttp/guzzle-services/src/ResponseLocation/StatusCodeLocation.php
vendored
Normal file
36
vendor/guzzlehttp/guzzle-services/src/ResponseLocation/StatusCodeLocation.php
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace GuzzleHttp\Command\Guzzle\ResponseLocation;
|
||||
|
||||
use GuzzleHttp\Command\Guzzle\Parameter;
|
||||
use GuzzleHttp\Command\ResultInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* Extracts the status code of a response into a result field
|
||||
*/
|
||||
class StatusCodeLocation extends AbstractLocation
|
||||
{
|
||||
/**
|
||||
* Set the name of the location
|
||||
*
|
||||
* @param string $locationName
|
||||
*/
|
||||
public function __construct($locationName = 'statusCode')
|
||||
{
|
||||
parent::__construct($locationName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ResultInterface
|
||||
*/
|
||||
public function visit(
|
||||
ResultInterface $result,
|
||||
ResponseInterface $response,
|
||||
Parameter $param
|
||||
) {
|
||||
$result[$param->getName()] = $param->filter($response->getStatusCode());
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user