UpdateComposer   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 4
eloc 7
c 2
b 1
f 0
dl 0
loc 28
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setJsonData() 0 3 1
A __construct() 0 5 2
A getJsonData() 0 3 1
1
<?php
2
3
abstract class UpdateComposer extends Object
4
{
5
    protected $composerJsonObj = null;
6
7
    public function __construct($composerJsonObj)
8
    {
9
        $this->composerJsonObj = $composerJsonObj;
10
        if (! $this->composerJsonObj->getJsonData()) {
11
            user_error('No Json data!');
12
        }
13
    }
14
15
    abstract public function run();
16
17
    /**
18
     * @return array
19
     */
20
    protected function getJsonData()
21
    {
22
        return $this->composerJsonObj->getJsonData();
23
    }
24
25
    /**
26
     * @param array $array [description]
27
     */
28
    protected function setJsonData(array $array)
29
    {
30
        $this->composerJsonObj->setJsonData($array);
31
    }
32
}
33