SimpleSerializedObject   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getContentType() 0 4 1
A getData() 0 4 1
A getType() 0 4 1
1
<?php
2
3
/*
4
 * To change this license header, choose License Headers in Project Properties.
5
 * To change this template file, choose Tools | Templates
6
 * and open the template in the editor.
7
 */
8
9
namespace Governor\Framework\Serializer;
10
11
/**
12
 * Description of SimpleSerializedObject
13
 *
14
 * @author david
15
 */
16
class SimpleSerializedObject implements SerializedObjectInterface
17
{
18
19
    private $data;
20
    private $serializedType;    
21
22 56
    public function __construct($data, SerializedTypeInterface $serializedType)
23
    {
24 56
        $this->data = $data;       
25 56
        $this->serializedType = $serializedType;
26 56
    }
27
28 38
    public function getContentType()
29
    {
30 38
        return $this->serializedType->getName();
31
    }
32
33 56
    public function getData()
34
    {
35 56
        return $this->data;
36
    }
37
38 45
    public function getType()
39
    {
40 45
        return $this->serializedType;
41
    }
42
43
}
44