Skip to content

Commit 9f13d23

Browse files
committed
feat: Support PHPStan Level 7
1 parent 45e2357 commit 9f13d23

466 files changed

Lines changed: 2638 additions & 710 deletions

File tree

Some content is hidden

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

database/migrations/2019_03_11_193513_patch_authoritable.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ public function up()
2121
foreach ($prms as $prm) {
2222
// foreach each authoritable table
2323
foreach (['system_authoritables', 'value_authoritables'] as $table) {
24+
/** @phpstan-ignore-next-line */
2425
if (!\Schema::hasTable($table)) {
2526
continue;
2627
}
2728

29+
/** @phpstan-ignore-next-line */
2830
\DB::table($table)
2931
->where('morph_type', strval($prm['int']))
3032
->update([

database/migrations/2019_04_25_185014_drop_unique_keys.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,19 @@ public function up()
3232
*/
3333
public function down()
3434
{
35+
/** @phpstan-ignore-next-line */
3536
if (\Schema::hasTable('dashboards')) {
3637
Schema::table('dashboards', function (Blueprint $table) {
3738
$table->unique(['dashboard_name']);
3839
});
3940
}
41+
/** @phpstan-ignore-next-line */
4042
if (\Schema::hasTable('roles')) {
4143
Schema::table('roles', function (Blueprint $table) {
4244
$table->unique(['role_name']);
4345
});
4446
}
47+
/** @phpstan-ignore-next-line */
4548
if (\Schema::hasTable('plugins')) {
4649
Schema::table('plugins', function (Blueprint $table) {
4750
$table->unique(['plugin_name']);

database/migrations/2019_05_18_164730_support_for_v1_2.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function up()
5656
}
5757

5858
// get all deleted_at, deleted_user_id's column
59+
/** @phpstan-ignore-next-line */
5960
$tables = \Schema::getTableListing();
6061
foreach ($tables as $table) {
6162
$this->dropDeletedRecord($table);
@@ -103,6 +104,7 @@ protected function dropExmTables()
103104
return;
104105
}
105106

107+
/** @phpstan-ignore-next-line */
106108
foreach (DB::table('custom_tables')->whereNotNull('deleted_at')->get() as $value) {
107109
// drop deleted table, so don't call getDBTableName function
108110
Schema::dropIfExists('exm__' . $value->suuid);
@@ -129,6 +131,7 @@ protected function deleteRecord($table_name, $classname)
129131
protected function addIndex()
130132
{
131133
foreach (static::ADD_INDEX_TABLES as $table_name => $column_name) {
134+
/** @phpstan-ignore-next-line */
132135
$columns = \Schema::getIndexDefinitions($table_name, $column_name);
133136

134137
if (count($columns) > 0) {
@@ -153,12 +156,14 @@ protected function addDeletedIndex()
153156
});
154157
}
155158

159+
/** @phpstan-ignore-next-line */
156160
$tables = \Schema::getTableListing();
157161
foreach ($tables as $table) {
158162
if (stripos($table, 'exm__') === false) {
159163
continue;
160164
}
161165

166+
/** @phpstan-ignore-next-line */
162167
$columns = collect(\Schema::getColumnListing($table))->filter(function ($row) {
163168
return $row == 'deleted_at';
164169
});
@@ -187,6 +192,7 @@ protected function dropDeletedRecord($table)
187192
return;
188193
}
189194

195+
/** @phpstan-ignore-next-line */
190196
$columns = collect(\Schema::getColumnListing($table))->filter(function ($row) {
191197
return in_array($row, ['deleted_at', 'deleted_user_id']);
192198
});
@@ -207,6 +213,7 @@ protected function dropDeletedRecord($table)
207213
*/
208214
protected function dropSuuidUnique($table)
209215
{
216+
/** @phpstan-ignore-next-line */
210217
$columns = \Schema::getUniqueDefinitions($table, 'suuid');
211218
if (count($columns) == 0) {
212219
return;

database/migrations/2019_05_28_165146_create_custom_column_multi.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ class CreateCustomColumnMulti extends Migration
1313
*/
1414
public function up()
1515
{
16+
/** @phpstan-ignore-next-line */
1617
$schema = DB::connection()->getSchemaBuilder();
1718

1819
$schema->blueprintResolver(function ($table, $callback) {
1920
return new ExtendedBlueprint($table, $callback);
2021
});
2122

23+
/** @phpstan-ignore-next-line */
2224
if (!\Schema::hasTable('custom_column_multisettings')) {
2325
$schema->create('custom_column_multisettings', function (ExtendedBlueprint $table) {
2426
$table->increments('id');

database/migrations/2019_06_12_193431_support_for_v1_3.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public function up()
1717
System::outside_api(!config('exment.disabled_outside_api', false));
1818

1919
// move use_label_flg to custom_column_multi
20+
/** @phpstan-ignore-next-line */
2021
\Artisan::call('exment:patchdata', ['action' => 'use_label_flg']);
2122
}
2223

database/migrations/2019_07_11_105602_support_for_v1_4.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class SupportForV14 extends Migration
1414
*/
1515
public function up()
1616
{
17+
/** @phpstan-ignore-next-line */
1718
if (!\Schema::hasTable(SystemTableName::EMAIL_CODE_VERIFY)) {
1819
Schema::create(SystemTableName::EMAIL_CODE_VERIFY, function (Blueprint $table) {
1920
$table->increments('id');
@@ -26,6 +27,7 @@ public function up()
2627
});
2728
}
2829

30+
/** @phpstan-ignore-next-line */
2931
if (\Schema::hasTable('login_users') && !\Schema::hasColumn('login_users', 'auth2fa_key')) {
3032
Schema::table('login_users', function (Blueprint $table) {
3133
$table->text('auth2fa_key')->nullable()->after('avatar');
@@ -34,6 +36,7 @@ public function up()
3436
}
3537

3638
// modify system_flg
39+
/** @phpstan-ignore-next-line */
3740
\Artisan::call('exment:patchdata', ['action' => 'system_flg_column']);
3841
}
3942

database/migrations/2019_07_12_120518_support_for_v2_0.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ class SupportForV20 extends Migration
1616
*/
1717
public function up()
1818
{
19+
/** @phpstan-ignore-next-line */
1920
$schema = DB::connection()->getSchemaBuilder();
2021

2122
$schema->blueprintResolver(function ($table, $callback) {
2223
return new ExtendedBlueprint($table, $callback);
2324
});
2425

26+
/** @phpstan-ignore-next-line */
2527
if (!\Schema::hasTable(SystemTableName::ROLE_GROUP)) {
2628
$schema->create(SystemTableName::ROLE_GROUP, function (ExtendedBlueprint $table) {
2729
$table->increments('id');
@@ -33,6 +35,7 @@ public function up()
3335
});
3436
}
3537

38+
/** @phpstan-ignore-next-line */
3639
if (!\Schema::hasTable(SystemTableName::ROLE_GROUP_PERMISSION)) {
3740
$schema->create(SystemTableName::ROLE_GROUP_PERMISSION, function (ExtendedBlueprint $table) {
3841
$table->increments('id');
@@ -47,6 +50,7 @@ public function up()
4750
});
4851
}
4952

53+
/** @phpstan-ignore-next-line */
5054
if (!\Schema::hasTable(SystemTableName::ROLE_GROUP_USER_ORGANIZATION)) {
5155
$schema->create(SystemTableName::ROLE_GROUP_USER_ORGANIZATION, function (ExtendedBlueprint $table) {
5256
$table->increments('id');
@@ -60,6 +64,7 @@ public function up()
6064
});
6165
}
6266

67+
/** @phpstan-ignore-next-line */
6368
if (!\Schema::hasTable(SystemTableName::CUSTOM_VALUE_AUTHORITABLE)) {
6469
$schema->create(SystemTableName::CUSTOM_VALUE_AUTHORITABLE, function (ExtendedBlueprint $table) {
6570
$table->increments('id');
@@ -78,6 +83,7 @@ public function up()
7883
});
7984
}
8085

86+
/** @phpstan-ignore-next-line */
8187
if (!\Schema::hasTable(SystemTableName::NOTIFY_NAVBAR)) {
8288
$schema->create(SystemTableName::NOTIFY_NAVBAR, function (ExtendedBlueprint $table) {
8389
$table->increments('id');
@@ -110,8 +116,11 @@ public function up()
110116
}
111117

112118
// patch role group and mail template
119+
/** @phpstan-ignore-next-line */
113120
\Artisan::call('exment:patchdata', ['action' => 'role_group']);
121+
/** @phpstan-ignore-next-line */
114122
\Artisan::call('exment:patchdata', ['action' => 'notify_saved']);
123+
/** @phpstan-ignore-next-line */
115124
\Artisan::call('exment:patchdata', ['action' => 'alldata_view']);
116125

117126
// remove unused role
@@ -129,6 +138,7 @@ public function down()
129138
{
130139
Schema::dropIfExists(SystemTableName::NOTIFY_NAVBAR);
131140

141+
/** @phpstan-ignore-next-line */
132142
if (!\Schema::hasTable('notifies')) {
133143
Schema::table('notifies', function ($table) {
134144
$table->dropColumn('custom_view_id');

database/migrations/2019_08_07_095018_init_column.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class InitColumn extends Migration
1111
*/
1212
public function up()
1313
{
14+
/** @phpstan-ignore-next-line */
1415
\Artisan::call('exment:patchdata', ['action' => 'init_column']);
1516
}
1617

database/migrations/2019_08_19_151648_support_for_v2_1.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ class SupportForV21 extends Migration
1313
*/
1414
public function up()
1515
{
16+
/** @phpstan-ignore-next-line */
1617
$schema = DB::connection()->getSchemaBuilder();
1718

1819
$schema->blueprintResolver(function ($table, $callback) {
1920
return new ExtendedBlueprint($table, $callback);
2021
});
2122

23+
/** @phpstan-ignore-next-line */
2224
if (!\Schema::hasTable('custom_operations')) {
2325
$schema->create('custom_operations', function (ExtendedBlueprint $table) {
2426
$table->increments('id');
@@ -31,6 +33,7 @@ public function up()
3133
});
3234
}
3335

36+
/** @phpstan-ignore-next-line */
3437
if (!\Schema::hasTable('custom_operation_columns')) {
3538
$schema->create('custom_operation_columns', function (ExtendedBlueprint $table) {
3639
$table->increments('id');
@@ -45,7 +48,9 @@ public function up()
4548
});
4649
}
4750

51+
/** @phpstan-ignore-next-line */
4852
\Artisan::call('exment:patchdata', ['action' => 'move_plugin']);
53+
/** @phpstan-ignore-next-line */
4954
\Artisan::call('exment:patchdata', ['action' => 'move_template']);
5055
}
5156

database/migrations/2019_09_12_120518_support_for_v2_1_4.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ class SupportForV214 extends Migration
1414
*/
1515
public function up()
1616
{
17+
/** @phpstan-ignore-next-line */
1718
\Artisan::call('exment:patchdata', ['action' => 'zip_password']);
19+
/** @phpstan-ignore-next-line */
1820
\Artisan::call('exment:patchdata', ['action' => 'alldata_view']);
1921

2022
if (!Schema::hasColumn('plugins', 'plugin_types') && Schema::hasColumn('plugins', 'plugin_type')) {

0 commit comments

Comments
 (0)