m181212_040717_settings_update   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 4
c 1
b 1
f 0
dl 0
loc 18
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A safeDown() 0 4 1
A safeUp() 0 4 1
1
<?php
2
3
namespace workingconcept\saaslink\migrations;
4
5
use Craft;
6
use craft\db\Migration;
7
use workingconcept\saaslink\SaasLink;
8
9
/**
10
 * m181212_040717_settings_update migration.
11
 */
12
class m181212_040717_settings_update extends Migration
13
{
14
    /**
15
     * @inheritdoc
16
     */
17
    public function safeUp()
18
    {
19
        // re-save plugin settings
20
        Craft::$app->plugins->savePluginSettings(SaasLink::$plugin);
0 ignored issues
show
Bug introduced by
The call to craft\services\Plugins::savePluginSettings() has too few arguments starting with settings. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        Craft::$app->plugins->/** @scrutinizer ignore-call */ 
21
                              savePluginSettings(SaasLink::$plugin);

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
21
    }
22
23
    /**
24
     * @inheritdoc
25
     */
26
    public function safeDown()
27
    {
28
        echo "m181212_040717_settings_update cannot be reverted.\n";
29
        return false;
30
    }
31
}
32