| Conditions | 4 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function safeUp(): bool |
||
| 17 | { |
||
| 18 | // Don't make the same config changes twice |
||
| 19 | $projectConfig = Craft::$app->getProjectConfig(); |
||
| 20 | $schemaVersion = $projectConfig->get('plugins.retour.schemaVersion', true); |
||
| 21 | |||
| 22 | if (version_compare($schemaVersion, '3.0.10', '<')) { |
||
| 23 | foreach ($projectConfig->get('graphql.schemas') ?? [] as $schemaUid => $schemaComponents) { |
||
| 24 | if (isset($schemaComponents['scope'])) { |
||
| 25 | $scope = $schemaComponents['scope']; |
||
| 26 | $scope[] = 'retour.all:read'; |
||
| 27 | |||
| 28 | $projectConfig->set("graphql.schemas.$schemaUid.scope", $scope); |
||
| 29 | } |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | return true; |
||
| 34 | } |
||
| 46 |