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

ContextInterceptor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A match() 0 4 1
A resolve() 0 4 1
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