Passed
Push — feature/52 ( 2416fc )
by Max
03:02
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
 * @todo #44:20min Classes Let and The do not have proper type hints in
11
 *  constructor and methods. Workarounds with `@var` tags must be removed
12
 *  after that. 
13
 */
14
class The extends SurveyEnvelope
15
{
16
17
    /**
18
     * Ctor.
19
     *
20
     * @param mixed $subject
21
     * @param Closure $context
22
     */
23
    public function __construct(mixed $subject, Closure $context)
24
    {
25
        parent::__construct(
26
            $subject,
27
            $context,
28
            function (mixed $subject, Closure $context): mixed
29
            {
30
                $context($subject);
31
                return $subject;
32
            }
33
        );
34
    }
35
}
36