AbstractModel   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 3
c 3
b 0
f 0
lcom 0
cbo 1
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 11 3
1
<?php
2
3
/**
4
 * Abstract model
5
 */
6
7
namespace HDNET\Tagger\Domain\Model;
8
9
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
10
11
/**
12
 * Class AbstractModel
13
 */
14
class AbstractModel extends AbstractEntity
15
{
16
17
    /**
18
     * To array
19
     *
20
     * @return array
21
     */
22
    public function toArray()
23
    {
24
        $vars = [];
25
        $objectVars = array_keys(get_object_vars($this));
26
        foreach ($objectVars as $var) {
27
            if (method_exists($this, 'get' . ucfirst($var))) {
28
                $vars[$var] = call_user_func([$this, 'get' . ucfirst($var)]);
29
            }
30
        }
31
        return $vars;
32
    }
33
}
34