Skip to content

Commit

Permalink
refactor: phpstan code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Oct 5, 2024
1 parent 39a6e40 commit c617b7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 0 additions & 7 deletions src/controllers/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
namespace nystudio107\disqus\controllers;

use Craft;

use craft\web\Controller;
use nystudio107\disqus\Disqus;

/**
* @author nystudio107
Expand All @@ -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
Expand Down
7 changes: 4 additions & 3 deletions src/services/DisqusService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c617b7b

Please sign in to comment.