EmptySchemaProvider.php 726 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. declare(strict_types=1);
  3. namespace Doctrine\Migrations\Provider;
  4. use Doctrine\DBAL\Schema\AbstractSchemaManager;
  5. use Doctrine\DBAL\Schema\Schema;
  6. /**
  7. * The EmptySchemaProvider class is responsible for creating a Doctrine\DBAL\Schema\Schema instance that
  8. * represents the empty state of your database.
  9. *
  10. * @internal
  11. */
  12. final class EmptySchemaProvider implements SchemaProvider
  13. {
  14. /** @var AbstractSchemaManager */
  15. private $schemaManager;
  16. public function __construct(AbstractSchemaManager $schemaManager)
  17. {
  18. $this->schemaManager = $schemaManager;
  19. }
  20. public function createSchema(): Schema
  21. {
  22. return new Schema([], [], $this->schemaManager->createSchemaConfig());
  23. }
  24. }