GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#99)
by
unknown
11:15 queued 01:14
created

AbstractOperation::getResponseGroup()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/*
3
 * Copyright 2013 Jan Eichhorn <[email protected]>
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 * http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
namespace ApaiIO\Operations;
19
20
/**
21
 * A base implementation of the OperationInterface
22
 *
23
 * @author Jan Eichhorn <[email protected]>
24
 */
25
abstract class AbstractOperation implements OperationInterface
26
{
27
    protected $parameter = array();
28
29
    /**
30
     * Returns an array of responseGroups
31
     *
32 2
     * @return array
33
     */
34 2
    public function getResponseGroup()
35
    {
36 2
        return $this->getSingleOperationParameter('ResponseGroup');
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42 16
    public function setResponseGroup(array $responseGroup)
43
    {
44 16
        $this->parameter['ResponseGroup'] = $responseGroup;
45
46
        return $this;
47
    }
48
49
    /**
50
     * {@inheritdoc}
51
     */
52
    public function getOperationParameter()
53
    {
54
        return $this->parameter;
55 12
    }
56
57 12
    /**
58 1
     * Returns a single operation parameter if set
59
     *
60 1
     * @param string $keyName
61
     * @return mixed|null
62
     */
63 12
    public function getSingleOperationParameter($keyName) {
64 11
        return isset($this->parameter[$keyName]) ? $this->parameter[$keyName] : null;
65
    }
66 11
67
    /**
68
     * Magic setter and getter functions
69 1
     *
70
     * @param string $methodName Methodname
71
     * @param string $parameter  Parameters
72
     *
73
     * @return \ApaiIO\Operations\AbstractOperation
74
     */
75
    public function __call($methodName, $parameter)
76
    {
77
        if (substr($methodName, 0, 3) == 'set') {
78
            $this->parameter[substr($methodName, 3)] = array_shift($parameter);
79
80
            return $this;
81
        }
82
83
        if (substr($methodName, 0, 3) == 'get') {
84
            $keyName = substr($methodName, 3);
85
86
            return isset($this->parameter[$keyName]) ? $this->parameter[$keyName] : null;
87
        }
88
89
        throw new \BadFunctionCallException(sprintf('The function "%s" does not exist!', $methodName));
90
    }
91
}
92