Completed
Push — master ( 060b04...657701 )
by
unknown
04:35
created

EntityJSONSerializer::serializeFields()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6
Metric Value
dl 0
loc 7
ccs 0
cts 6
cp 0
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
crap 6
1
<?php
2
/**
3
 * ownCloud - News
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the COPYING file.
7
 *
8
 * @author Alessandro Cosentino <[email protected]>
9
 * @author Bernhard Posselt <[email protected]>
10
 * @copyright Alessandro Cosentino 2012
11
 * @copyright Bernhard Posselt 2012, 2014
12
 */
13
14
namespace OCA\News\Db;
15
16
trait EntityJSONSerializer {
17
18
19
    public function serializeFields($properties) {
20
        $result = [];
21
        foreach($properties as $property) {
22
            $result[$property] = $this->$property;
23
        }
24
        return $result;
25
    }
26
27
28
}