diff --git a/src/Xethron/MigrationsGenerator/Generators/FieldGenerator.php b/src/Xethron/MigrationsGenerator/Generators/FieldGenerator.php index 0ac0220..c13646e 100644 --- a/src/Xethron/MigrationsGenerator/Generators/FieldGenerator.php +++ b/src/Xethron/MigrationsGenerator/Generators/FieldGenerator.php @@ -73,8 +73,8 @@ protected function getEnum($table) protected function setEnum(array $fields, $table) { foreach ($this->getEnum($table) as $column) { - $fields[$column->column_name]['type'] = 'enum'; - $fields[$column->column_name]['args'] = str_replace('enum(', 'array(', $column->column_type); + $fields[$column->COLUMN_NAME]['type'] = 'enum'; + $fields[$column->COLUMN_NAME]['args'] = str_replace('enum(', 'array(', $column->COLUMN_TYPE); } return $fields; } @@ -86,7 +86,7 @@ protected function setEnum(array $fields, $table) */ protected function getFields($columns, IndexGenerator $indexGenerator) { - $fields = array(); + $fields = []; foreach ($columns as $column) { $name = $column->getName(); $type = $column->getType()->getName(); @@ -242,7 +242,7 @@ protected function decorate($function, $args, $quotes = '\'') */ protected function getMultiFieldIndexes(IndexGenerator $indexGenerator) { - $indexes = array(); + $indexes = []; foreach ($indexGenerator->getMultiFieldIndexes() as $index) { $indexArray = [ 'field' => $index->columns, diff --git a/src/Xethron/MigrationsGenerator/Generators/ForeignKeyGenerator.php b/src/Xethron/MigrationsGenerator/Generators/ForeignKeyGenerator.php index 2237956..d1e030c 100644 --- a/src/Xethron/MigrationsGenerator/Generators/ForeignKeyGenerator.php +++ b/src/Xethron/MigrationsGenerator/Generators/ForeignKeyGenerator.php @@ -23,7 +23,7 @@ public function generate($table, $schema, $ignoreForeignKeyNames) $foreignKeys = $schema->listTableForeignKeys($table); - if ( empty( $foreignKeys ) ) return array(); + if ( empty( $foreignKeys ) ) return []; foreach ( $foreignKeys as $foreignKey ) { $fields[] = [ diff --git a/src/Xethron/MigrationsGenerator/Generators/IndexGenerator.php b/src/Xethron/MigrationsGenerator/Generators/IndexGenerator.php index 9a74d0a..da1531c 100644 --- a/src/Xethron/MigrationsGenerator/Generators/IndexGenerator.php +++ b/src/Xethron/MigrationsGenerator/Generators/IndexGenerator.php @@ -25,8 +25,8 @@ class IndexGenerator { */ public function __construct($table, $schema, $ignoreIndexNames) { - $this->indexes = array(); - $this->multiFieldIndexes = array(); + $this->indexes = []; + $this->multiFieldIndexes = []; $this->ignoreIndexNames = $ignoreIndexNames; $indexes = $schema->listTableIndexes( $table ); diff --git a/src/Xethron/MigrationsGenerator/MigrateGenerateCommand.php b/src/Xethron/MigrationsGenerator/MigrateGenerateCommand.php index 90b78d7..94c3e48 100644 --- a/src/Xethron/MigrationsGenerator/MigrateGenerateCommand.php +++ b/src/Xethron/MigrationsGenerator/MigrateGenerateCommand.php @@ -61,13 +61,13 @@ class MigrateGenerateCommand extends GeneratorCommand { * Namely: Columns, Indexes and Foreign Keys * @var array */ - protected $fields = array(); + protected $fields = []; /** * List of Migrations that has been done * @var array */ - protected $migrations = array(); + protected $migrations = []; /** * @var bool diff --git a/src/Xethron/MigrationsGenerator/MigrationsGeneratorServiceProvider.php b/src/Xethron/MigrationsGenerator/MigrationsGeneratorServiceProvider.php index 12c1b32..d26ee8d 100644 --- a/src/Xethron/MigrationsGenerator/MigrationsGeneratorServiceProvider.php +++ b/src/Xethron/MigrationsGenerator/MigrationsGeneratorServiceProvider.php @@ -53,7 +53,7 @@ public function boot() */ public function provides() { - return array(); + return []; } } diff --git a/src/Xethron/MigrationsGenerator/Syntax/Table.php b/src/Xethron/MigrationsGenerator/Syntax/Table.php index 7eb14fb..2eeea52 100644 --- a/src/Xethron/MigrationsGenerator/Syntax/Table.php +++ b/src/Xethron/MigrationsGenerator/Syntax/Table.php @@ -36,7 +36,7 @@ public function run(array $fields, $table, $connection = null, $method = 'table' */ protected function getItems(array $items) { - $result = array(); + $result = []; foreach($items as $item) { $result[] = $this->getItem($item); }