yiisoft / yii2-coding-standards

Yii 2 coding standards
182 stars 49 forks source link

Migrations generate class not valid CaseCamel #14

Closed githubjeka closed 9 years ago

githubjeka commented 10 years ago

Оr add it to an exception in this expansion, or change the class name generation, but so convenient to underscore ^_^

P.S. And phpcs requires use namespace

samdark commented 10 years ago

@githubjeka please elaborate. It's not clear what you're doing and what's going wrong.

githubjeka commented 10 years ago

run php yii migrate/create init - get file

<?php

use yii\db\Schema;
use yii\db\Migration;

class m140724_122739_init extends Migration
{
    public function up()
    {

    }

    public function down()
    {
        echo "m140724_122739_init cannot be reverted.\n";

        return false;
    }
}

phpcs:

Class name "m140724_122739_init" is not in camel caps format

Each class must be in namespace
samdark commented 10 years ago

I see. Yeah, need to ignore migrations somehow.

samdark commented 9 years ago

Migrations could be ignored using --ignore. There's nothing to fix from our side.