From 0c00f682d6f3a067c7c0d7070e02eda221df4ad4 Mon Sep 17 00:00:00 2001 From: Woody Gilk Date: Wed, 15 Nov 2023 15:45:21 -0600 Subject: [PATCH] Make all Data implementations readonly --- CHANGELOG.md | 6 ++++++ src/DataProxy.php | 2 +- src/JsonData.php | 2 +- tests/ProxiesData.php | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed7fe33..166c8bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.0] 2023-11-15 + +### Changed + +- All implementations of Data are now `readonly` + ## [1.2.0] 2023-11-11 ### Added diff --git a/src/DataProxy.php b/src/DataProxy.php index dbe3c2e..dbc70a0 100644 --- a/src/DataProxy.php +++ b/src/DataProxy.php @@ -4,7 +4,7 @@ namespace Focus\Data; -abstract class DataProxy implements Data +abstract readonly class DataProxy implements Data { abstract protected function source(): Data; diff --git a/src/JsonData.php b/src/JsonData.php index 48a897d..d7542a2 100644 --- a/src/JsonData.php +++ b/src/JsonData.php @@ -13,7 +13,7 @@ use const JSON_THROW_ON_ERROR; -final class JsonData extends DataProxy +final readonly class JsonData extends DataProxy { use DataProxyBehavior; diff --git a/tests/ProxiesData.php b/tests/ProxiesData.php index 026d586..5c32d26 100644 --- a/tests/ProxiesData.php +++ b/tests/ProxiesData.php @@ -7,7 +7,7 @@ use Focus\Data\Behavior\DataProxyBehavior; use Focus\Data\DataProxy; -final class ProxiesData extends DataProxy +final readonly class ProxiesData extends DataProxy { use DataProxyBehavior; }