-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVersionInterface.php
More file actions
36 lines (31 loc) · 922 Bytes
/
VersionInterface.php
File metadata and controls
36 lines (31 loc) · 922 Bytes
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
<?php
namespace Andrey\StuffVersioned;
interface VersionInterface
{
/**
* check will be called before the actual run and before
* checking for inconsistencies.
*
* If check is false, it will skip both operations - the warning for
* inconsistency and the actual run.
*
* If no check is needed, you can simply return true.
*/
public function check(): bool;
/**
* run is the desired behavior to be attached to this version.
*/
public function run(): void;
/**
* rollback is executed if something went wrong while performing
* the run process. It should aim to revert the progress done by the run process.
*/
public function rollback(): void;
/**
* getId should return a unique identifier for this version within the
* entire manager session.
*
* @return string
*/
public function getId(): string;
}