Skip to content

Commit

Permalink
Merge pull request #2 from focusphp/feature/readonly
Browse files Browse the repository at this point in the history
Make all Data implementations readonly
  • Loading branch information
shadowhand authored Nov 15, 2023
2 parents af05f5b + 0c00f68 commit 8d76f12
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/DataProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Focus\Data;

abstract class DataProxy implements Data
abstract readonly class DataProxy implements Data
{
abstract protected function source(): Data;

Expand Down
2 changes: 1 addition & 1 deletion src/JsonData.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use const JSON_THROW_ON_ERROR;

final class JsonData extends DataProxy
final readonly class JsonData extends DataProxy
{
use DataProxyBehavior;

Expand Down
2 changes: 1 addition & 1 deletion tests/ProxiesData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 8d76f12

Please sign in to comment.