Passed
Push — feature/52 ( 26e983...2a77ff )
by Max
03:01 queued 02:33
created

The::value()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace MaxGoryunov\SavingIterator\Fakes;
4
5
use Closure;
6
7
/**
8
 * Class for applying contexts to elements without changing them.
9
 * 
10
 * @template T subject type
11
 * @extends SurveyEnvelope<T, T>
12
 */
13
class The extends SurveyEnvelope
14
{
15
16
    /**
17
     * Ctor.
18
     *
19
     * @phpstan-param T                 $subject repeating element
20
     * @phpstan-param Closure(T): mixed $context context for element
21
     * @param mixed $subject
22
     * @param Closure $context
23
     */
24
    public function __construct(mixed $subject, Closure $context)
25
    {
26
        parent::__construct(
27
            $subject,
28
            $context,
29
            function (mixed $subject, Closure $context): mixed
30
            {
31
                $context($subject);
32
                return $subject;
33
            }
34
        );
35
    }
36
}
37