Skip to content

Commit

Permalink
CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenckens committed Feb 9, 2024
1 parent 5db43e8 commit e86cf1c
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 20 deletions.
6 changes: 2 additions & 4 deletions src/SplashingImages.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use craft\web\UrlManager;
use studioespresso\splashingimages\models\Settings;
use studioespresso\splashingimages\services\SplashingImagesService as SplashingImagesServiceService;
use studioespresso\splashingimages\variables\SplashingImagesVariable;
use yii\base\Event;

/**
Expand Down Expand Up @@ -62,7 +61,7 @@ public function init(): void
Event::on(
UrlManager::class,
UrlManager::EVENT_REGISTER_CP_URL_RULES,
function (RegisterUrlRulesEvent $event) {
function(RegisterUrlRulesEvent $event) {
$event->rules['splashing-images'] = 'splashing-images/default/index';
$event->rules['splashing-images/<page:\d+>'] = 'splashing-images/default/index';
$event->rules['splashing-images/curated'] = 'splashing-images/default/curated';
Expand All @@ -80,7 +79,7 @@ function (RegisterUrlRulesEvent $event) {
Event::on(
Plugins::class,
Plugins::EVENT_AFTER_INSTALL_PLUGIN,
function (PluginEvent $event) {
function(PluginEvent $event) {
if ($event->plugin->id === $this->id) {
// Redirect to plugin settings
$request = Craft::$app->getRequest();
Expand All @@ -92,7 +91,6 @@ function (PluginEvent $event) {
}
}
);

}

// Protected Methods
Expand Down
1 change: 0 additions & 1 deletion src/assetbundles/SplashingImages/SplashingImagesAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace studioespresso\splashingimages\assetbundles\SplashingImages;

use Craft;
use craft\web\AssetBundle;
use craft\web\assets\cp\CpAsset;

Expand Down
6 changes: 2 additions & 4 deletions src/controllers/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
*/
class DefaultController extends Controller
{

/**
* @var UnsplashService
*/
Expand All @@ -47,7 +46,7 @@ public function actionIndex($page = 1): Response
{
$data = $this->unsplash->getLatest($page);
return $this->renderTemplate('splashing-images/_index', [
'data' => $data
'data' => $data,
]);
}

Expand Down Expand Up @@ -75,8 +74,7 @@ public function actionSearch(string $query, int $page): bool|Response
$data = $this->unsplash->search($query, $page);
return $this->renderTemplate('splashing-images/_index', [
'query' => $query,
'data' => $data
'data' => $data,
]);
}

}
6 changes: 2 additions & 4 deletions src/controllers/DownloadController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function actionIndex(): \yii\web\Response|false

$assets = Craft::$app->getAssets();
$settings = SplashingImages::$plugin->getSettings();
if(!isset($settings->destination)) {
if (!isset($settings->destination)) {
$returnData['success'] = false;
$returnData['message'] = Craft::t('splashing-images', 'Please set a file destination in settings so images can be saved');
return $this->asJson($returnData);
Expand Down Expand Up @@ -82,7 +82,7 @@ public function actionIndex(): \yii\web\Response|false
$asset = new Asset();
$asset->tempFilePath = $tempPath;
$asset->filename = $tmpImage;
if($photo->description) {
if ($photo->description) {
$asset->alt = $photo->description;
}
$asset->newFolderId = $folder->id;
Expand All @@ -102,7 +102,5 @@ public function actionIndex(): \yii\web\Response|false
}
return $this->asJson($returnData);
exit;

}

}
1 change: 0 additions & 1 deletion src/migrations/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
namespace studioespresso\splashingimages\migrations;

use Craft;
use craft\config\DbConfig;
use craft\db\Migration;
use studioespresso\splashingimages\records\UserRecord;

Expand Down
4 changes: 2 additions & 2 deletions src/models/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

namespace studioespresso\splashingimages\models;

use studioespresso\splashingimages\SplashingImages;

use Craft;

use craft\base\Model;
use studioespresso\splashingimages\SplashingImages;

/**
* SplashingImages Settings Model
Expand Down
5 changes: 2 additions & 3 deletions src/services/UnsplashService.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

use Craft;
use craft\base\Component;
use Unsplash\HttpClient;
use Unsplash\Photo;
use Unsplash\Search;
use Unsplash\HttpClient;

/**
* SplashingImagesService Service
Expand All @@ -31,12 +31,11 @@
*/
class UnsplashService extends Component
{

public function __construct(array $config = [])
{
HttpClient::init([
'applicationId' => 'f2f0833b9b95a11260cdbb20622e4990579254f787705ebe298cfdad4415198e',
'utmSource' => 'Craft 3 Unsplash'
'utmSource' => 'Craft 3 Unsplash',
]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/translations/nl/splashing-images.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"Plugin Label" => "Plugin Label",
"You can give the plugin in different name in the CP navigation here" => "Met dit veld kan je de naam van de plugin in het controle paneel veranderen.",
"Volume" => "Volume",
"Select the volume where your images should be save" => "Selecteer het volume waar je de afbeeldingen in wil bewaren "
"Select the volume where your images should be save" => "Selecteer het volume waar je de afbeeldingen in wil bewaren ",

];

0 comments on commit e86cf1c

Please sign in to comment.