Completed
Pull Request — master (#18)
by Jesus
02:07
created

SetConfigXMLParameters   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 73
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 4 4 1
A getMeetingId() 4 4 1
A setMeetingId() 6 6 1
A getRawXml() 4 4 1
A setRawXml() 6 6 1
A getHTTPQuery() 9 9 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
4
 *
5
 * Copyright (c) 2016 BigBlueButton Inc. and by respective authors (see below).
6
 *
7
 * This program is free software; you can redistribute it and/or modify it under the
8
 * terms of the GNU Lesser General Public License as published by the Free Software
9
 * Foundation; either version 3.0 of the License, or (at your option) any later
10
 * version.
11
 *
12
 * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
13
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14
 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public License along
17
 * with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
18
 */
19
namespace BigBlueButton\Parameters;
20
21
/**
22
 * Class SetConfigXMLParameters
23
 * @package BigBlueButton\Parameters
24
 */
25 View Code Duplication
class SetConfigXMLParameters extends BaseParameters
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
26
{
27
    /**
28
     * @var string
29
     */
30
    private $meetingId;
31
32
    /**
33
     * @var \SimpleXMLElement
34
     */
35
    private $rawXml;
36
37
    /**
38
     * SetConfigXMLParameters constructor.
39
     *
40
     * @param $meetingId
41
     */
42
    public function __construct($meetingId)
43
    {
44
        $this->meetingId = $meetingId;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getMeetingId()
51
    {
52
        return $this->meetingId;
53
    }
54
55
    /**
56
     * @param  string                 $meetingId
57
     * @return SetConfigXMLParameters
58
     */
59
    public function setMeetingId($meetingId)
60
    {
61
        $this->meetingId = $meetingId;
62
63
        return $this;
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getRawXml()
70
    {
71
        return $this->rawXml;
72
    }
73
74
    /**
75
     * @param  \SimpleXMLElement      $rawXml
76
     * @return SetConfigXMLParameters
77
     */
78
    public function setRawXml($rawXml)
79
    {
80
        $this->rawXml = $rawXml;
81
82
        return $this;
83
    }
84
85
    /**
86
     * @return string
87
     */
88
    public function getHTTPQuery()
89
    {
90
        return $this->buildHTTPQuery(
91
            [
92
                'configXML' => urlencode($this->rawXml->asXML()),
93
                'meetingID' => $this->meetingId,
94
            ]
95
        );
96
    }
97
}
98