Skip to content

Commit

Permalink
Merge pull request #7 from mattgrayisok/craft-4
Browse files Browse the repository at this point in the history
Craft 4
  • Loading branch information
mattgrayisok authored May 12, 2022
2 parents a6dae18 + 285c366 commit 69844f6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,33 @@
# Recently Viewed Changelog

All notable changes to this project will be documented in this file.
## 2.0.0 - 2022-05-12

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
### Added

- Craft 4 compat

## 1.0.3 - 2019-01-10

### Added

- Postgres support
- Max limit of 99 elements in history

## 1.0.2 - 2019-01-08

### Updated

- Fixed null state issue when combined with ordering

## 1.0.1 - 2019-01-07

### Updated

- Made filtering work nicely with `limit()`s
- Set elements as most recently viewed even if they are already in list of elements

## 1.0.0 - 2019-01-07

### Added

- Initial release
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mattgrayisok/craft-recently-viewed",
"description": "Craft CMS plugin to find recently viewed elements of any type.",
"type": "craft-plugin",
"version": "1.0.3",
"version": "2.0.0",
"keywords": [
"craft",
"cms",
Expand All @@ -23,7 +23,8 @@
}
],
"require": {
"craftcms/cms": "^3.0.0-RC1"
"craftcms/cms": "^4.0.0-beta.1",
"php": "^8.0.0"
},
"autoload": {
"psr-4": {
Expand Down
10 changes: 5 additions & 5 deletions src/RecentlyViewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use mattgrayisok\recentlyviewed\behaviors\RecentlyViewedBehavior;
use mattgrayisok\recentlyviewed\models\Settings;


use craft\base\Model;
use Craft;
use craft\base\Plugin;
use craft\services\Plugins;
Expand Down Expand Up @@ -49,9 +49,9 @@ class RecentlyViewed extends Plugin
/**
* @var string
*/
public $schemaVersion = '1.0.2';
public string $schemaVersion = '1.0.2';

public $hasCpSettings = true;
public bool $hasCpSettings = true;

/**
* @inheritdoc
Expand Down Expand Up @@ -103,12 +103,12 @@ public function registerComponentsAndServices()
});
}

protected function createSettingsModel()
protected function createSettingsModel() : ?Model
{
return new Settings();
}

protected function settingsHtml()
protected function settingsHtml() : ?string
{
return \Craft::$app->getView()->renderTemplate('recently-viewed/settings', [
'settings' => $this->getSettings()
Expand Down
2 changes: 1 addition & 1 deletion src/models/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Settings extends Model
{
public $autoTrack = true;

public function rules()
public function rules(): array
{
return [
[['autoTrack'], 'boolean'],
Expand Down

0 comments on commit 69844f6

Please sign in to comment.