Completed
Push — master ( b2a65d...63a169 )
by Kirill
02:18
created

ContextInterceptor::resolve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\SDL\Frontend\Interceptor;
11
12
use Railt\SDL\Frontend\Context\ContextInterface;
13
14
/**
15
 * Class ContextInterceptor
16
 */
17
class ContextInterceptor implements InterceptorInterface
18
{
19
    /**
20
     * @param mixed $value
21
     * @return bool
22
     */
23
    public function match($value): bool
24
    {
25
        return $value instanceof ContextInterface;
26
    }
27
28
    /**
29
     * @param ContextInterface $context
30
     * @param mixed $value
31
     * @return array
32
     */
33
    public function resolve(ContextInterface $context, $value): array
34
    {
35
        return [$value, $value];
36
    }
37
}
38