Skip to content

Commit

Permalink
Prep for Craft 4
Browse files Browse the repository at this point in the history
  • Loading branch information
DynamiteGoesBoom committed May 3, 2022
1 parent 194deaf commit 0995fa6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,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/).

[4.0.0-beta.3] - 2022-05-03
- Updated for Craft 4

## [1.1.0] - 2022-02-14

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![StyleCI](https://styleci.io/repos/119550758/shield)](https://styleci.io/repos/119550758)
[![Total Downloads](https://img.shields.io/packagist/dt/rias/craft-width-fieldtype.svg?style=flat-square)](https://packagist.org/packages/rias/craft-width-fieldtype)

# Width Fieldtype plugin for Craft CMS 3.x
# Width Fieldtype plugin for Craft CMS 4.x

Let users choose from predefined widths

Expand All @@ -17,7 +17,7 @@ This plugin is licensed under a MIT license, which means that it's completely fr

## Requirements

This plugin requires Craft CMS 3.0.0.
This plugin requires Craft CMS 4.0.0-beta.3.

## 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": "hybridinteractive/craft-width-fieldtype",
"description": "Let users choose from predefined widths",
"type": "craft-plugin",
"version": "1.1.0",
"version": "4.0.0-beta.3",
"keywords": [
"craft",
"cms",
Expand All @@ -22,7 +22,7 @@
}
],
"require": {
"craftcms/cms": "^3.7.0"
"craftcms/cms": "^4.0.0-beta.1"
},
"repositories": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/WidthFieldtype.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class WidthFieldtype extends Plugin
// =========================================================================

/* @inheritdoc */
public function init()
public function init(): void
{
parent::init();

Expand Down
7 changes: 4 additions & 3 deletions src/fields/Width.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Craft;
use craft\base\ElementInterface;
use craft\base\Field;
use phpDocumentor\Reflection\Types\This;
use rias\widthfieldtype\assetbundles\widthfieldtype\WidthFieldtypeAsset;
use yii\db\Schema;

Expand Down Expand Up @@ -145,7 +146,7 @@ public function getContentColumnType(): string
*
* @return mixed The prepared field value
*/
public function normalizeValue($value, ElementInterface $element = null)
public function normalizeValue($value, ElementInterface $element = null):? string
{
return $value;
}
Expand All @@ -158,7 +159,7 @@ public function normalizeValue($value, ElementInterface $element = null)
*
* @return string|null
*/
public function getSettingsHtml()
public function getSettingsHtml(): string
{
// Register our asset bundle
Craft::$app->getView()->registerAssetBundle(WidthFieldtypeAsset::class);
Expand Down Expand Up @@ -229,7 +230,7 @@ public function getInputHtml($value, ElementInterface $element = null): string
*
* @return array
*/
private static function getOptions()
private static function getOptions(): array
{
return [
'1/6' => Craft::t('width-fieldtype', '1/6'),
Expand Down

0 comments on commit 0995fa6

Please sign in to comment.