Total Complexity | 5 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class m200925_135118_refactor_oauth_provider_options extends Migration |
||
13 | { |
||
14 | /** |
||
15 | * @inheritdoc |
||
16 | */ |
||
17 | public function safeUp() |
||
18 | { |
||
19 | $projectConfig = Craft::$app->projectConfig; |
||
20 | |||
21 | // Don't make the same config changes twice |
||
22 | $schemaVersion = $projectConfig->get('plugins.videos.schemaVersion', true); |
||
|
|||
23 | |||
24 | if (version_compare($schemaVersion, '1.0.3', '<')) { |
||
25 | // Get OAuth provider options |
||
26 | $oauthProviderOptions = $projectConfig->get('plugins.videos.settings.oauthProviderOptions', true); |
||
27 | |||
28 | if (!is_array($oauthProviderOptions)) { |
||
29 | return true; |
||
30 | } |
||
31 | |||
32 | $oauthProviderOptions = ProjectConfig::unpackAssociativeArray($oauthProviderOptions); |
||
33 | |||
34 | // Reset OAuth provider options |
||
35 | $projectConfig->set('plugins.videos.settings.oauthProviderOptions', [], "Reset the oauth provider options"); |
||
36 | |||
37 | // Rebuild OAuth provider options |
||
38 | foreach ($oauthProviderOptions as $providerHandle => $provider) { |
||
39 | $projectConfig->set('plugins.videos.settings.oauthProviderOptions.' . $providerHandle, $provider, sprintf('Save the ā%sā provider', $providerHandle)); |
||
40 | } |
||
41 | } |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @inheritdoc |
||
46 | */ |
||
47 | public function safeDown(): bool |
||
51 | } |
||
52 | } |
||
53 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.