Completed
Push — master ( 965d61...bf91ef )
by Nicolaas
03:12
created

UpdateComposer::setJsonData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
abstract class UpdateComposer extends Object
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
    protected $composerJsonObj = null;
6
7
    public function __construct($composerJsonObj)
8
    {
9
        $this->composerJsonObj = $composerJsonObj;
10
        if (! isset($this->composerJsonObj->jsonData)) {
11
            user_error('No Json data!');
12
        }
13
    }
14
15
    abstract public function run();
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
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
}
34