| Total Complexity | 3 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class CreateLaravelBlockerTable extends Migration |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Run the migrations. |
||
| 13 | * |
||
| 14 | * @return void |
||
| 15 | */ |
||
| 16 | public function up() |
||
| 17 | { |
||
| 18 | $blocked = new BlockedItem(); |
||
| 19 | $connection = $blocked->getConnectionName(); |
||
| 20 | $table = $blocked->getTableName(); |
||
| 21 | $tableCheck = Schema::connection($connection)->hasTable($table); |
||
| 22 | |||
| 23 | if (!$tableCheck) { |
||
| 24 | Schema::connection($connection)->create($table, function (Blueprint $table) { |
||
| 25 | $blockedType = new BlockedType(); |
||
| 26 | $connectionType = $blockedType->getConnectionName(); |
||
| 27 | $tableTypeName = $blockedType->getTableName(); |
||
| 28 | $table->increments('id'); |
||
| 29 | $table->integer('typeId')->unsigned()->index(); |
||
| 30 | $table->foreign('typeId')->references('id')->on($tableTypeName)->onDelete('cascade'); |
||
| 31 | $table->string('value')->unique(); |
||
| 32 | $table->longText('note')->nullable(); |
||
| 33 | $table->integer('userId')->unsigned()->index()->nullable(); |
||
| 34 | // $table->foreign('userId')->references('id')->on('users')->onDelete('cascade'); |
||
| 35 | $table->timestamps(); |
||
| 36 | $table->softDeletes(); |
||
| 37 | }); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Reverse the migrations. |
||
| 43 | * |
||
| 44 | * @return void |
||
| 45 | */ |
||
| 46 | public function down() |
||
| 53 | } |
||
| 54 | } |
||
| 55 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths