Passed
Push — master ( 462f8c...e41b1e )
by Nicolaas
04:20
created

UpdateComposer   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 30
rs 10
c 0
b 0
f 0

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