SimpleSerializedObject::getData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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