Passed
Push — feature/94 ( c3385c )
by Max
11:34
created

ContextVeil::__call()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 2
dl 0
loc 3
rs 10
1
<?php
2
3
namespace MaxGoryunov\SavingIterator\Src;
4
5
/**
6
 * Veil which applies context to origin if the condition is met.
7
 */
8
final class ContextVeil implements Indifferent
9
{
10
11
    /**
12
     * Ctor.
13
     * 
14
     * @param mixed $origin original element.
15
     */
16
    public function __construct(
17
        /**
18
         * Original element.
19
         *
20
         * @var mixed
21
         */
22
        private mixed $origin
23
    ) {
24
    }
25
26
    /**
27
     * {@inheritDoc}
28
     */
29
    public function __call(string $name, array $arguments): mixed
30
    {
31
        return $this->origin->$name(...$arguments);
32
    }
33
}
34