Skip to content

Commit

Permalink
Craft 4 Compatibility (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: Karl Robinson <karl.robinson@bluestormdesign.co.uk>
  • Loading branch information
2 people authored and sjelfull committed Oct 3, 2022
1 parent d358910 commit 56a05c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "superbig/craft3-templateselect",
"description": "A fieldtype that allows you to select a template from a dropdown.",
"type": "craft-plugin",
"version": "2.0.2",
"version": "4.0.0",
"keywords": [
"craft",
"cms",
Expand All @@ -22,7 +22,7 @@
}
],
"require": {
"craftcms/cms": "^3.0.0-beta.23"
"craftcms/cms": "^4.0.0"
},
"repositories": [
{
Expand All @@ -38,7 +38,7 @@
"extra": {
"name": "Template Select",
"handle": "template-select",
"schemaVersion": "2.0.0",
"schemaVersion": "4.0.0",
"hasCpSettings": false,
"hasCpSection": false,
"changelogUrl": "https://raw.githubusercontent.com/sjelfull/craft3-templateselect/master/CHANGELOG.md",
Expand Down
8 changes: 4 additions & 4 deletions src/fields/TemplateSelectField.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static function displayName (): string
/**
* @inheritdoc
*/
public function rules ()
public function rules (): array
{
$rules = parent::rules();
$rules = array_merge($rules, [
Expand All @@ -71,23 +71,23 @@ public function getContentColumnType (): string
/**
* @inheritdoc
*/
public function normalizeValue ($value, ElementInterface $element = null)
public function normalizeValue ($value, ElementInterface $element = null): mixed
{
return $value;
}

/**
* @inheritdoc
*/
public function serializeValue ($value, ElementInterface $element = null)
public function serializeValue ($value, 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 Down

0 comments on commit 56a05c3

Please sign in to comment.