Total Complexity | 2 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class m210310_143242_oauth_scopes extends Migration |
||
14 | { |
||
15 | /** |
||
16 | * @inheritdoc |
||
17 | */ |
||
18 | public function safeUp() |
||
19 | { |
||
20 | $settings = Plugin::$plugin->getSettings(); |
||
21 | |||
22 | |||
23 | // Reset the OAuth scope to its default configuration |
||
24 | $settingsModel = new Settings(); |
||
25 | $settings->oauthScope = $settingsModel->oauthScope; |
||
26 | |||
27 | $plugin = Craft::$app->getPlugins()->getPlugin('facebook'); |
||
28 | Craft::$app->getPlugins()->savePluginSettings($plugin, $settings->toArray()); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @inheritdoc |
||
33 | */ |
||
34 | public function safeDown() |
||
38 | } |
||
39 | } |
||
40 |