/
MigrationIncompleteException.php
55 lines (49 loc) · 1.41 KB
/
MigrationIncompleteException.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
namespace Concrete\Core\Updater\Migrations;
use RuntimeException;
/**
* Exception thrown when the migration.
*/
class MigrationIncompleteException extends RuntimeException
{
/**
* The number of applied migrations.
*
* @var int
*/
protected $performedMigrations;
/**
* The number of remaining migrations.
*
* @var int
*/
protected $remainingMigrations;
/**
* @param int $performedMigrations the number of applied migrations
* @param int $remainingMigrations the number of remaining migrations
*/
public function __construct($performedMigrations, $remainingMigrations)
{
$this->performedMigrations = (int) $performedMigrations;
$this->remainingMigrations = (int) $remainingMigrations;
parent::__construct(t(/*i18n: %1$s and %2$s are numbers */'The upgrade process is incomplete (migrations performed: %1$s, migrations remaining: %2$s). Please execute the upgrade process again.'), $this->performedMigrations, $this->remainingMigrations);
}
/**
* Get the number of applied migrations.
*
* @return int
*/
public function getPerformedMigrations()
{
return $this->performedMigrations;
}
/**
* Get the number of remaining migrations.
*
* @return int
*/
public function getRemainingMigrations()
{
return $this->remainingMigrations;
}
}