1 | <?php |
||
24 | abstract class AbstractMigration |
||
25 | { |
||
26 | /** @var Connection */ |
||
27 | protected $connection; |
||
28 | |||
29 | /** @var AbstractSchemaManager */ |
||
30 | protected $sm; |
||
31 | |||
32 | /** @var AbstractPlatform */ |
||
33 | protected $platform; |
||
34 | |||
35 | /** @var LoggerInterface */ |
||
36 | private $logger; |
||
37 | |||
38 | /** @var Query[] */ |
||
39 | private $plannedSql = []; |
||
40 | |||
41 | 31 | public function __construct(Connection $connection, LoggerInterface $logger) |
|
48 | |||
49 | /** |
||
50 | * Indicates the transactional mode of this migration. |
||
51 | * |
||
52 | * If this function returns true (default) the migration will be executed |
||
53 | * in one transaction, otherwise non-transactional state will be used to |
||
54 | * execute each of the migration SQLs. |
||
55 | * |
||
56 | * Extending class should override this function to alter the return value. |
||
57 | */ |
||
58 | 15 | public function isTransactional() : bool |
|
62 | |||
63 | 5 | public function getDescription() : string |
|
67 | |||
68 | 3 | public function warnIf(bool $condition, string $message = 'Unknown Reason') : void |
|
76 | |||
77 | /** |
||
78 | * @throws AbortMigration |
||
79 | */ |
||
80 | 11 | public function abortIf(bool $condition, string $message = 'Unknown Reason') : void |
|
86 | |||
87 | /** |
||
88 | * @throws SkipMigration |
||
89 | */ |
||
90 | 10 | public function skipIf(bool $condition, string $message = 'Unknown Reason') : void |
|
96 | |||
97 | /** |
||
98 | * @throws MigrationException|DBALException |
||
99 | */ |
||
100 | 10 | public function preUp(Schema $schema) : void |
|
103 | |||
104 | /** |
||
105 | * @throws MigrationException|DBALException |
||
106 | */ |
||
107 | 7 | public function postUp(Schema $schema) : void |
|
110 | |||
111 | /** |
||
112 | * @throws MigrationException|DBALException |
||
113 | */ |
||
114 | 2 | public function preDown(Schema $schema) : void |
|
117 | |||
118 | /** |
||
119 | * @throws MigrationException|DBALException |
||
120 | */ |
||
121 | 2 | public function postDown(Schema $schema) : void |
|
124 | |||
125 | /** |
||
126 | * @throws MigrationException|DBALException |
||
127 | */ |
||
128 | abstract public function up(Schema $schema) : void; |
||
129 | |||
130 | /** |
||
131 | * @throws MigrationException|DBALException |
||
132 | */ |
||
133 | 1 | public function down(Schema $schema) : void |
|
137 | |||
138 | /** |
||
139 | * @param mixed[] $params |
||
140 | * @param mixed[] $types |
||
141 | */ |
||
142 | 11 | protected function addSql( |
|
149 | |||
150 | /** |
||
151 | * @return Query[] |
||
152 | */ |
||
153 | 12 | public function getSql() : array |
|
157 | |||
158 | 1 | protected function write(string $message) : void |
|
162 | |||
163 | /** |
||
164 | * @throws IrreversibleMigration |
||
165 | */ |
||
166 | 2 | protected function throwIrreversibleMigrationException(?string $message = null) : void |
|
174 | } |
||
175 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.