Completed
Push — master ( 4b4c57...035a27 )
by Rafael
03:03
created

CallableNamingStrategy   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A transformName() 0 4 1
1
<?php
2
3
/**
4
 * LICENSE: This file is subject to the terms and conditions defined in
5
 * file 'LICENSE', which is part of this source code package.
6
 *
7
 * @copyright 2016 Copyright(c) - All rights reserved.
8
 */
9
10
namespace Rafrsr\LibArray2Object\Naming;
11
12
class CallableNamingStrategy implements NamingStrategyInterface
13
{
14
    /**
15
     * @var callable
16
     */
17
    protected $parserCallback;
18
19
    /**
20
     * CallableParser constructor.
21
     *
22
     * @param callable $parserCallback
23
     */
24
    public function __construct(callable $parserCallback)
25
    {
26
        $this->parserCallback = $parserCallback;
27
    }
28
29
    /**
30
     * @inheritDoc
31
     */
32
    public function transformName($name)
33
    {
34
        return call_user_func($this->parserCallback, $name);
35
    }
36
}