SerializerAwareTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setSerializer() 0 4 1
A getSerializer() 0 4 1
1
<?php
2
3
4
namespace Retrinko\Serializer\Traits;
5
6
use Retrinko\Serializer\Interfaces\SerializerInterface;
7
8
/**
9
 * Class SerializerAwareTrait
10
 * @package Retrinko\Serializer
11
 */
12
trait SerializerAwareTrait
13
{
14
    /**
15
     * @var SerializerInterface
16
     */
17
    protected $serializer;
18
19
    /**
20
     * Sets a serializer.
21
     *
22
     * @param SerializerInterface $serializer
23
     */
24
    public function setSerializer(SerializerInterface $serializer)
25
    {
26
        $this->serializer = $serializer;
27
    }
28
29
    /**
30
     * @return SerializerInterface
31
     */
32
    public function getSerializer()
33
    {
34
        return $this->serializer;
35
    }
36
}