-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding phpdoc generics for the interfaces
- Loading branch information
1 parent
439f0b3
commit 2ac9fe0
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,11 +14,26 @@ | |
* | ||
* Also add #[AsMapper(from: Foo:class, to: Bar:class)] to each mapper class. | ||
* | ||
* @template TFrom of object | ||
* @template TTo of object | ||
* | ||
* @author Ryan Weaver <[email protected]> | ||
*/ | ||
interface MapperInterface | ||
{ | ||
/** | ||
* @param TFrom $from | ||
* @param class-string<TTo> $toClass | ||
* | ||
* @return TTo | ||
*/ | ||
public function load(object $from, string $toClass, array $context): object; | ||
|
||
/** | ||
* @param TFrom $from | ||
* @param TTo $to | ||
* | ||
* @return TTo | ||
*/ | ||
public function populate(object $from, object $to, array $context): object; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters