Skip to content

Commit 62fadeb

Browse files
author
Bizley
authored
Merge pull request #36 from bizley/list-parameters-2.x
List parameters 2.x
2 parents 0b79e48 + ebf0fa3 commit 62fadeb

File tree

91 files changed

+161
-151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+161
-151
lines changed

README.md

Lines changed: 4 additions & 4 deletions

composer.json

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,41 @@
11
{
2-
"name": "bizley/migration",
3-
"description": "Migration generator for Yii 2.",
4-
"type": "yii2-extension",
5-
"keywords": ["yii2", "migration", "migrate", "generator", "console"],
6-
"license": "Apache-2.0",
7-
"authors": [
8-
{
9-
"name": "Pawel Bizley Brzozowski",
10-
"email": "[email protected]"
11-
}
12-
],
13-
"support": {
14-
"source": "https://github.com/bizley/yii2-migration"
15-
},
16-
"require": {
17-
"ext-mbstring": "*",
18-
"php": ">=5.4.0 <7.1.0",
19-
"yiisoft/yii2": ">=2.0.11 <2.1.0"
20-
},
21-
"require-dev": {
22-
"phpunit/phpunit": "~4.8.36",
23-
"roave/security-advisories": "dev-master"
24-
},
25-
"autoload": {
26-
"psr-4": {"bizley\\migration\\": ""}
27-
},
28-
"repositories": [
29-
{
30-
"type": "composer",
31-
"url": "https://asset-packagist.org"
32-
}
33-
]
2+
"name": "bizley/migration",
3+
"description": "Migration generator for Yii 2.",
4+
"type": "yii2-extension",
5+
"keywords": ["yii2", "migration", "migrate", "generator", "console"],
6+
"license": "Apache-2.0",
7+
"authors": [
8+
{
9+
"name": "Pawel Bizley Brzozowski",
10+
"email": "[email protected]"
11+
}
12+
],
13+
"support": {
14+
"source": "https://github.com/bizley/yii2-migration"
15+
},
16+
"require": {
17+
"ext-mbstring": "*",
18+
"php": ">=5.4.0 <7.1.0",
19+
"yiisoft/yii2": ">=2.0.11 <2.1.0"
20+
},
21+
"require-dev": {
22+
"phpunit/phpunit": "~4.8.36",
23+
"roave/security-advisories": "dev-master"
24+
},
25+
"autoload": {
26+
"psr-4": {
27+
"bizley\\migration\\": "src/"
28+
}
29+
},
30+
"autoload-dev": {
31+
"psr-4": {
32+
"bizley\\tests\\": "tests/"
33+
}
34+
},
35+
"repositories": [
36+
{
37+
"type": "composer",
38+
"url": "https://asset-packagist.org"
39+
}
40+
]
3441
}

Generator.php renamed to src/Generator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function getTableSchema()
108108
protected function getTablePrimaryKey()
109109
{
110110
$data = [];
111-
if (method_exists($this->db->schema, 'getTablePrimaryKey')) {
111+
if (method_exists($this->db->schema, 'getTablePrimaryKey')) { // requires Yii 2.0.13
112112
/* @var $constraint \yii\db\Constraint */
113113
$constraint = $this->db->schema->getTablePrimaryKey($this->tableName, true);
114114
if ($constraint) {
@@ -129,7 +129,7 @@ protected function getTablePrimaryKey()
129129

130130
/**
131131
* Returns columns structure.
132-
* @param $indexes TableIndex[]
132+
* @param TableIndex[] $indexes
133133
* @return TableColumn[]
134134
* @throws InvalidConfigException
135135
*/
@@ -173,7 +173,7 @@ protected function getTableColumns($indexes = [])
173173
protected function getTableForeignKeys()
174174
{
175175
$data = [];
176-
if (method_exists($this->db->schema, 'getTableForeignKeys')) {
176+
if (method_exists($this->db->schema, 'getTableForeignKeys')) { // requires Yii 2.0.13
177177
$fks = $this->db->schema->getTableForeignKeys($this->tableName, true);
178178
/* @var $fk \yii\db\ForeignKeyConstraint */
179179
foreach ($fks as $fk) {
@@ -212,7 +212,7 @@ protected function getTableForeignKeys()
212212
protected function getTableIndexes()
213213
{
214214
$data = [];
215-
if (method_exists($this->db->schema, 'getTableIndexes')) {
215+
if (method_exists($this->db->schema, 'getTableIndexes')) { // requires Yii 2.0.13
216216
$idxs = $this->db->schema->getTableIndexes($this->tableName, true);
217217
/* @var $idx \yii\db\IndexConstraint */
218218
foreach ($idxs as $idx) {
File renamed without changes.

controllers/MigrationController.php renamed to src/controllers/MigrationController.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
use bizley\migration\Generator;
66
use bizley\migration\Updater;
7-
use Closure;
8-
use Exception;
97
use Yii;
108
use yii\base\Action;
119
use yii\base\InvalidConfigException;
@@ -22,13 +20,13 @@
2220
* Generates migration file based on the existing database table and previous migrations.
2321
*
2422
* @author Paweł Bizley Brzozowski
25-
* @version 2.3.2
23+
* @version 2.3.3
2624
* @license Apache 2.0
2725
* https://github.com/bizley/yii2-migration
2826
*/
2927
class MigrationController extends Controller
3028
{
31-
protected $version = '2.3.2';
29+
protected $version = '2.3.3';
3230

3331
/**
3432
* @var string Default command action.
@@ -48,7 +46,6 @@ class MigrationController extends Controller
4846
* Migration namespace should be resolvable as a path alias if prefixed with @, e.g. if you specify the namespace
4947
* 'app\migrations', the code Yii::getAlias('@app/migrations') should be able to return the file path to
5048
* the directory this namespace refers to.
51-
* Namespaced migrations have been added in Yii 2.0.10.
5249
* Alias -n
5350
* @since 1.1
5451
*/
@@ -76,9 +73,8 @@ class MigrationController extends Controller
7673
public $useTablePrefix = 1;
7774

7875
/**
79-
* @var Connection|array|string DB connection object or the application component ID of the DB connection to use
80-
* when creating migrations.
81-
* Starting from Yii 2.0.3, this can also be a configuration array for creating the object.
76+
* @var Connection|array|string DB connection object, configuration array, or the application component ID of
77+
* the DB connection to use when generating migrations.
8278
*/
8379
public $db = 'db';
8480

@@ -91,7 +87,7 @@ class MigrationController extends Controller
9187
public $migrationTable = '{{%migration}}';
9288

9389
/**
94-
* @var bool|string|int Whether to only display changes instead of create update migration.
90+
* @var bool|string|int Whether to only display changes instead of creating update migration.
9591
* Alias -s
9692
* @since 2.0
9793
*/
@@ -100,8 +96,8 @@ class MigrationController extends Controller
10096
/**
10197
* @var bool|string|int Whether to use general column schema instead of database specific.
10298
* Alias -g
103-
* Since 2.3.0 this property is 1 by default.
10499
* @since 2.0
100+
* Since 2.3.0 this property is 1 by default.
105101
*/
106102
public $generalSchema = 1;
107103

@@ -124,8 +120,8 @@ class MigrationController extends Controller
124120
*/
125121
public function options($actionID)
126122
{
127-
$options = parent::options($actionID);
128-
$createOptions = ['migrationPath', 'migrationNamespace', 'db', 'generalSchema', 'templateFile', 'useTablePrefix', 'fixHistory', 'migrationTable'];
123+
$options = array_merge(parent::options($actionID), ['db']);
124+
$createOptions = ['migrationPath', 'migrationNamespace', 'generalSchema', 'templateFile', 'useTablePrefix', 'fixHistory', 'migrationTable'];
129125
$updateOptions = ['showOnly', 'templateFileUpdate', 'skipMigrations'];
130126
switch ($actionID) {
131127
case 'create':
File renamed without changes.
File renamed without changes.

table/TableColumn.php renamed to src/table/TableColumn.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function getLength()
9090

9191
/**
9292
* Sets length of the column.
93-
* @param $value
93+
* @param int|string $value
9494
*/
9595
public function setLength($value)
9696
{
@@ -225,7 +225,7 @@ public function prepareSchemaAppend($table, $primaryKey, $autoIncrement)
225225

226226
/**
227227
* Escapes single quotes.
228-
* @param $value
228+
* @param string $value
229229
* @return mixed
230230
*/
231231
public function escapeQuotes($value)
@@ -235,7 +235,7 @@ public function escapeQuotes($value)
235235

236236
/**
237237
* Removes information of primary key in append property.
238-
* @param $schema
238+
* @param string $schema
239239
* @return null|string
240240
*/
241241
public function removePKAppend($schema)
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)