AbstractCarbon.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of the Carbon package.
  5. *
  6. * (c) Brian Nesbitt <brian@nesbot.com>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Tests\CarbonPeriod\Fixtures;
  12. use Carbon\CarbonInterface;
  13. use DateTime;
  14. use ReturnTypeWillChange;
  15. abstract class AbstractCarbon extends DateTime implements CarbonInterface
  16. {
  17. public function __construct($time = null, $tz = null)
  18. {
  19. parent::__construct($time, $tz);
  20. }
  21. public static function __set_state($dump): self
  22. {
  23. return new static($dump);
  24. }
  25. #[ReturnTypeWillChange]
  26. public function add($unit, $value = 1, $overflow = null)
  27. {
  28. return parent::add($unit);
  29. }
  30. #[ReturnTypeWillChange]
  31. public function sub($unit, $value = 1, $overflow = null)
  32. {
  33. return parent::sub($unit);
  34. }
  35. #[ReturnTypeWillChange]
  36. public function modify($modify)
  37. {
  38. return parent::modify($modify);
  39. }
  40. #[ReturnTypeWillChange]
  41. public function setDate($year, $month, $day)
  42. {
  43. return parent::setDate($year, $month, $day);
  44. }
  45. #[ReturnTypeWillChange]
  46. public function setISODate($year, $month, $day = 1)
  47. {
  48. return parent::setISODate($year, $month, $day = 1);
  49. }
  50. #[ReturnTypeWillChange]
  51. public function setTime($hour, $minute, $second = 0, $microseconds = 0)
  52. {
  53. return parent::setTime($hour, $minute, $second, $microseconds);
  54. }
  55. #[ReturnTypeWillChange]
  56. public function setTimestamp($unixTimestamp)
  57. {
  58. return parent::setTimestamp($unixTimestamp);
  59. }
  60. #[ReturnTypeWillChange]
  61. public function setTimezone($value)
  62. {
  63. return parent::setTimezone($value);
  64. }
  65. #[ReturnTypeWillChange]
  66. public static function createFromFormat($format, $time, $tz = null)
  67. {
  68. return parent::createFromFormat($format, $time, $tz);
  69. }
  70. }