-
Notifications
You must be signed in to change notification settings - Fork 0
/
The.php
36 lines (32 loc) · 797 Bytes
/
The.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
namespace MaxGoryunov\SavingIterator\Fakes;
use Closure;
/**
* Class for applying contexts to elements without changing them.
*
* @template T subject type
* @extends SurveyEnvelope<T, T>
*/
class The extends SurveyEnvelope
{
/**
* Ctor.
*
* @phpstan-param T $subject repeating element
* @phpstan-param Closure(T): mixed $context context for element
* @param mixed $subject
* @param Closure $context
*/
public function __construct(mixed $subject, Closure $context)
{
parent::__construct(
$subject,
$context,
function (mixed $subject, Closure $context): mixed
{
$context($subject);
return $subject;
}
);
}
}