NameIsReserved.php 584 B

123456789101112131415161718192021222324
  1. <?php
  2. declare(strict_types=1);
  3. namespace Doctrine\Migrations\Finder\Exception;
  4. use InvalidArgumentException;
  5. use function sprintf;
  6. use const PHP_EOL;
  7. final class NameIsReserved extends InvalidArgumentException implements FinderException
  8. {
  9. public static function new(string $version): self
  10. {
  11. return new self(sprintf(
  12. 'Cannot load a migrations with the name "%s" because it is reserved by Doctrine Migrations.'
  13. . PHP_EOL
  14. . 'It is used to revert all migrations including the first one.',
  15. $version
  16. ));
  17. }
  18. }