@@ -86,13 +86,14 @@ public function run(): void
8686 } else {
8787 $ config = $ this ->getConfig ($ path );
8888 }
89+ $ application = $ config ->get ('application ' ) ?? [];
8990
9091 // Multiple dir
9192 $ migrationsDir = [];
9293 if ($ this ->parser ->has ('migrations ' )) {
9394 $ migrationsDir = explode (', ' , $ this ->parser ->get ('migrations ' ));
94- } elseif (isset ($ config [ ' application ' ] ['migrationsDir ' ])) {
95- $ migrationsDir = explode (', ' , $ config [ ' application ' ] ['migrationsDir ' ]);
95+ } elseif (isset ($ application ['migrationsDir ' ])) {
96+ $ migrationsDir = explode (', ' , $ application ['migrationsDir ' ]);
9697 }
9798
9899 if (!empty ($ migrationsDir )) {
@@ -113,19 +114,20 @@ public function run(): void
113114 * Keep migrations log in db either "log-in-db" option or "logInDb"
114115 * config variable from "application" block
115116 */
116- $ migrationsInDb = $ config [ ' application ' ] ['logInDb ' ] ?? $ this ->parser ->has ('log-in-db ' );
117+ $ migrationsInDb = $ application ['logInDb ' ] ?? $ this ->parser ->has ('log-in-db ' );
117118
118119 /**
119120 * Migrations naming is timestamp-based rather than traditional, dotted versions
120121 * either "ts-based" option or "migrationsTsBased" config variable from "application" block
121122 */
122- $ migrationsTsBased = $ config [ ' application ' ] ['migrationsTsBased ' ] ?? $ this ->parser ->has ('ts-based ' );
123+ $ migrationsTsBased = $ application ['migrationsTsBased ' ] ?? $ this ->parser ->has ('ts-based ' );
123124
124- $ noAutoIncrement = $ config ['application ' ]['no-auto-increment ' ] ?? $ this ->parser ->has ('no-auto-increment ' );
125- $ skipRefSchema = $ config ['application ' ]['skip-ref-schema ' ] ?? $ this ->parser ->has ('skip-ref-schema ' );
126- $ skipForeignChecks = $ config ['application ' ]['skip-foreign-checks ' ] ?? $ this ->parser ->has ('skip-foreign-checks ' );
127125
128- $ descr = $ config ['application ' ]['descr ' ] ?? $ this ->parser ->get ('descr ' );
126+ $ noAutoIncrement = $ application ['no-auto-increment ' ] ?? $ this ->parser ->has ('no-auto-increment ' );
127+ $ skipRefSchema = $ application ['skip-ref-schema ' ] ?? $ this ->parser ->has ('skip-ref-schema ' );
128+ $ skipForeignChecks = $ application ['skip-foreign-checks ' ] ?? $ this ->parser ->has ('skip-foreign-checks ' );
129+
130+ $ descr = $ application ['descr ' ] ?? $ this ->parser ->get ('descr ' );
129131 $ tableName = $ this ->parser ->get ('table ' , '@ ' );
130132
131133 switch ($ action ) {
@@ -210,11 +212,12 @@ public function getHelp(): void
210212 protected function exportFromTables ($ config ): array
211213 {
212214 $ tables = [];
215+ $ application = $ config ->get ('application ' ) ?? [];
213216
214217 if ($ this ->parser ->has ('exportDataFromTables ' )) {
215218 $ tables = explode (', ' , $ this ->parser ->get ('exportDataFromTables ' ));
216- } elseif (isset ($ config [ ' application ' ] ['exportDataFromTables ' ])) {
217- $ configTables = $ config [ ' application ' ] ['exportDataFromTables ' ];
219+ } elseif (isset ($ application ['exportDataFromTables ' ])) {
220+ $ configTables = $ application ['exportDataFromTables ' ];
218221 if ($ configTables instanceof Config) {
219222 $ tables = $ configTables ->toArray ();
220223 } else {
0 commit comments