GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

TransformerFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 22
ccs 0
cts 9
cp 0
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTransformer() 0 11 2
1
<?php
2
/**
3
 * This file is part of the Gerrie package.
4
 *
5
 * (c) Andreas Grunwald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Gerrie\Transformer;
12
13
class TransformerFactory
14
{
15
16
    /**
17
     * Creates a new (data) transformer
18
     *
19
     * @param string $entity Entity / name of data to transform (singular)
20
     * @param bool $debug
21
     * @return TransformerInterface
22
     */
23
    public function getTransformer($entity, $debug = false)
24
    {
25
        $className = 'Gerrie\\Transformer\\' . $entity . 'Transformer';
26
        $transformer = new $className();
27
28
        if ($debug === true) {
29
            $transformer = new DebugTransformDecorator($transformer);
30
        }
31
32
        return $transformer;
33
    }
34
}