Code Duplication    Length = 10-12 lines in 2 locations

src/Xethron/MigrationsGenerator/MigrateGenerateCommand.php 2 locations

@@ 226-235 (lines=10) @@
223
	 * @param  array $tables List of tables to create migrations for
224
	 * @return void
225
	 */
226
	protected function generateTablesAndIndices( array $tables )
227
	{
228
		$this->method = 'create';
229
230
		foreach ( $tables as $table ) {
231
			$this->table = $table;
232
			$this->migrationName = 'create_'. $this->table .'_table';
233
			$this->fields = $this->schemaGenerator->getFields( $this->table );
234
		}
235
	}
236
237
	/**
238
	 * Generate foreign key migrations.
@@ 243-254 (lines=12) @@
240
	 * @param  array $tables List of tables to create migrations for
241
	 * @return void
242
	 */
243
	protected function generateForeignKeys( array $tables )
244
	{
245
		$this->method = 'table';
246
247
		foreach ( $tables as $table ) {
248
			$this->table = $table;
249
			$this->migrationName = 'add_foreign_keys_to_'. $this->table .'_table';
250
			$this->fields = $this->schemaGenerator->getForeignKeyConstraints( $this->table );
251
252
			$this->generate();
253
		}
254
	}
255
256
	/**
257
	 * Generate Migration for the current table.