DateTimeImmutableFactory.php 623 B

1234567891011121314151617181920212223242526
  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;
  7. /**
  8. * Factory for {@see \DateTimeImmutable}
  9. */
  10. class DateTimeImmutableFactory
  11. {
  12. /**
  13. * Create an instance of {@see \DateTimeImmutable}
  14. *
  15. * @param string $time
  16. * @param \DateTimeZone|null $timezone
  17. * @return \DateTimeImmutable
  18. * @throws \Exception
  19. */
  20. public function create($time = 'now', \DateTimeZone $timezone = null)
  21. {
  22. return new \DateTimeImmutable($time, $timezone);
  23. }
  24. }