From c617b7b9ad6a0e2140f5417d187b2d3e5c3f9455 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Sat, 5 Oct 2024 18:34:28 -0400 Subject: [PATCH] refactor: phpstan code cleanup --- src/controllers/DefaultController.php | 7 ------- src/services/DisqusService.php | 7 ++++--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/controllers/DefaultController.php b/src/controllers/DefaultController.php index c81cc10..a1b1e0a 100644 --- a/src/controllers/DefaultController.php +++ b/src/controllers/DefaultController.php @@ -12,9 +12,7 @@ namespace nystudio107\disqus\controllers; use Craft; - use craft\web\Controller; -use nystudio107\disqus\Disqus; /** * @author nystudio107 @@ -26,11 +24,6 @@ class DefaultController extends Controller // Protected Properties // ========================================================================= - /** - * @var bool|array Allows anonymous access to this controller's actions. - * The actions must be in 'kebab-case' - * @access protected - */ protected $allowAnonymous = ['logout-redirect']; // Public Methods diff --git a/src/services/DisqusService.php b/src/services/DisqusService.php index 611e15f..5ca7103 100644 --- a/src/services/DisqusService.php +++ b/src/services/DisqusService.php @@ -12,12 +12,11 @@ namespace nystudio107\disqus\services; use Craft; - use craft\base\Component; use craft\helpers\Template; +use craft\web\User; use craft\web\View; use nystudio107\disqus\Disqus; - use yii\base\Exception; use yii\base\InvalidConfigException; @@ -132,7 +131,9 @@ protected function getSSOVars(): array $data = []; // Set the data array - $currentUser = Craft::$app->getUser()->getIdentity(); + /** @var User $user */ + $user = Craft::$app->getUser(); + $currentUser = $user->getIdentity(); if ($currentUser) { $data['id'] = $currentUser->id; if (Craft::$app->getConfig()->getGeneral()->useEmailAsUsername) {