I realize this goes against proper coding standards but I don't care.
I want my migration files checked by PHPCS.
I removed the following line from my phpcs.xml
file.
<exclude-pattern>*/migrations/*</exclude-pattern>
I then formatted the following migration file to see if it was working.
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class MigrationExampleClass extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('agreements', function (Blueprint $table) {
$table->unsignedInteger('subject_id')->nullable()->change();
$table->string('subject_type')->nullable()->change();
$table->dropUnique('agreements_type_user_id_subject_id_version_uniqueso;jfgjdfjgisdgjdfidfgjddfifgbjfgnidfbjdfbjfgnjdfbjdfvjdfbjdfbj');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('agreements', function (Blueprint $table) {
$table->string('subject_id')->change();
$table->string('subject_type')->change();
$table->unique(['type', 'user_id', 'subject_id', 'version']);
});
}
}
This would get flagged by PHPCS if this were a normal php file but it isn't.
Is there something else I have to do to get my migration files checked?