PHP 8.2.31
Preview: MigratorException.php Size: 1.24 KB
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Migrator/MigratorException.php

<?php declare(strict_types = 1);

namespace MailPoet\Migrator;

if (!defined('ABSPATH')) exit;


use MailPoet\InvalidStateException;
use Throwable;

class MigratorException extends InvalidStateException {
  public static function templateFileReadFailed(string $path): self {
    return self::create()->withMessage(
      sprintf('Could not read migration template file "%s".', $path)
    );
  }

  public static function migrationFileWriteFailed(string $path): self {
    return self::create()->withMessage(
      sprintf('Could not write migration file "%s".', $path)
    );
  }

  public static function migrationClassNotFound(string $className): self {
    return self::create()->withMessage(
      sprintf('Migration class "%s" not found.', $className)
    );
  }

  public static function migrationClassIsNotASubclassOf(string $className, string $parentClassName): self {
    return self::create()->withMessage(
      sprintf('Migration class "%1$s" is not a subclass of "%2$s".', $className, $parentClassName)
    );
  }

  public static function migrationFailed(string $className, Throwable $previous): self {
    return self::create($previous)->withMessage(
      sprintf('Migration "%1$s" failed. Details: %2$s', $className, $previous->getMessage())
    );
  }
}

Directory Contents

Dirs: 0 × Files: 10

Name Size Perms Modified Actions
4.47 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
0 B lrw-r--r-- 2023-04-04 05:35:40
Edit Download
796 B lrw-r--r-- 2023-04-04 05:35:40
Edit Download
1.72 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
543 B lrw-r--r-- 2023-04-04 05:35:40
Edit Download
2.54 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
1.24 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
1.83 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
1.39 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download
2.25 KB lrw-r--r-- 2023-04-04 05:35:40
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).