Conditions | 4 |
Paths | 6 |
Total Lines | 16 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
18 | 49 | public function serialize() { |
|
19 | 49 | $data = new stdClass(); |
|
20 | 49 | $data->action = $this->action; |
|
21 | 49 | if ($this->object instanceof ElggData) { |
|
22 | 49 | if ($this->object instanceof ElggEntity) { |
|
23 | 28 | $data->object_id = $this->object->guid; |
|
24 | } else { |
||
25 | 21 | $data->object_id = $this->object->id; |
|
26 | } |
||
27 | 49 | $data->object_type = $this->object->getType(); |
|
28 | 49 | $data->object_subtype = $this->object->getSubtype(); |
|
29 | } |
||
30 | 49 | if ($this->actor) { |
|
31 | 49 | $data->actor_guid = $this->actor->guid; |
|
32 | } |
||
33 | 49 | return serialize($data); |
|
34 | } |
||
72 |