Completed
Push — master ( b2e200...1332b8 )
by Oscar
04:48
created

Resolver   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 16
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 6 4
1
<?php
2
3
namespace Psr7Middlewares\Transformers;
4
5
/**
6
 * Generic resolver to get transformers.
7
 */
8
abstract class Resolver implements ResolverInterface
9
{
10
    /**
11
     * Resolves the id and returns a transformer or null.
12
     * 
13
     * @param string $id
14
     * 
15
     * @return callable|null
16
     */
17
    public function resolve($id)
18
    {
19
        if (!empty($id) && $id !== __METHOD__ && method_exists($this, $id)) {
20
            return [$this, $id];
21
        }
22
    }
23
}
24