src/migrations/m231211_191728_addSchemaCol.php
Avoid using static access to class '\studioespresso\seofields\records\DefaultsRecord' in method 'safeUp'. Open
Open
DefaultsRecord::tableName(),
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Class extends undeclared class \craft\db\Migration
Open
Open
class m231211_191728_addSchemaCol extends Migration
- Exclude checks
Call to undeclared method \studioespresso\seofields\migrations\m231211_191728_addSchemaCol::addColumn
Open
Open
$this->addColumn(
- Exclude checks
Call to undeclared method \studioespresso\seofields\migrations\m231211_191728_addSchemaCol::text
Open
Open
$this->text()->after('robots')
- Exclude checks
The class m231211_191728_addSchemaCol is not named in CamelCase. Open
Open
class m231211_191728_addSchemaCol extends Migration
{
/**
* @inheritdoc
*/
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Class name "m231211_191728_addSchemaCol" is not in camel caps format Open
Open
class m231211_191728_addSchemaCol extends Migration
- Exclude checks