SoapClientRegistry.php 855 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * @copyright Vertex. All rights reserved. https://www.vertexinc.com/
  4. * @author Mediotype https://www.mediotype.com/
  5. */
  6. namespace Vertex\Tax\Model\Api\Utility;
  7. /**
  8. * Keeps a record of the last created SoapClient
  9. */
  10. class SoapClientRegistry
  11. {
  12. /** @var \SoapClient|null */
  13. private $lastClient;
  14. /**
  15. * Retrieve the last {@see \SoapClient} created by {@see SoapClientFactory}
  16. *
  17. * @return \SoapClient|null
  18. */
  19. public function getLastClient()
  20. {
  21. return $this->lastClient;
  22. }
  23. /**
  24. * Set the last {@see \SoapClient} created by {@see SoapClientFactory}
  25. *
  26. * @param \SoapClient $client
  27. * @return SoapClientRegistry
  28. */
  29. public function setLastClient(\SoapClient $client)
  30. {
  31. $this->lastClient = $client;
  32. return $this;
  33. }
  34. }