AbstractLocation.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace GuzzleHttp\Command\Guzzle\ResponseLocation;
  3. use GuzzleHttp\Command\Guzzle\Parameter;
  4. use GuzzleHttp\Command\ResultInterface;
  5. use Psr\Http\Message\ResponseInterface;
  6. /**
  7. * Class AbstractLocation
  8. *
  9. * @package GuzzleHttp\Command\Guzzle\ResponseLocation
  10. */
  11. abstract class AbstractLocation implements ResponseLocationInterface
  12. {
  13. /** @var string $locationName */
  14. protected $locationName;
  15. /**
  16. * Set the name of the location
  17. *
  18. * @param $locationName
  19. */
  20. public function __construct($locationName)
  21. {
  22. $this->locationName = $locationName;
  23. }
  24. /**
  25. * @param ResultInterface $result
  26. * @param ResponseInterface $response
  27. * @param Parameter $model
  28. * @return ResultInterface
  29. */
  30. public function before(
  31. ResultInterface $result,
  32. ResponseInterface $response,
  33. Parameter $model
  34. ) {
  35. return $result;
  36. }
  37. /**
  38. * @param ResultInterface $result
  39. * @param ResponseInterface $response
  40. * @param Parameter $model
  41. * @return ResultInterface
  42. */
  43. public function after(
  44. ResultInterface $result,
  45. ResponseInterface $response,
  46. Parameter $model
  47. ) {
  48. return $result;
  49. }
  50. /**
  51. * @param ResultInterface $result
  52. * @param ResponseInterface $response
  53. * @param Parameter $param
  54. * @return ResultInterface
  55. */
  56. public function visit(
  57. ResultInterface $result,
  58. ResponseInterface $response,
  59. Parameter $param
  60. ) {
  61. return $result;
  62. }
  63. }