ExecutedMigration.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. declare(strict_types=1);
  3. namespace Doctrine\Migrations\Metadata;
  4. use DateTimeImmutable;
  5. use Doctrine\Migrations\Version\Version;
  6. /**
  7. * Represents an already executed migration.
  8. * The migration might be not available anymore.
  9. */
  10. final class ExecutedMigration
  11. {
  12. /** @var Version */
  13. private $version;
  14. /** @var DateTimeImmutable|null */
  15. private $executedAt;
  16. /**
  17. * Seconds
  18. *
  19. * @var float|null
  20. */
  21. public $executionTime;
  22. public function __construct(Version $version, ?DateTimeImmutable $executedAt = null, ?float $executionTime = null)
  23. {
  24. $this->version = $version;
  25. $this->executedAt = $executedAt;
  26. $this->executionTime = $executionTime;
  27. }
  28. public function getExecutionTime(): ?float
  29. {
  30. return $this->executionTime;
  31. }
  32. public function getExecutedAt(): ?DateTimeImmutable
  33. {
  34. return $this->executedAt;
  35. }
  36. public function getVersion(): Version
  37. {
  38. return $this->version;
  39. }
  40. }