Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mmikkel committed Apr 18, 2022
1 parent ffd6a65 commit e24ae85
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/CacheFlag.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ protected function initProjectConfig()
[$this->projectConfig, 'onProjectConfigRebuild']
);

Craft::$app->projectConfig
Craft::$app->getProjectConfig()
->onAdd('cacheFlags.{uid}', [$this->projectConfig, 'onProjectConfigChange'])
->onUpdate('cacheFlags.{uid}', [$this->projectConfig, 'onProjectConfigChange'])
->onRemove('cacheFlags.{uid}', [$this->projectConfig, 'onProjectConfigDelete']);
Expand Down
4 changes: 2 additions & 2 deletions src/migrations/m200722_000315_projectconfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class m200722_000315_projectconfig extends Migration
public function safeUp()
{
// Don't make the same config changes twice
$schemaVersion = Craft::$app->projectConfig
$schemaVersion = Craft::$app->getProjectConfig()
->get('plugins.cache-flag.schemaVersion', true);

if (\version_compare($schemaVersion, '1.0.1', '>=')) {
Expand Down Expand Up @@ -73,7 +73,7 @@ public function safeUp()

$path = "cacheFlags.{$row['uid']}";

Craft::$app->projectConfig->set($path, [
Craft::$app->getProjectConfig()->set($path, [
'source' => $source,
'flags' => $row['flags'],
]);
Expand Down
4 changes: 2 additions & 2 deletions src/services/CacheFlagService.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function saveFlags($flags, string $sourceColumn, string $sourceValue)

// Save it to the project config
$path = "cacheFlags.{$uid}";
Craft::$app->projectConfig->set($path, [
Craft::$app->getProjectConfig()->set($path, [
'source' => "$sourceKey:$sourceValue",
'flags' => $flags,
]);
Expand All @@ -176,7 +176,7 @@ public function deleteFlagsBySource(string $sourceColumn, string $sourceValue)

// Remove it from the project config
$path = "cacheFlags.{$uid}";
Craft::$app->projectConfig->remove($path);
Craft::$app->getProjectConfig()->remove($path);
}

/**
Expand Down

0 comments on commit e24ae85

Please sign in to comment.