diff --git a/src/CarbonTracker.php b/src/CarbonTracker.php index cc74cde..8e324ff 100644 --- a/src/CarbonTracker.php +++ b/src/CarbonTracker.php @@ -56,7 +56,7 @@ public function init(): void } // Defer most setup tasks until Craft is fully initialized - Craft::$app->onInit(function () { + Craft::$app->onInit(function() { $this->attachEventHandlers(); }); } @@ -77,7 +77,7 @@ protected function settingsHtml(): ?string private function attachEventHandlers(): void { Event::on(Entry::class, Entry::EVENT_AFTER_SAVE, - function (ModelEvent $event) { + function(ModelEvent $event) { /** @var Entry $entry */ $entry = $event->sender; if (!ElementHelper::isDraftOrRevision($entry) && $entry->getUrl()) { @@ -92,7 +92,7 @@ function (ModelEvent $event) { Event::on( Entry::class, Entry::EVENT_DEFINE_SIDEBAR_HTML, - function (DefineHtmlEvent $event) { + function(DefineHtmlEvent $event) { /** @var Entry $entry */ $entry = $event->sender; try { diff --git a/src/console/controllers/TestController.php b/src/console/controllers/TestController.php index 2d427e6..e9f120f 100644 --- a/src/console/controllers/TestController.php +++ b/src/console/controllers/TestController.php @@ -14,6 +14,4 @@ public function actionIndex(int $id): void $data = CarbonTracker::getInstance()->api->getSite($entry); dd($data); } - - } diff --git a/src/jobs/CarbonStatsJob.php b/src/jobs/CarbonStatsJob.php index 8d1f5a6..0fb6155 100644 --- a/src/jobs/CarbonStatsJob.php +++ b/src/jobs/CarbonStatsJob.php @@ -29,8 +29,8 @@ protected function defaultDescription(): string */ public function execute($queue): void { - $entry = Entry::findOne(['id' => $this->entryId,'siteId' => $this->siteId]); - if($entry) { + $entry = Entry::findOne(['id' => $this->entryId, 'siteId' => $this->siteId]); + if ($entry) { CarbonTracker::getInstance()->stats->upsertDataForEntry($entry); } }