Overview

Namespaces

  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
    • Tests
      • Batch
      • Cache
      • Common
        • Cache
        • Exception
      • Http
        • Curl
        • Exception
        • Message
          • Header
      • Inflection
      • Iterator
      • Log
      • Message
      • Mock
      • Parser
        • Cookie
        • Message
      • Parsers
        • UriTemplate
      • Plugin
        • Async
        • Backoff
        • Cache
        • Cookie
          • CookieJar
        • CurlAuth
        • ErrorResponse
        • History
        • Log
        • Md5
        • Mock
        • Oauth
        • Redirect
      • Service
        • Builder
        • Command
          • LocationVisitor
            • Request
            • Response
        • Description
        • Exception
        • Mock
          • Command
            • Sub
          • Model
        • Resource
      • Stream
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • VivaPayments
      • Message
  • PHP

Classes

  • AppendIterator
  • ArrayIterator
  • Closure
  • ComposerLintTask
  • DateTime
  • DateTimeZone
  • FilterIterator
  • Guzzle\Batch\AbstractBatchDecorator
  • Guzzle\Batch\Batch
  • Guzzle\Batch\BatchBuilder
  • Guzzle\Batch\BatchClosureDivisor
  • Guzzle\Batch\BatchClosureTransfer
  • Guzzle\Batch\BatchCommandTransfer
  • Guzzle\Batch\BatchRequestTransfer
  • Guzzle\Batch\BatchSizeDivisor
  • Guzzle\Batch\ExceptionBufferingBatch
  • Guzzle\Batch\FlushingBatch
  • Guzzle\Batch\HistoryBatch
  • Guzzle\Batch\NotifyingBatch
  • Guzzle\Cache\AbstractCacheAdapter
  • Guzzle\Cache\CacheAdapterFactory
  • Guzzle\Cache\ClosureCacheAdapter
  • Guzzle\Cache\DoctrineCacheAdapter
  • Guzzle\Cache\NullCacheAdapter
  • Guzzle\Cache\Zf1CacheAdapter
  • Guzzle\Cache\Zf2CacheAdapter
  • Guzzle\Common\AbstractHasDispatcher
  • Guzzle\Common\Collection
  • Guzzle\Common\Event
  • Guzzle\Common\Version
  • Guzzle\Http\AbstractEntityBodyDecorator
  • Guzzle\Http\CachingEntityBody
  • Guzzle\Http\Client
  • Guzzle\Http\Curl\CurlHandle
  • Guzzle\Http\Curl\CurlMulti
  • Guzzle\Http\Curl\CurlMultiProxy
  • Guzzle\Http\Curl\CurlVersion
  • Guzzle\Http\Curl\RequestMediator
  • Guzzle\Http\EntityBody
  • Guzzle\Http\IoEmittingEntityBody
  • Guzzle\Http\Message\AbstractMessage
  • Guzzle\Http\Message\EntityEnclosingRequest
  • Guzzle\Http\Message\Header
  • Guzzle\Http\Message\Header\CacheControl
  • Guzzle\Http\Message\Header\HeaderCollection
  • Guzzle\Http\Message\Header\HeaderFactory
  • Guzzle\Http\Message\Header\Link
  • Guzzle\Http\Message\PostFile
  • Guzzle\Http\Message\Request
  • Guzzle\Http\Message\RequestFactory
  • Guzzle\Http\Message\Response
  • Guzzle\Http\Mimetypes
  • Guzzle\Http\QueryAggregator\CommaAggregator
  • Guzzle\Http\QueryAggregator\DuplicateAggregator
  • Guzzle\Http\QueryAggregator\PhpAggregator
  • Guzzle\Http\QueryString
  • Guzzle\Http\ReadLimitEntityBody
  • Guzzle\Http\RedirectPlugin
  • Guzzle\Http\StaticClient
  • Guzzle\Http\Url
  • Guzzle\Inflection\Inflector
  • Guzzle\Inflection\MemoizingInflector
  • Guzzle\Inflection\PreComputedInflector
  • Guzzle\Iterator\AppendIterator
  • Guzzle\Iterator\ChunkedIterator
  • Guzzle\Iterator\FilterIterator
  • Guzzle\Iterator\MapIterator
  • Guzzle\Iterator\MethodProxyIterator
  • Guzzle\Log\AbstractLogAdapter
  • Guzzle\Log\ArrayLogAdapter
  • Guzzle\Log\ClosureLogAdapter
  • Guzzle\Log\MessageFormatter
  • Guzzle\Log\MonologLogAdapter
  • Guzzle\Log\PsrLogAdapter
  • Guzzle\Log\Zf1LogAdapter
  • Guzzle\Log\Zf2LogAdapter
  • Guzzle\Parser\Cookie\CookieParser
  • Guzzle\Parser\Message\AbstractMessageParser
  • Guzzle\Parser\Message\MessageParser
  • Guzzle\Parser\Message\PeclHttpMessageParser
  • Guzzle\Parser\ParserRegistry
  • Guzzle\Parser\UriTemplate\PeclUriTemplate
  • Guzzle\Parser\UriTemplate\UriTemplate
  • Guzzle\Parser\Url\UrlParser
  • Guzzle\Plugin\Async\AsyncPlugin
  • Guzzle\Plugin\Backoff\AbstractBackoffStrategy
  • Guzzle\Plugin\Backoff\AbstractErrorCodeBackoffStrategy
  • Guzzle\Plugin\Backoff\BackoffLogger
  • Guzzle\Plugin\Backoff\BackoffPlugin
  • Guzzle\Plugin\Backoff\CallbackBackoffStrategy
  • Guzzle\Plugin\Backoff\ConstantBackoffStrategy
  • Guzzle\Plugin\Backoff\CurlBackoffStrategy
  • Guzzle\Plugin\Backoff\ExponentialBackoffStrategy
  • Guzzle\Plugin\Backoff\HttpBackoffStrategy
  • Guzzle\Plugin\Backoff\LinearBackoffStrategy
  • Guzzle\Plugin\Backoff\ReasonPhraseBackoffStrategy
  • Guzzle\Plugin\Backoff\TruncatedBackoffStrategy
  • Guzzle\Plugin\Cache\CachePlugin
  • Guzzle\Plugin\Cache\CallbackCanCacheStrategy
  • Guzzle\Plugin\Cache\DefaultCacheKeyProvider
  • Guzzle\Plugin\Cache\DefaultCacheStorage
  • Guzzle\Plugin\Cache\DefaultCanCacheStrategy
  • Guzzle\Plugin\Cache\DefaultRevalidation
  • Guzzle\Plugin\Cache\DenyRevalidation
  • Guzzle\Plugin\Cache\SkipRevalidation
  • Guzzle\Plugin\Cookie\Cookie
  • Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar
  • Guzzle\Plugin\Cookie\CookieJar\FileCookieJar
  • Guzzle\Plugin\Cookie\CookiePlugin
  • Guzzle\Plugin\CurlAuth\CurlAuthPlugin
  • Guzzle\Plugin\ErrorResponse\ErrorResponsePlugin
  • Guzzle\Plugin\History\HistoryPlugin
  • Guzzle\Plugin\Log\LogPlugin
  • Guzzle\Plugin\Md5\CommandContentMd5Plugin
  • Guzzle\Plugin\Md5\Md5ValidatorPlugin
  • Guzzle\Plugin\Mock\MockPlugin
  • Guzzle\Plugin\Oauth\OauthPlugin
  • Guzzle\Service\AbstractConfigLoader
  • Guzzle\Service\Builder\ServiceBuilder
  • Guzzle\Service\Builder\ServiceBuilderLoader
  • Guzzle\Service\CachingConfigLoader
  • Guzzle\Service\Client
  • Guzzle\Service\Command\AbstractCommand
  • Guzzle\Service\Command\ClosureCommand
  • Guzzle\Service\Command\CreateResponseClassEvent
  • Guzzle\Service\Command\DefaultRequestSerializer
  • Guzzle\Service\Command\DefaultResponseParser
  • Guzzle\Service\Command\Factory\AliasFactory
  • Guzzle\Service\Command\Factory\CompositeFactory
  • Guzzle\Service\Command\Factory\ConcreteClassFactory
  • Guzzle\Service\Command\Factory\MapFactory
  • Guzzle\Service\Command\Factory\ServiceDescriptionFactory
  • Guzzle\Service\Command\LocationVisitor\Request\AbstractRequestVisitor
  • Guzzle\Service\Command\LocationVisitor\Request\BodyVisitor
  • Guzzle\Service\Command\LocationVisitor\Request\HeaderVisitor
  • Guzzle\Service\Command\LocationVisitor\Request\JsonVisitor
  • Guzzle\Service\Command\LocationVisitor\Request\PostFieldVisitor
  • Guzzle\Service\Command\LocationVisitor\Request\PostFileVisitor
  • Guzzle\Service\Command\LocationVisitor\Request\QueryVisitor
  • Guzzle\Service\Command\LocationVisitor\Request\ResponseBodyVisitor
  • Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor
  • Guzzle\Service\Command\LocationVisitor\Response\AbstractResponseVisitor
  • Guzzle\Service\Command\LocationVisitor\Response\BodyVisitor
  • Guzzle\Service\Command\LocationVisitor\Response\HeaderVisitor
  • Guzzle\Service\Command\LocationVisitor\Response\JsonVisitor
  • Guzzle\Service\Command\LocationVisitor\Response\ReasonPhraseVisitor
  • Guzzle\Service\Command\LocationVisitor\Response\StatusCodeVisitor
  • Guzzle\Service\Command\LocationVisitor\Response\XmlVisitor
  • Guzzle\Service\Command\LocationVisitor\VisitorFlyweight
  • Guzzle\Service\Command\OperationCommand
  • Guzzle\Service\Command\OperationResponseParser
  • Guzzle\Service\Description\Operation
  • Guzzle\Service\Description\Parameter
  • Guzzle\Service\Description\SchemaFormatter
  • Guzzle\Service\Description\SchemaValidator
  • Guzzle\Service\Description\ServiceDescription
  • Guzzle\Service\Description\ServiceDescriptionLoader
  • Guzzle\Service\Resource\AbstractResourceIteratorFactory
  • Guzzle\Service\Resource\CompositeResourceIteratorFactory
  • Guzzle\Service\Resource\MapResourceIteratorFactory
  • Guzzle\Service\Resource\Model
  • Guzzle\Service\Resource\ResourceIterator
  • Guzzle\Service\Resource\ResourceIteratorApplyBatched
  • Guzzle\Service\Resource\ResourceIteratorClassFactory
  • Guzzle\Stream\PhpStreamRequestFactory
  • Guzzle\Stream\Stream
  • Guzzle\Tests\Batch\AbstractBatchDecoratorTest
  • Guzzle\Tests\Batch\BatchBuilderTest
  • Guzzle\Tests\Batch\BatchClosureDivisorTest
  • Guzzle\Tests\Batch\BatchClosureTransferTest
  • Guzzle\Tests\Batch\BatchCommandTransferTest
  • Guzzle\Tests\Batch\BatchRequestTransferTest
  • Guzzle\Tests\Batch\BatchSizeDivisorTest
  • Guzzle\Tests\Batch\BatchTest
  • Guzzle\Tests\Batch\ExceptionBufferingBatchTest
  • Guzzle\Tests\Batch\FlushingBatchTest
  • Guzzle\Tests\Batch\HistoryBatchTest
  • Guzzle\Tests\Batch\NotifyingBatchTest
  • Guzzle\Tests\Cache\CacheAdapterFactoryTest
  • Guzzle\Tests\Cache\CacheAdapterTest
  • Guzzle\Tests\Cache\ClosureCacheAdapterTest
  • Guzzle\Tests\Cache\Zf2CacheAdapterTest
  • Guzzle\Tests\Common\AbstractHasAdapterTest
  • Guzzle\Tests\Common\Cache\NullCacheAdapterTest
  • Guzzle\Tests\Common\CollectionTest
  • Guzzle\Tests\Common\EventTest
  • Guzzle\Tests\Common\Exception\BatchTransferExceptionTest
  • Guzzle\Tests\Common\Exception\ExceptionCollectionTest
  • Guzzle\Tests\Common\VersionTest
  • Guzzle\Tests\GuzzleTestCase
  • Guzzle\Tests\Http\AbstractEntityBodyDecoratorTest
  • Guzzle\Tests\Http\CachingEntityBodyTest
  • Guzzle\Tests\Http\ClientTest
  • Guzzle\Tests\Http\CommaAggregatorTest
  • Guzzle\Tests\Http\Curl\CurlHandleTest
  • Guzzle\Tests\Http\Curl\CurlMultiProxyTest
  • Guzzle\Tests\Http\Curl\CurlMultiTest
  • Guzzle\Tests\Http\Curl\CurlVersionTest
  • Guzzle\Tests\Http\Curl\RequestMediatorTest
  • Guzzle\Tests\Http\DuplicateAggregatorTest
  • Guzzle\Tests\Http\EntityBodyTest
  • Guzzle\Tests\Http\Exception\CurlExceptionTest
  • Guzzle\Tests\Http\Exception\ExceptionTest
  • Guzzle\Tests\Http\Exception\MultiTransferExceptionTest
  • Guzzle\Tests\Http\IoEmittingEntityBodyTest
  • Guzzle\Tests\Http\Message\AbstractMessageTest
  • Guzzle\Tests\Http\Message\EntityEnclosingRequestTest
  • Guzzle\Tests\Http\Message\Header\HeaderFactoryTest
  • Guzzle\Tests\Http\Message\Header\LinkTest
  • Guzzle\Tests\Http\Message\HeaderComparison
  • Guzzle\Tests\Http\Message\HeaderTest
  • Guzzle\Tests\Http\Message\HttpRequestFactoryTest
  • Guzzle\Tests\Http\Message\PostFileTest
  • Guzzle\Tests\Http\Message\RequestTest
  • Guzzle\Tests\Http\MimetypesTest
  • Guzzle\Tests\Http\PhpAggregatorTest
  • Guzzle\Tests\Http\QueryStringTest
  • Guzzle\Tests\Http\ReadLimitEntityBodyTest
  • Guzzle\Tests\Http\Server
  • Guzzle\Tests\Http\UrlTest
  • Guzzle\Tests\Inflection\InflectorTest
  • Guzzle\Tests\Inflection\MemoizingInflectorTest
  • Guzzle\Tests\Inflection\PreComputedInflectorTest
  • Guzzle\Tests\Iterator\AppendIteratorTest
  • Guzzle\Tests\Iterator\ChunkedIteratorTest
  • Guzzle\Tests\Iterator\FilterIteratorTest
  • Guzzle\Tests\Iterator\MapIteratorTest
  • Guzzle\Tests\Iterator\MethodProxyIteratorTest
  • Guzzle\Tests\Log\ArrayLogAdapterTest
  • Guzzle\Tests\Log\ClosureLogAdapterTest
  • Guzzle\Tests\Log\MessageFormatterTest
  • Guzzle\Tests\Log\PsrLogAdapterTest
  • Guzzle\Tests\Log\Zf2LogAdapterTest
  • Guzzle\Tests\Message\HeaderComparisonTest
  • Guzzle\Tests\Message\ResponseTest
  • Guzzle\Tests\Mock\CustomResponseModel
  • Guzzle\Tests\Mock\ExceptionMock
  • Guzzle\Tests\Mock\MockMulti
  • Guzzle\Tests\Mock\MockObserver
  • Guzzle\Tests\Mock\MockSubject
  • Guzzle\Tests\Parser\Cookie\CookieParserProvider
  • Guzzle\Tests\Parser\Cookie\CookieParserTest
  • Guzzle\Tests\Parser\Message\MessageParserProvider
  • Guzzle\Tests\Parser\Message\MessageParserTest
  • Guzzle\Tests\Parser\Message\PeclHttpMessageParserTest
  • Guzzle\Tests\Parser\ParserRegistryTest
  • Guzzle\Tests\Parsers\UriTemplate\AbstractUriTemplateTest
  • Guzzle\Tests\Parsers\UriTemplate\PeclUriTemplateTest
  • Guzzle\Tests\Parsers\UriTemplate\UriTemplateTest
  • Guzzle\Tests\Plugin\Async\AsyncPluginTest
  • Guzzle\Tests\Plugin\Backoff\AbstractBackoffStrategyTest
  • Guzzle\Tests\Plugin\Backoff\BackoffLoggerTest
  • Guzzle\Tests\Plugin\Backoff\BackoffPluginTest
  • Guzzle\Tests\Plugin\Backoff\CallbackBackoffStrategyTest
  • Guzzle\Tests\Plugin\Backoff\ConstantBackoffStrategyTest
  • Guzzle\Tests\Plugin\Backoff\CurlBackoffStrategyTest
  • Guzzle\Tests\Plugin\Backoff\ExponentialBackoffStrategyTest
  • Guzzle\Tests\Plugin\Backoff\HttpBackoffStrategyTest
  • Guzzle\Tests\Plugin\Backoff\LinearBackoffStrategyTest
  • Guzzle\Tests\Plugin\Backoff\ReasonPhraseBackoffStrategyTest
  • Guzzle\Tests\Plugin\Backoff\TruncatedBackoffStrategyTest
  • Guzzle\Tests\Plugin\Cache\CachePluginTest
  • Guzzle\Tests\Plugin\Cache\CallbackCanCacheStrategyTest
  • Guzzle\Tests\Plugin\Cache\DefaultCacheStorageTest
  • Guzzle\Tests\Plugin\Cache\DefaultCanCacheStrategyTest
  • Guzzle\Tests\Plugin\Cache\DefaultRevalidationTest
  • Guzzle\Tests\Plugin\Cache\DenyRevalidationTest
  • Guzzle\Tests\Plugin\Cache\SkipRevalidationTest
  • Guzzle\Tests\Plugin\Cookie\CookieJar\ArrayCookieJarTest
  • Guzzle\Tests\Plugin\Cookie\CookieJar\FileCookieJarTest
  • Guzzle\Tests\Plugin\Cookie\CookiePluginTest
  • Guzzle\Tests\Plugin\Cookie\CookieTest
  • Guzzle\Tests\Plugin\CurlAuth\CurlAuthPluginTest
  • Guzzle\Tests\Plugin\ErrorResponse\ErrorResponsePluginTest
  • Guzzle\Tests\Plugin\History\HistoryPluginTest
  • Guzzle\Tests\Plugin\Log\LogPluginTest
  • Guzzle\Tests\Plugin\Md5\CommandContentMd5PluginTest
  • Guzzle\Tests\Plugin\Md5\Md5ValidatorPluginTest
  • Guzzle\Tests\Plugin\Mock\MockPluginTest
  • Guzzle\Tests\Plugin\Oauth\OauthPluginTest
  • Guzzle\Tests\Plugin\Redirect\RedirectPluginTest
  • Guzzle\Tests\Plugin\Redirect\StaticClientTest
  • Guzzle\Tests\Service\AbstractConfigLoaderTest
  • Guzzle\Tests\Service\Builder\ServiceBuilderLoaderTest
  • Guzzle\Tests\Service\CachingConfigLoaderTest
  • Guzzle\Tests\Service\ClientTest
  • Guzzle\Tests\Service\Command\AbstractCommandTest
  • Guzzle\Tests\Service\Command\AliasFactoryTest
  • Guzzle\Tests\Service\Command\ClosureCommandTest
  • Guzzle\Tests\Service\Command\CommandTest
  • Guzzle\Tests\Service\Command\CompositeFactoryTest
  • Guzzle\Tests\Service\Command\ConcreteClassFactoryTest
  • Guzzle\Tests\Service\Command\DefaultRequestSerializerTest
  • Guzzle\Tests\Service\Command\DefaultResponseParserTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Request\AbstractVisitorTestCase
  • Guzzle\Tests\Service\Command\LocationVisitor\Request\BodyVisitorTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Request\HeaderVisitorTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Request\JsonVisitorTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Request\PostFieldVisitorTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Request\PostFileVisitorTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Request\QueryVisitorTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Request\ResponseBodyVisitorTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Request\XmlVisitorTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Response\AbstractResponseVisitorTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Response\BodyVisitorTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Response\HeaderVisitorTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Response\JsonVisitorTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Response\ReasonPhraseVisitorTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Response\StatusCodeVisitorTest
  • Guzzle\Tests\Service\Command\LocationVisitor\Response\XmlVisitorTest
  • Guzzle\Tests\Service\Command\MapFactoryTest
  • Guzzle\Tests\Service\Command\OperationCommandTest
  • Guzzle\Tests\Service\Command\OperationResponseParserTest
  • Guzzle\Tests\Service\Command\ServiceDescriptionFactoryTest
  • Guzzle\Tests\Service\Command\VisitorFlyweightTest
  • Guzzle\Tests\Service\Description\OperationTest
  • Guzzle\Tests\Service\Description\ParameterTest
  • Guzzle\Tests\Service\Description\SchemaFormatterTest
  • Guzzle\Tests\Service\Description\SchemaValidatorTest
  • Guzzle\Tests\Service\Description\ServiceDescriptionLoaderTest
  • Guzzle\Tests\Service\Description\ServiceDescriptionTest
  • Guzzle\Tests\Service\Exception\CommandTransferExceptionTest
  • Guzzle\Tests\Service\Exception\InconsistentClientTransferExceptionTest
  • Guzzle\Tests\Service\Exception\ValidationExceptionTest
  • Guzzle\Tests\Service\Mock\Command\IterableCommand
  • Guzzle\Tests\Service\Mock\Command\MockCommand
  • Guzzle\Tests\Service\Mock\Command\OtherCommand
  • Guzzle\Tests\Service\Mock\Command\Sub\Sub
  • Guzzle\Tests\Service\Mock\MockClient
  • Guzzle\Tests\Service\Mock\Model\MockCommandIterator
  • Guzzle\Tests\Service\Resource\CompositeResourceIteratorFactoryTest
  • Guzzle\Tests\Service\Resource\MapResourceIteratorFactoryTest
  • Guzzle\Tests\Service\Resource\ModelTest
  • Guzzle\Tests\Service\Resource\ResourceIteratorClassFactoryTest
  • Guzzle\Tests\Service\Resource\ResourceIteratorTest
  • Guzzle\Tests\Service\ServiceBuilderTest
  • Guzzle\Tests\Stream\PhpStreamRequestFactoryTest
  • Guzzle\Tests\Stream\StreamTest
  • GuzzlePearPharPackageTask
  • GuzzleSubSplitTask
  • IteratorIterator
  • Omnipay\Common\AbstractGateway
  • Omnipay\Common\CreditCard
  • Omnipay\Common\Currency
  • Omnipay\Common\GatewayFactory
  • Omnipay\Common\Helper
  • Omnipay\Common\Issuer
  • Omnipay\Common\Item
  • Omnipay\Common\ItemBag
  • Omnipay\Common\Message\AbstractRequest
  • Omnipay\Common\Message\AbstractResponse
  • Omnipay\Common\PaymentMethod
  • Omnipay\Dummy\Gateway
  • Omnipay\Dummy\Message\AuthorizeRequest
  • Omnipay\Dummy\Message\Response
  • Omnipay\Omnipay
  • Omnipay\VivaPayments\Message\AbstractRestRequest
  • Omnipay\VivaPayments\Message\FetchTransactionsRequest
  • Omnipay\VivaPayments\Message\NativeAuthorizeRequest
  • Omnipay\VivaPayments\Message\NativePurchaseRequest
  • Omnipay\VivaPayments\Message\RedirectAuthorizeRequest
  • Omnipay\VivaPayments\Message\RedirectPurchaseRequest
  • Omnipay\VivaPayments\Message\RedirectResponse
  • Omnipay\VivaPayments\Message\RefundRequest
  • Omnipay\VivaPayments\Message\RestResponse
  • Omnipay\VivaPayments\NativeGateway
  • Omnipay\VivaPayments\RedirectGateway
  • Omnipay\VivaPayments\RestGateway
  • SimpleXMLElement
  • SplDoublyLinkedList
  • SplObjectStorage
  • SplQueue
  • XMLWriter

Interfaces

  • ArrayAccess
  • Countable
  • DateTimeInterface
  • Guzzle\Batch\BatchDivisorInterface
  • Guzzle\Batch\BatchInterface
  • Guzzle\Batch\BatchTransferInterface
  • Guzzle\Cache\CacheAdapterInterface
  • Guzzle\Common\Exception\GuzzleException
  • Guzzle\Common\FromConfigInterface
  • Guzzle\Common\HasDispatcherInterface
  • Guzzle\Common\ToArrayInterface
  • Guzzle\Http\ClientInterface
  • Guzzle\Http\Curl\CurlMultiInterface
  • Guzzle\Http\EntityBodyInterface
  • Guzzle\Http\Exception\HttpException
  • Guzzle\Http\Message\EntityEnclosingRequestInterface
  • Guzzle\Http\Message\Header\HeaderFactoryInterface
  • Guzzle\Http\Message\Header\HeaderInterface
  • Guzzle\Http\Message\MessageInterface
  • Guzzle\Http\Message\PostFileInterface
  • Guzzle\Http\Message\RequestFactoryInterface
  • Guzzle\Http\Message\RequestInterface
  • Guzzle\Http\QueryAggregator\QueryAggregatorInterface
  • Guzzle\Inflection\InflectorInterface
  • Guzzle\Log\LogAdapterInterface
  • Guzzle\Parser\Cookie\CookieParserInterface
  • Guzzle\Parser\Message\MessageParserInterface
  • Guzzle\Parser\UriTemplate\UriTemplateInterface
  • Guzzle\Parser\Url\UrlParserInterface
  • Guzzle\Plugin\Backoff\BackoffStrategyInterface
  • Guzzle\Plugin\Cache\CacheKeyProviderInterface
  • Guzzle\Plugin\Cache\CacheStorageInterface
  • Guzzle\Plugin\Cache\CanCacheStrategyInterface
  • Guzzle\Plugin\Cache\RevalidationInterface
  • Guzzle\Plugin\Cookie\CookieJar\CookieJarInterface
  • Guzzle\Plugin\ErrorResponse\ErrorResponseExceptionInterface
  • Guzzle\Service\Builder\ServiceBuilderInterface
  • Guzzle\Service\ClientInterface
  • Guzzle\Service\Command\CommandInterface
  • Guzzle\Service\Command\Factory\FactoryInterface
  • Guzzle\Service\Command\LocationVisitor\Request\RequestVisitorInterface
  • Guzzle\Service\Command\LocationVisitor\Response\ResponseVisitorInterface
  • Guzzle\Service\Command\RequestSerializerInterface
  • Guzzle\Service\Command\ResponseClassInterface
  • Guzzle\Service\Command\ResponseParserInterface
  • Guzzle\Service\ConfigLoaderInterface
  • Guzzle\Service\Description\OperationInterface
  • Guzzle\Service\Description\ServiceDescriptionInterface
  • Guzzle\Service\Description\ValidatorInterface
  • Guzzle\Service\Resource\ResourceIteratorFactoryInterface
  • Guzzle\Service\Resource\ResourceIteratorInterface
  • Guzzle\Stream\StreamInterface
  • Guzzle\Stream\StreamRequestFactoryInterface
  • Iterator
  • IteratorAggregate
  • Omnipay\Common\Exception\OmnipayException
  • Omnipay\Common\GatewayInterface
  • Omnipay\Common\ItemInterface
  • Omnipay\Common\Message\FetchIssuersResponseInterface
  • Omnipay\Common\Message\FetchPaymentMethodsResponseInterface
  • Omnipay\Common\Message\MessageInterface
  • Omnipay\Common\Message\NotificationInterface
  • Omnipay\Common\Message\RedirectResponseInterface
  • Omnipay\Common\Message\RequestInterface
  • Omnipay\Common\Message\ResponseInterface
  • OuterIterator
  • SeekableIterator
  • Serializable
  • Throwable
  • Traversable

Exceptions

  • BadFunctionCallException
  • BadMethodCallException
  • Exception
  • Guzzle\Batch\Exception\BatchTransferException
  • Guzzle\Common\Exception\BadMethodCallException
  • Guzzle\Common\Exception\ExceptionCollection
  • Guzzle\Common\Exception\InvalidArgumentException
  • Guzzle\Common\Exception\RuntimeException
  • Guzzle\Common\Exception\UnexpectedValueException
  • Guzzle\Http\Exception\BadResponseException
  • Guzzle\Http\Exception\ClientErrorResponseException
  • Guzzle\Http\Exception\CouldNotRewindStreamException
  • Guzzle\Http\Exception\CurlException
  • Guzzle\Http\Exception\MultiTransferException
  • Guzzle\Http\Exception\RequestException
  • Guzzle\Http\Exception\ServerErrorResponseException
  • Guzzle\Http\Exception\TooManyRedirectsException
  • Guzzle\Plugin\Cookie\Exception\InvalidCookieException
  • Guzzle\Plugin\ErrorResponse\Exception\ErrorResponseException
  • Guzzle\Service\Exception\CommandException
  • Guzzle\Service\Exception\CommandTransferException
  • Guzzle\Service\Exception\DescriptionBuilderException
  • Guzzle\Service\Exception\InconsistentClientTransferException
  • Guzzle\Service\Exception\ResponseClassException
  • Guzzle\Service\Exception\ServiceBuilderException
  • Guzzle\Service\Exception\ServiceNotFoundException
  • Guzzle\Service\Exception\ValidationException
  • Guzzle\Tests\Mock\ErrorResponseMock
  • InvalidArgumentException
  • LogicException
  • Omnipay\Common\Exception\BadMethodCallException
  • Omnipay\Common\Exception\InvalidCreditCardException
  • Omnipay\Common\Exception\InvalidRequestException
  • Omnipay\Common\Exception\InvalidResponseException
  • Omnipay\Common\Exception\RuntimeException
  • OutOfBoundsException
  • RuntimeException
  • UnexpectedValueException
  • Overview
  • Namespace
  • Class
  • Tree
  1:   2:   3:   4:   5:   6:   7:   8:   9:  10:  11:  12:  13:  14:  15:  16:  17:  18:  19:  20:  21:  22:  23:  24:  25:  26:  27:  28:  29:  30:  31:  32:  33:  34:  35:  36:  37:  38:  39:  40:  41:  42:  43:  44:  45:  46:  47:  48:  49:  50:  51:  52:  53:  54:  55:  56:  57:  58:  59:  60:  61:  62:  63:  64:  65:  66:  67:  68:  69:  70:  71:  72:  73:  74:  75:  76:  77:  78:  79:  80:  81:  82:  83:  84:  85:  86:  87:  88:  89:  90:  91:  92:  93:  94:  95:  96:  97:  98:  99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275: 276: 277: 278: 279: 280: 281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304: 305: 306: 307: 308: 309: 310: 311: 312: 313: 314: 315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327: 328: 329: 330: 331: 332: 333: 334: 335: 336: 337: 338: 339: 340: 341: 342: 343: 344: 345: 346: 347: 348: 349: 350: 351: 352: 353: 354: 355: 356: 357: 358: 359: 360: 361: 362: 363: 364: 365: 366: 367: 368: 369: 370: 371: 372: 373: 374: 375: 376: 377: 378: 379: 380: 381: 382: 383: 384: 385: 386: 387: 388: 389: 390: 391: 392: 393: 394: 395: 396: 397: 398: 399: 400: 401: 402: 403: 404: 405: 406: 407: 408: 409: 410: 411: 412: 413: 414: 415: 416: 417: 418: 419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432: 433: 434: 435: 436: 437: 438: 439: 440: 441: 442: 443: 444: 445: 446: 447: 448: 449: 450: 451: 452: 453: 454: 455: 456: 457: 458: 459: 460: 461: 462: 463: 464: 465: 466: 467: 468: 469: 470: 471: 472: 473: 474: 475: 476: 477: 478: 479: 480: 481: 482: 483: 484: 485: 486: 487: 488: 489: 490: 491: 492: 493: 494: 495: 496: 497: 498: 499: 500: 501: 502: 503: 504: 505: 506: 507: 508: 509: 510: 511: 512: 513: 514: 515: 516: 517: 518: 519: 520: 521: 522: 523: 524: 525: 526: 527: 528: 529: 530: 531: 532: 533: 534: 535: 536: 537: 538: 539: 540: 541: 542: 543: 544: 545: 546: 547: 548: 549: 550: 551: 552: 553: 554: 555: 556: 557: 558: 559: 560: 561: 562: 563: 564: 565: 566: 567: 568: 569: 570: 571: 572: 573: 574: 575: 576: 577: 578: 579: 580: 581: 582: 583: 584: 585: 586: 587: 588: 589: 590: 591: 592: 593: 594: 595: 596: 597: 598: 599: 600: 601: 602: 603: 604: 605: 606: 607: 608: 609: 610: 611: 612: 613: 614: 615: 616: 617: 618: 619: 620: 621: 622: 623: 624: 625: 626: 627: 628: 629: 630: 631: 632: 633: 634: 635: 636: 637: 638: 639: 640: 641: 642: 643: 644: 645: 646: 647: 648: 649: 650: 651: 652: 653: 654: 655: 656: 657: 658: 659: 660: 661: 662: 663: 664: 665: 666: 667: 668: 669: 670: 671: 672: 673: 674: 675: 676: 677: 678: 679: 680: 681: 682: 683: 684: 685: 686: 687: 688: 689: 690: 691: 692: 693: 694: 695: 696: 697: 698: 699: 700: 701: 702: 703: 704: 705: 706: 707: 708: 709: 710: 711: 712: 713: 714: 715: 716: 717: 718: 719: 720: 721: 722: 723: 724: 725: 726: 727: 728: 729: 730: 731: 732: 733: 734: 735: 736: 737: 738: 739: 740: 741: 742: 743: 744: 745: 746: 747: 748: 749: 750: 751: 752: 753: 754: 755: 756: 757: 758: 759: 760: 761: 762: 763: 764: 765: 766: 767: 768: 769: 770: 771: 772: 773: 774: 775: 776: 777: 778: 779: 780: 781: 782: 783: 784: 785: 786: 787: 788: 789: 790: 791: 792: 793: 794: 795: 796: 797: 798: 799: 800: 801: 802: 803: 804: 805: 806: 807: 808: 809: 810: 811: 812: 813: 814: 815: 816: 817: 818: 819: 820: 821: 822: 823: 824: 825: 826: 827: 828: 829: 830: 831: 832: 833: 834: 835: 836: 837: 838: 839: 840: 841: 842: 843: 844: 845: 846: 847: 848: 849: 850: 851: 852: 853: 854: 855: 856: 857: 858: 859: 860: 861: 862: 863: 864: 865: 866: 867: 868: 869: 870: 871: 872: 873: 874: 875: 876: 877: 878: 879: 880: 881: 882: 883: 884: 885: 886: 887: 888: 889: 890: 891: 892: 893: 894: 895: 896: 897: 898: 899: 900: 901: 902: 903: 904: 905: 906: 907: 908: 909: 910: 911: 912: 913: 914: 915: 916: 917: 918: 919: 920: 921: 922: 923: 924: 925: 926: 927: 928: 929: 930: 931: 932: 933: 934: 935: 936: 937: 938: 939: 940: 941: 942: 943: 944: 945: 946: 947: 948: 949: 950: 951: 952: 953: 954: 955: 956: 957: 958: 959: 960: 961: 962: 963: 964: 965: 966: 967: 968: 969: 
<?php

namespace Guzzle\Http\Message;

use Guzzle\Common\Version;
use Guzzle\Common\ToArrayInterface;
use Guzzle\Common\Exception\RuntimeException;
use Guzzle\Http\EntityBodyInterface;
use Guzzle\Http\EntityBody;
use Guzzle\Http\Exception\BadResponseException;
use Guzzle\Http\RedirectPlugin;
use Guzzle\Parser\ParserRegistry;

/**
 * Guzzle HTTP response object
 */
class Response extends AbstractMessage implements \Serializable
{
    /**
     * @var array Array of reason phrases and their corresponding status codes
     */
    private static $statusTexts = array(
        100 => 'Continue',
        101 => 'Switching Protocols',
        102 => 'Processing',
        200 => 'OK',
        201 => 'Created',
        202 => 'Accepted',
        203 => 'Non-Authoritative Information',
        204 => 'No Content',
        205 => 'Reset Content',
        206 => 'Partial Content',
        207 => 'Multi-Status',
        208 => 'Already Reported',
        226 => 'IM Used',
        300 => 'Multiple Choices',
        301 => 'Moved Permanently',
        302 => 'Found',
        303 => 'See Other',
        304 => 'Not Modified',
        305 => 'Use Proxy',
        307 => 'Temporary Redirect',
        308 => 'Permanent Redirect',
        400 => 'Bad Request',
        401 => 'Unauthorized',
        402 => 'Payment Required',
        403 => 'Forbidden',
        404 => 'Not Found',
        405 => 'Method Not Allowed',
        406 => 'Not Acceptable',
        407 => 'Proxy Authentication Required',
        408 => 'Request Timeout',
        409 => 'Conflict',
        410 => 'Gone',
        411 => 'Length Required',
        412 => 'Precondition Failed',
        413 => 'Request Entity Too Large',
        414 => 'Request-URI Too Long',
        415 => 'Unsupported Media Type',
        416 => 'Requested Range Not Satisfiable',
        417 => 'Expectation Failed',
        422 => 'Unprocessable Entity',
        423 => 'Locked',
        424 => 'Failed Dependency',
        425 => 'Reserved for WebDAV advanced collections expired proposal',
        426 => 'Upgrade required',
        428 => 'Precondition Required',
        429 => 'Too Many Requests',
        431 => 'Request Header Fields Too Large',
        500 => 'Internal Server Error',
        501 => 'Not Implemented',
        502 => 'Bad Gateway',
        503 => 'Service Unavailable',
        504 => 'Gateway Timeout',
        505 => 'HTTP Version Not Supported',
        506 => 'Variant Also Negotiates (Experimental)',
        507 => 'Insufficient Storage',
        508 => 'Loop Detected',
        510 => 'Not Extended',
        511 => 'Network Authentication Required',
    );

    /** @var EntityBodyInterface The response body */
    protected $body;

    /** @var string The reason phrase of the response (human readable code) */
    protected $reasonPhrase;

    /** @var string The status code of the response */
    protected $statusCode;

    /** @var array Information about the request */
    protected $info = array();

    /** @var string The effective URL that returned this response */
    protected $effectiveUrl;

    /** @var array Cacheable response codes (see RFC 2616:13.4) */
    protected static $cacheResponseCodes = array(200, 203, 206, 300, 301, 410);

    /**
     * Create a new Response based on a raw response message
     *
     * @param string $message Response message
     *
     * @return self|bool Returns false on error
     */
    public static function fromMessage($message)
    {
        $data = ParserRegistry::getInstance()->getParser('message')->parseResponse($message);
        if (!$data) {
            return false;
        }

        $response = new static($data['code'], $data['headers'], $data['body']);
        $response->setProtocol($data['protocol'], $data['version'])
                 ->setStatus($data['code'], $data['reason_phrase']);

        // Set the appropriate Content-Length if the one set is inaccurate (e.g. setting to X)
        $contentLength = (string) $response->getHeader('Content-Length');
        $actualLength = strlen($data['body']);
        if (strlen($data['body']) > 0 && $contentLength != $actualLength) {
            $response->setHeader('Content-Length', $actualLength);
        }

        return $response;
    }

    /**
     * Construct the response
     *
     * @param string                              $statusCode The response status code (e.g. 200, 404, etc)
     * @param ToArrayInterface|array              $headers    The response headers
     * @param string|resource|EntityBodyInterface $body       The body of the response
     *
     * @throws BadResponseException if an invalid response code is given
     */
    public function __construct($statusCode, $headers = null, $body = null)
    {
        parent::__construct();
        $this->setStatus($statusCode);
        $this->body = EntityBody::factory($body !== null ? $body : '');

        if ($headers) {
            if (is_array($headers)) {
                $this->setHeaders($headers);
            } elseif ($headers instanceof ToArrayInterface) {
                $this->setHeaders($headers->toArray());
            } else {
                throw new BadResponseException('Invalid headers argument received');
            }
        }
    }

    /**
     * @return string
     */
    public function __toString()
    {
        return $this->getMessage();
    }

    public function serialize()
    {
        return json_encode(array(
            'status'  => $this->statusCode,
            'body'    => (string) $this->body,
            'headers' => $this->headers->toArray()
        ));
    }

    public function unserialize($serialize)
    {
        $data = json_decode($serialize, true);
        $this->__construct($data['status'], $data['headers'], $data['body']);
    }

    /**
     * Get the response entity body
     *
     * @param bool $asString Set to TRUE to return a string of the body rather than a full body object
     *
     * @return EntityBodyInterface|string
     */
    public function getBody($asString = false)
    {
        return $asString ? (string) $this->body : $this->body;
    }

    /**
     * Set the response entity body
     *
     * @param EntityBodyInterface|string $body Body to set
     *
     * @return self
     */
    public function setBody($body)
    {
        $this->body = EntityBody::factory($body);

        return $this;
    }

    /**
     * Set the protocol and protocol version of the response
     *
     * @param string $protocol Response protocol
     * @param string $version  Protocol version
     *
     * @return self
     */
    public function setProtocol($protocol, $version)
    {
        $this->protocol = $protocol;
        $this->protocolVersion = $version;

        return $this;
    }

    /**
     * Get the protocol used for the response (e.g. HTTP)
     *
     * @return string
     */
    public function getProtocol()
    {
        return $this->protocol;
    }

    /**
     * Get the HTTP protocol version
     *
     * @return string
     */
    public function getProtocolVersion()
    {
        return $this->protocolVersion;
    }

    /**
     * Get a cURL transfer information
     *
     * @param string $key A single statistic to check
     *
     * @return array|string|null Returns all stats if no key is set, a single stat if a key is set, or null if a key
     *                           is set and not found
     * @link http://www.php.net/manual/en/function.curl-getinfo.php
     */
    public function getInfo($key = null)
    {
        if ($key === null) {
            return $this->info;
        } elseif (array_key_exists($key, $this->info)) {
            return $this->info[$key];
        } else {
            return null;
        }
    }

    /**
     * Set the transfer information
     *
     * @param array $info Array of cURL transfer stats
     *
     * @return self
     */
    public function setInfo(array $info)
    {
        $this->info = $info;

        return $this;
    }

    /**
     * Set the response status
     *
     * @param int    $statusCode   Response status code to set
     * @param string $reasonPhrase Response reason phrase
     *
     * @return self
     * @throws BadResponseException when an invalid response code is received
     */
    public function setStatus($statusCode, $reasonPhrase = '')
    {
        $this->statusCode = (int) $statusCode;

        if (!$reasonPhrase && isset(self::$statusTexts[$this->statusCode])) {
            $this->reasonPhrase = self::$statusTexts[$this->statusCode];
        } else {
            $this->reasonPhrase = $reasonPhrase;
        }

        return $this;
    }

    /**
     * Get the response status code
     *
     * @return integer
     */
    public function getStatusCode()
    {
        return $this->statusCode;
    }

    /**
     * Get the entire response as a string
     *
     * @return string
     */
    public function getMessage()
    {
        $message = $this->getRawHeaders();

        // Only include the body in the message if the size is < 2MB
        $size = $this->body->getSize();
        if ($size < 2097152) {
            $message .= (string) $this->body;
        }

        return $message;
    }

    /**
     * Get the the raw message headers as a string
     *
     * @return string
     */
    public function getRawHeaders()
    {
        $headers = 'HTTP/1.1 ' . $this->statusCode . ' ' . $this->reasonPhrase . "\r\n";
        $lines = $this->getHeaderLines();
        if (!empty($lines)) {
            $headers .= implode("\r\n", $lines) . "\r\n";
        }

        return $headers . "\r\n";
    }

    /**
     * Get the response reason phrase- a human readable version of the numeric
     * status code
     *
     * @return string
     */
    public function getReasonPhrase()
    {
        return $this->reasonPhrase;
    }

    /**
     * Get the Accept-Ranges HTTP header
     *
     * @return string Returns what partial content range types this server supports.
     */
    public function getAcceptRanges()
    {
        return (string) $this->getHeader('Accept-Ranges');
    }

    /**
     * Calculate the age of the response
     *
     * @return integer
     */
    public function calculateAge()
    {
        $age = $this->getHeader('Age');

        if ($age === null && $this->getDate()) {
            $age = time() - strtotime($this->getDate());
        }

        return $age === null ? null : (int) (string) $age;
    }

    /**
     * Get the Age HTTP header
     *
     * @return integer|null Returns the age the object has been in a proxy cache in seconds.
     */
    public function getAge()
    {
        return (string) $this->getHeader('Age');
    }

    /**
     * Get the Allow HTTP header
     *
     * @return string|null Returns valid actions for a specified resource. To be used for a 405 Method not allowed.
     */
    public function getAllow()
    {
        return (string) $this->getHeader('Allow');
    }

    /**
     * Check if an HTTP method is allowed by checking the Allow response header
     *
     * @param string $method Method to check
     *
     * @return bool
     */
    public function isMethodAllowed($method)
    {
        $allow = $this->getHeader('Allow');
        if ($allow) {
            foreach (explode(',', $allow) as $allowable) {
                if (!strcasecmp(trim($allowable), $method)) {
                    return true;
                }
            }
        }

        return false;
    }

    /**
     * Get the Cache-Control HTTP header
     *
     * @return string
     */
    public function getCacheControl()
    {
        return (string) $this->getHeader('Cache-Control');
    }

    /**
     * Get the Connection HTTP header
     *
     * @return string
     */
    public function getConnection()
    {
        return (string) $this->getHeader('Connection');
    }

    /**
     * Get the Content-Encoding HTTP header
     *
     * @return string|null
     */
    public function getContentEncoding()
    {
        return (string) $this->getHeader('Content-Encoding');
    }

    /**
     * Get the Content-Language HTTP header
     *
     * @return string|null Returns the language the content is in.
     */
    public function getContentLanguage()
    {
        return (string) $this->getHeader('Content-Language');
    }

    /**
     * Get the Content-Length HTTP header
     *
     * @return integer Returns the length of the response body in bytes
     */
    public function getContentLength()
    {
        return (int) (string) $this->getHeader('Content-Length');
    }

    /**
     * Get the Content-Location HTTP header
     *
     * @return string|null Returns an alternate location for the returned data (e.g /index.htm)
     */
    public function getContentLocation()
    {
        return (string) $this->getHeader('Content-Location');
    }

    /**
     * Get the Content-Disposition HTTP header
     *
     * @return string|null Returns the Content-Disposition header
     */
    public function getContentDisposition()
    {
        return (string) $this->getHeader('Content-Disposition');
    }

    /**
     * Get the Content-MD5 HTTP header
     *
     * @return string|null Returns a Base64-encoded binary MD5 sum of the content of the response.
     */
    public function getContentMd5()
    {
        return (string) $this->getHeader('Content-MD5');
    }

    /**
     * Get the Content-Range HTTP header
     *
     * @return string Returns where in a full body message this partial message belongs (e.g. bytes 21010-47021/47022).
     */
    public function getContentRange()
    {
        return (string) $this->getHeader('Content-Range');
    }

    /**
     * Get the Content-Type HTTP header
     *
     * @return string Returns the mime type of this content.
     */
    public function getContentType()
    {
        return (string) $this->getHeader('Content-Type');
    }

    /**
     * Checks if the Content-Type is of a certain type.  This is useful if the
     * Content-Type header contains charset information and you need to know if
     * the Content-Type matches a particular type.
     *
     * @param string $type Content type to check against
     *
     * @return bool
     */
    public function isContentType($type)
    {
        return stripos($this->getHeader('Content-Type'), $type) !== false;
    }

    /**
     * Get the Date HTTP header
     *
     * @return string|null Returns the date and time that the message was sent.
     */
    public function getDate()
    {
        return (string) $this->getHeader('Date');
    }

    /**
     * Get the ETag HTTP header
     *
     * @return string|null Returns an identifier for a specific version of a resource, often a Message digest.
     */
    public function getEtag()
    {
        return (string) $this->getHeader('ETag');
    }

    /**
     * Get the Expires HTTP header
     *
     * @return string|null Returns the date/time after which the response is considered stale.
     */
    public function getExpires()
    {
        return (string) $this->getHeader('Expires');
    }

    /**
     * Get the Last-Modified HTTP header
     *
     * @return string|null Returns the last modified date for the requested object, in RFC 2822 format
     *                     (e.g. Tue, 15 Nov 1994 12:45:26 GMT)
     */
    public function getLastModified()
    {
        return (string) $this->getHeader('Last-Modified');
    }

    /**
     * Get the Location HTTP header
     *
     * @return string|null Used in redirection, or when a new resource has been created.
     */
    public function getLocation()
    {
        return (string) $this->getHeader('Location');
    }

    /**
     * Get the Pragma HTTP header
     *
     * @return Header|null Returns the implementation-specific headers that may have various effects anywhere along
     *                     the request-response chain.
     */
    public function getPragma()
    {
        return (string) $this->getHeader('Pragma');
    }

    /**
     * Get the Proxy-Authenticate HTTP header
     *
     * @return string|null Authentication to access the proxy (e.g. Basic)
     */
    public function getProxyAuthenticate()
    {
        return (string) $this->getHeader('Proxy-Authenticate');
    }

    /**
     * Get the Retry-After HTTP header
     *
     * @return int|null If an entity is temporarily unavailable, this instructs the client to try again after a
     *                  specified period of time.
     */
    public function getRetryAfter()
    {
        return (string) $this->getHeader('Retry-After');
    }

    /**
     * Get the Server HTTP header
     *
     * @return string|null A name for the server
     */
    public function getServer()
    {
        return (string)  $this->getHeader('Server');
    }

    /**
     * Get the Set-Cookie HTTP header
     *
     * @return string|null An HTTP cookie.
     */
    public function getSetCookie()
    {
        return (string) $this->getHeader('Set-Cookie');
    }

    /**
     * Get the Trailer HTTP header
     *
     * @return string|null The Trailer general field value indicates that the given set of header fields is present in
     *                     the trailer of a message encoded with chunked transfer-coding.
     */
    public function getTrailer()
    {
        return (string) $this->getHeader('Trailer');
    }

    /**
     * Get the Transfer-Encoding HTTP header
     *
     * @return string|null The form of encoding used to safely transfer the entity to the user
     */
    public function getTransferEncoding()
    {
        return (string) $this->getHeader('Transfer-Encoding');
    }

    /**
     * Get the Vary HTTP header
     *
     * @return string|null Tells downstream proxies how to match future request headers to decide whether the cached
     *                     response can be used rather than requesting a fresh one from the origin server.
     */
    public function getVary()
    {
        return (string) $this->getHeader('Vary');
    }

    /**
     * Get the Via HTTP header
     *
     * @return string|null Informs the client of proxies through which the response was sent.
     */
    public function getVia()
    {
        return (string) $this->getHeader('Via');
    }

    /**
     * Get the Warning HTTP header
     *
     * @return string|null A general warning about possible problems with the entity body
     */
    public function getWarning()
    {
        return (string) $this->getHeader('Warning');
    }

    /**
     * Get the WWW-Authenticate HTTP header
     *
     * @return string|null Indicates the authentication scheme that should be used to access the requested entity
     */
    public function getWwwAuthenticate()
    {
        return (string) $this->getHeader('WWW-Authenticate');
    }

    /**
     * Checks if HTTP Status code is a Client Error (4xx)
     *
     * @return bool
     */
    public function isClientError()
    {
        return $this->statusCode >= 400 && $this->statusCode < 500;
    }

    /**
     * Checks if HTTP Status code is Server OR Client Error (4xx or 5xx)
     *
     * @return boolean
     */
    public function isError()
    {
        return $this->isClientError() || $this->isServerError();
    }

    /**
     * Checks if HTTP Status code is Information (1xx)
     *
     * @return bool
     */
    public function isInformational()
    {
        return $this->statusCode < 200;
    }

    /**
     * Checks if HTTP Status code is a Redirect (3xx)
     *
     * @return bool
     */
    public function isRedirect()
    {
        return $this->statusCode >= 300 && $this->statusCode < 400;
    }

    /**
     * Checks if HTTP Status code is Server Error (5xx)
     *
     * @return bool
     */
    public function isServerError()
    {
        return $this->statusCode >= 500 && $this->statusCode < 600;
    }

    /**
     * Checks if HTTP Status code is Successful (2xx | 304)
     *
     * @return bool
     */
    public function isSuccessful()
    {
        return ($this->statusCode >= 200 && $this->statusCode < 300) || $this->statusCode == 304;
    }

    /**
     * Check if the response can be cached based on the response headers
     *
     * @return bool Returns TRUE if the response can be cached or false if not
     */
    public function canCache()
    {
        // Check if the response is cacheable based on the code
        if (!in_array((int) $this->getStatusCode(), self::$cacheResponseCodes)) {
            return false;
        }

        // Make sure a valid body was returned and can be cached
        if ((!$this->getBody()->isReadable() || !$this->getBody()->isSeekable())
            && ($this->getContentLength() > 0 || $this->getTransferEncoding() == 'chunked')) {
            return false;
        }

        // Never cache no-store resources (this is a private cache, so private
        // can be cached)
        if ($this->getHeader('Cache-Control') && $this->getHeader('Cache-Control')->hasDirective('no-store')) {
            return false;
        }

        return $this->isFresh() || $this->getFreshness() === null || $this->canValidate();
    }

    /**
     * Gets the number of seconds from the current time in which this response is still considered fresh
     *
     * @return int|null Returns the number of seconds
     */
    public function getMaxAge()
    {
        if ($header = $this->getHeader('Cache-Control')) {
            // s-max-age, then max-age, then Expires
            if ($age = $header->getDirective('s-maxage')) {
                return $age;
            }
            if ($age = $header->getDirective('max-age')) {
                return $age;
            }
        }

        if ($this->getHeader('Expires')) {
            return strtotime($this->getExpires()) - time();
        }

        return null;
    }

    /**
     * Check if the response is considered fresh.
     *
     * A response is considered fresh when its age is less than or equal to the freshness lifetime (maximum age) of the
     * response.
     *
     * @return bool|null
     */
    public function isFresh()
    {
        $fresh = $this->getFreshness();

        return $fresh === null ? null : $fresh >= 0;
    }

    /**
     * Check if the response can be validated against the origin server using a conditional GET request.
     *
     * @return bool
     */
    public function canValidate()
    {
        return $this->getEtag() || $this->getLastModified();
    }

    /**
     * Get the freshness of the response by returning the difference of the maximum lifetime of the response and the
     * age of the response (max-age - age).
     *
     * Freshness values less than 0 mean that the response is no longer fresh and is ABS(freshness) seconds expired.
     * Freshness values of greater than zero is the number of seconds until the response is no longer fresh. A NULL
     * result means that no freshness information is available.
     *
     * @return int
     */
    public function getFreshness()
    {
        $maxAge = $this->getMaxAge();
        $age = $this->calculateAge();

        return $maxAge && $age ? ($maxAge - $age) : null;
    }

    /**
     * Parse the JSON response body and return an array
     *
     * @return array|string|int|bool|float
     * @throws RuntimeException if the response body is not in JSON format
     */
    public function json()
    {
        $data = json_decode((string) $this->body, true);
        if (JSON_ERROR_NONE !== json_last_error()) {
            throw new RuntimeException('Unable to parse response body into JSON: ' . json_last_error());
        }

        return $data === null ? array() : $data;
    }

    /**
     * Parse the XML response body and return a \SimpleXMLElement.
     *
     * In order to prevent XXE attacks, this method disables loading external
     * entities. If you rely on external entities, then you must parse the
     * XML response manually by accessing the response body directly.
     *
     * @return \SimpleXMLElement
     * @throws RuntimeException if the response body is not in XML format
     * @link http://websec.io/2012/08/27/Preventing-XXE-in-PHP.html
     */
    public function xml()
    {
        $errorMessage = null;
        $internalErrors = libxml_use_internal_errors(true);
        $disableEntities = libxml_disable_entity_loader(true);
        libxml_clear_errors();

        try {
            $xml = new \SimpleXMLElement((string) $this->body ?: '<root />', LIBXML_NONET);
            if ($error = libxml_get_last_error()) {
                $errorMessage = $error->message;
            }
        } catch (\Exception $e) {
            $errorMessage = $e->getMessage();
        }

        libxml_clear_errors();
        libxml_use_internal_errors($internalErrors);
        libxml_disable_entity_loader($disableEntities);

        if ($errorMessage) {
            throw new RuntimeException('Unable to parse response body into XML: ' . $errorMessage);
        }

        return $xml;
    }

    /**
     * Get the redirect count of this response
     *
     * @return int
     */
    public function getRedirectCount()
    {
        return (int) $this->params->get(RedirectPlugin::REDIRECT_COUNT);
    }

    /**
     * Set the effective URL that resulted in this response (e.g. the last redirect URL)
     *
     * @param string $url The effective URL
     *
     * @return self
     */
    public function setEffectiveUrl($url)
    {
        $this->effectiveUrl = $url;

        return $this;
    }

    /**
     * Get the effective URL that resulted in this response (e.g. the last redirect URL)
     *
     * @return string
     */
    public function getEffectiveUrl()
    {
        return $this->effectiveUrl;
    }

    /**
     * @deprecated
     * @codeCoverageIgnore
     */
    public function getPreviousResponse()
    {
        Version::warn(__METHOD__ . ' is deprecated. Use the HistoryPlugin.');
        return null;
    }

    /**
     * @deprecated
     * @codeCoverageIgnore
     */
    public function setRequest($request)
    {
        Version::warn(__METHOD__ . ' is deprecated');
        return $this;
    }

    /**
     * @deprecated
     * @codeCoverageIgnore
     */
    public function getRequest()
    {
        Version::warn(__METHOD__ . ' is deprecated');
        return null;
    }
}
Omnipay Viva Payments Gateway Module API Documentation API documentation generated by ApiGen