Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Craft 4 #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
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
### Feature
- Support Craft 4

## 1.0.1 - 2019-06-28
### Fixed
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# geojsonmap plugin for Craft CMS 3.x
# geojsonmap plugin for Craft CMS 3.x / 4.x

A craft cms 3 field plugin to draw Leaflet Maps.
A craft cms 3 / 4 field plugin to draw Leaflet Maps.

![Screenshot](resources/img/screenshot.png)

## Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later.
For Craft 3 please use version `^1.0`
For Craft 4 please use version `^2.0`

## Installation

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vardump/geojsonmap",
"description": "A craft cms 3 field plugin to draw Leaflet Maps.",
"type": "craft-plugin",
"version": "1.0.1",
"version": "2.0.0",
"keywords": [
"craft",
"cms",
Expand All @@ -24,7 +24,7 @@
}
],
"require": {
"craftcms/cms": "^3.0.0-RC1"
"craftcms/cms": "^4.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Geojsonmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Geojsonmap extends Plugin
*
* @var string
*/
public $schemaVersion = '1.0.0';
public string $schemaVersion = '1.0.0';

// Public Methods
// =========================================================================
Expand Down
10 changes: 5 additions & 5 deletions src/fields/GeojsonmapField.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static function displayName(): string
/**
* @inheritdoc
*/
public function rules()
public function rules(): array
{
$rules = parent::rules();

Expand Down Expand Up @@ -111,23 +111,23 @@ 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;
}

/**
* @inheritdoc
*/
public function serializeValue($value, ElementInterface $element = null)
public function serializeValue(mixed $value, ?\craft\base\ElementInterface $element = null): mixed
{
return parent::serializeValue($value, $element);
}

/**
* @inheritdoc
*/
public function getSettingsHtml()
public function getSettingsHtml(): ?string
{
// Render the settings template
return Craft::$app->getView()->renderTemplate(
Expand All @@ -141,7 +141,7 @@ public function getSettingsHtml()
/**
* @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
$view = Craft::$app->getView();
Expand Down