-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom Psalm stub to get tap helper generics
- Loading branch information
1 parent
b79b7a3
commit 9c38f07
Showing
2 changed files
with
28 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/** | ||
* @template T | ||
* @param T $value | ||
* @param callable(?T): mixed $callback | ||
* @return T | ||
*/ | ||
function tap($value, $callback = null) {} | ||
|
||
class HigherOrderTapProxy | ||
{ | ||
/** | ||
* @template T | ||
* @param T $target | ||
*/ | ||
public function __construct($target) {} | ||
|
||
/** | ||
* @template T | ||
* @param T $target | ||
* @param string $method | ||
* @param array $parameters | ||
* @return T | ||
*/ | ||
public function __call($method, $parameters) {} | ||
} |
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