HalSerializer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getTransformer() 0 4 1
A serialize() 0 4 1
1
<?php
2
/**
3
 * Author: Nil Portugués Calderó <[email protected]>
4
 * Date: 12/17/15
5
 * Time: 1:52 PM.
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 NilPortugues\Api\Hal;
12
13
use NilPortugues\Serializer\DeepCopySerializer;
14
15
/**
16
 * Class HalJsonSerializer.
17
 */
18
class HalSerializer  extends DeepCopySerializer
0 ignored issues
show
Coding Style introduced by
Expected 1 space after class name; 2 found
Loading history...
Coding Style introduced by
Expected 1 space before extends keyword; 2 found
Loading history...
19
{
20
    /**
21
     * @var HalTransformer
22
     */
23
    protected $serializationStrategy;
24
25
    /**
26
     * @param HalTransformer $strategy
27
     */
28
    public function __construct(HalTransformer $strategy)
29
    {
30
        parent::__construct($strategy);
31
    }
32
33
    /**
34
     * @return HalTransformer
35
     */
36
    public function getTransformer()
37
    {
38
        return $this->serializationStrategy;
39
    }
40
41
    /**
42
     * @param mixed $value
43
     *
44
     * @return string
45
     */
46
    public function serialize($value)
47
    {
48
        return parent::serialize($value);
49
    }
50
}
51