diff --git a/.gitignore b/.gitignore index a17970c..e6ccc4f 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ !.vscode/extensions.json config.codekit3 prepros-6.config +composer.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index 0315f77..c2447a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## 2.0.0 - 2022-05-04 +### Added +- Craft v4 support + ## 1.0.0 - 2019-08-12 ### Added - Initial release diff --git a/composer.json b/composer.json index cafd6ec..c8bf3b1 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "nthmedia/photo-exif", "description": "The plugin reads EXIF data from photos", "type": "craft-plugin", - "version": "0.0.1", + "version": "2.0", "keywords": [ "craft", "cms", @@ -10,10 +10,6 @@ "craft-plugin", "photo exif" ], - "support": { - "docs": "???", - "issues": "???" - }, "license": "MIT", "authors": [ { @@ -22,7 +18,8 @@ } ], "require": { - "craftcms/cms": "^3.0.0-RC1" + "php": "^8.0", + "craftcms/cms": "^4.0" }, "autoload": { "psr-4": { @@ -39,5 +36,18 @@ "metadata": "nthmedia\\photoexif\\services\\Metadata" }, "class": "nthmedia\\photoexif\\PhotoExif" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "require-dev": { + "craftcms/rector": "dev-main", + "craftcms/ecs": "dev-main", + "phpstan/phpstan": "^1.6" + }, + "config": { + "allow-plugins": { + "yiisoft/yii2-composer": true, + "craftcms/plugin-installer": true + } } } diff --git a/src/PhotoExif.php b/src/PhotoExif.php index 2bf2cf4..13389bf 100644 --- a/src/PhotoExif.php +++ b/src/PhotoExif.php @@ -51,7 +51,7 @@ class PhotoExif extends Plugin /** * @var string */ - public $schemaVersion = '1.0.0'; + public string $schemaVersion = '1.0.0'; // Public Methods // ========================================================================= diff --git a/src/fields/Coordinates.php b/src/fields/Coordinates.php index 7b64c46..ddcf17c 100644 --- a/src/fields/Coordinates.php +++ b/src/fields/Coordinates.php @@ -71,7 +71,7 @@ public function getElementValidationRules(): array /** * @inheritdoc */ - public function getContentColumnType(): string + public function getContentColumnType(): array|string { return Schema::TYPE_STRING; } @@ -79,7 +79,7 @@ public function getContentColumnType(): string /** * @inheritdoc */ - public function normalizeValue($value, ElementInterface $element = null) + public function normalizeValue(mixed $value, ?\craft\base\ElementInterface $element = null): mixed { return $value; } @@ -87,7 +87,7 @@ public function normalizeValue($value, ElementInterface $element = null) /** * @inheritdoc */ - public function serializeValue($value, ElementInterface $element = null) + public function serializeValue(mixed $value, ?\craft\base\ElementInterface $element = null): mixed { // Replace spaces in the string $value = str_replace(' ', '', $value); @@ -97,7 +97,7 @@ public function serializeValue($value, ElementInterface $element = null) /** * @inheritdoc */ - public function getInputHtml($value, ElementInterface $element = null): string + public function getInputHtml(mixed $value, ?\craft\base\ElementInterface $element = null): string { // Get our id and namespace $id = Craft::$app->getView()->formatInputId($this->handle); @@ -131,7 +131,7 @@ public function getInputHtml($value, ElementInterface $element = null): string /** * @inheritdoc */ - public function getTableAttributeHtml($value, ElementInterface $element): string + public function getTableAttributeHtml(mixed $value, ElementInterface $element): string { if ($value) { $value = preg_replace_callback( diff --git a/src/twigextensions/PhotoExifTwigExtension.php b/src/twigextensions/PhotoExifTwigExtension.php index 6c1589b..dfa0db5 100644 --- a/src/twigextensions/PhotoExifTwigExtension.php +++ b/src/twigextensions/PhotoExifTwigExtension.php @@ -19,7 +19,7 @@ * @package PhotoExif * @since 1.0.0 */ -class PhotoExifTwigExtension extends \Twig_Extension +class PhotoExifTwigExtension extends \Twig\Extension\AbstractExtension { // Public Methods // ========================================================================= @@ -38,7 +38,7 @@ public function getName() public function getFilters() { return [ - new \Twig_SimpleFilter('someFilter', [$this, 'someInternalFunction']), + new \Twig\TwigFilter('someFilter', [$this, 'someInternalFunction']), ]; } @@ -48,7 +48,7 @@ public function getFilters() public function getFunctions() { return [ - new \Twig_SimpleFunction('someFunction', [$this, 'someInternalFunction']), + new \Twig\TwigFunction('someFunction', [$this, 'someInternalFunction']), ]; }