InvalidLoader.php 793 B

12345678910111213141516171819202122232425
  1. <?php
  2. declare(strict_types=1);
  3. namespace Doctrine\Migrations\Configuration\Exception;
  4. use Doctrine\Migrations\Configuration\Connection\ConnectionLoader;
  5. use Doctrine\Migrations\Configuration\EntityManager\EntityManagerLoader;
  6. use InvalidArgumentException;
  7. use function get_class;
  8. use function sprintf;
  9. final class InvalidLoader extends InvalidArgumentException implements ConfigurationException
  10. {
  11. public static function noMultipleConnections(ConnectionLoader $loader): self
  12. {
  13. return new self(sprintf('Only one connection is supported by %s', get_class($loader)));
  14. }
  15. public static function noMultipleEntityManagers(EntityManagerLoader $loader): self
  16. {
  17. return new self(sprintf('Only one entity manager is supported by %s', get_class($loader)));
  18. }
  19. }