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 Mar 28, 2024
1 parent 00a9925 commit 6e8c7f9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/imagetransforms/SharpImageTransform.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use craft\models\AssetTransform;
use nystudio107\imageoptimize\ImageOptimize;
use nystudio107\imageoptimize\imagetransforms\ImageTransform;
use nystudio107\imageoptimize\models\Settings;
use yii\base\InvalidConfigException;
use function class_exists;

Expand Down Expand Up @@ -52,7 +53,7 @@ class SharpImageTransform extends ImageTransform
/**
* @var string
*/
public $baseUrl;
public $baseUrl = '';

// Public Properties
// =========================================================================
Expand All @@ -77,12 +78,12 @@ public static function displayName(): string
*/
public function getTransformUrl(Asset $asset, $transform)
{
$url = null;
$config = [];
/** @var Settings $settings */
$settings = ImageOptimize::$plugin->getSettings();

// Get the instance settings
$baseUrl = $this->baseUrl ?? '';
$baseUrl = $this->baseUrl;
if (ImageOptimize::$craft31) {
$baseUrl = Craft::parseEnv($baseUrl);
}
Expand Down

0 comments on commit 6e8c7f9

Please sign in to comment.