src/database/migrations/2015_11_28_071315_create_global_settings_table.php
Avoid using static access to class 'Schema' in method 'down'. Open
Open
Schema::drop('global_settings');
- 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
Avoid using static access to class 'Schema' in method 'up'. Open
Open
Schema::create('global_settings', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->mediumText('value');
- 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
Avoid using short method names like CreateGlobalSettingsTable::up(). The configured minimum method name length is 3. Open
Open
public function up()
{
Schema::create('global_settings', function (Blueprint $table) {
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}