Skip to content

Commit

Permalink
Merge pull request #10 from 21TORR/mockable
Browse files Browse the repository at this point in the history
Make `SimpleNormalizer` non-readonly
  • Loading branch information
apfelbox authored Jun 26, 2024
2 parents 6e68549 + 4f41d19 commit e388018
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.3.1
=====

* (improvement) Make `SimpleNormalizer` non-readonly, to allow it to be mocked.


1.3.0
=====

Expand Down
8 changes: 6 additions & 2 deletions src/Normalizer/SimpleNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@
use Torr\SimpleNormalizer\Exception\UnsupportedTypeException;

/**
* The normalizer to use in your app.
*
* Can't be readonly, as it needs to be mock-able.
*
* @final
*/
readonly class SimpleNormalizer
class SimpleNormalizer
{
/**
* @param ServiceLocator<SimpleObjectNormalizerInterface> $objectNormalizers
*/
public function __construct (
private ServiceLocator $objectNormalizers,
private readonly ServiceLocator $objectNormalizers,
) {}

/**
Expand Down

0 comments on commit e388018

Please sign in to comment.