From 1a14bed91409e06239a623c3bacda92122f6aca3 Mon Sep 17 00:00:00 2001 From: Jan Henckens Date: Fri, 9 Feb 2024 20:10:43 +0100 Subject: [PATCH] Readme update --- README.md | 9 ++- composer.json | 2 +- phpstan.neon | 2 +- src/SplashingImages.php | 4 +- src/controllers/DownloadController.php | 2 + src/migrations/Install.php | 102 ------------------------- src/services/UnsplashService.php | 1 + 7 files changed, 12 insertions(+), 110 deletions(-) delete mode 100644 src/migrations/Install.php diff --git a/README.md b/README.md index b5f7378..aa2d8ef 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ -![Splashing Images](https://www.studioespresso.co/assets/github-banner-unsplash.png) +# Unsplash for Craft CMS + +unsplash.com, integrated right into your Craft CMS control panel 📸 + + +![Unsplash for Craft CMS](https://www.studioespresso.co/assets/Unsplash-Github-banner.png) -# Splashing Images for Craft CMS -unsplash.com integration for Craft CMS ## Installation diff --git a/composer.json b/composer.json index fd707b5..54ba258 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "studioespresso/craft-splashingimages", - "description": "unsplash.com integration for Craft 3", + "description": "unsplash.com integration for Craft CMS", "type": "craft-plugin", "version": "5.0.0-alpha.3", "keywords": [ diff --git a/phpstan.neon b/phpstan.neon index 32fb8a6..1c8211a 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,6 +2,6 @@ includes: - vendor/craftcms/phpstan/phpstan.neon parameters: - level: 1 + level: 3 paths: - src \ No newline at end of file diff --git a/src/SplashingImages.php b/src/SplashingImages.php index 552014c..c0bac61 100644 --- a/src/SplashingImages.php +++ b/src/SplashingImages.php @@ -98,9 +98,7 @@ function(PluginEvent $event) { /** * Creates and returns the model used to store the plugin’s settings. - * - * @return \craft\base\Model|null - */ + **/ protected function createSettingsModel(): Model { return new Settings(); diff --git a/src/controllers/DownloadController.php b/src/controllers/DownloadController.php index fd11174..ff238db 100644 --- a/src/controllers/DownloadController.php +++ b/src/controllers/DownloadController.php @@ -82,11 +82,13 @@ public function actionIndex(): \yii\web\Response|false $asset = new Asset(); $asset->tempFilePath = $tempPath; $asset->filename = $tmpImage; + /** @phpstan-ignore-next-line */ if ($photo->description) { $asset->alt = $photo->description; } $asset->newFolderId = $folder->id; $asset->volumeId = $volume->id; + /** @phpstan-ignore-next-line */ $asset->title = 'Photo by ' . $photo->photographer()->name; $asset->avoidFilenameConflicts = true; $asset->setScenario(Asset::SCENARIO_CREATE); diff --git a/src/migrations/Install.php b/src/migrations/Install.php deleted file mode 100644 index 786c5f2..0000000 --- a/src/migrations/Install.php +++ /dev/null @@ -1,102 +0,0 @@ -driver = Craft::$app->getConfig()->getDb()->driver; - $this->removeTables(); - - return true; - } - - // Protected Methods - // ========================================================================= - - /** - * Creates the tables needed for the Records used by the plugin - * - * @return bool - */ - - - /** - * Populates the DB with the default data. - * - * @return void - */ - protected function insertDefaultData() - { - } - - /** - * Removes the tables needed for the Records used by the plugin - * - * @return void - */ - protected function removeTables() - { - $this->dropTableIfExists(UserRecord::tableName()); - } -} diff --git a/src/services/UnsplashService.php b/src/services/UnsplashService.php index acc7b8c..1622070 100644 --- a/src/services/UnsplashService.php +++ b/src/services/UnsplashService.php @@ -37,6 +37,7 @@ public function __construct(array $config = []) 'applicationId' => 'f2f0833b9b95a11260cdbb20622e4990579254f787705ebe298cfdad4415198e', 'utmSource' => 'Craft 3 Unsplash', ]); + parent::__construct($config); } public function getPhoto($id): Photo