Skip to content

Commit

Permalink
refactor: Remove $context from MapperInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Jan 13, 2024
1 parent b9a65f4 commit 75b97b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ public function __construct(
/**
* @template T of object
* @param class-string<T>|T $target
* @param array<string,mixed> $context
* @return T
*/
public function map(mixed $source, object|string $target, array $context = []): object
public function map(mixed $source, object|string $target): object
{
if (is_string($target)) {
$targetClass = $target;
Expand All @@ -53,7 +52,7 @@ public function map(mixed $source, object|string $target, array $context = []):
source: $source,
target: $target,
targetTypes: [$targetType],
context: $context
context: []
);

if ($target === null) {
Expand Down
3 changes: 1 addition & 2 deletions src/MapperInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ interface MapperInterface
/**
* @template T of object
* @param class-string<T>|T $target
* @param array<string,mixed> $context
* @return T
*/
public function map(mixed $source, object|string $target, array $context = []): mixed;
public function map(mixed $source, object|string $target): mixed;
}

0 comments on commit 75b97b8

Please sign in to comment.