Completed
Push — master ( ba6641...734696 )
by Hamoud
27:01 queued 12:22
created

GetPDFBr   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 160
Duplicated Lines 100 %

Coupling/Cohesion

Components 3
Dependencies 1

Importance

Changes 0
Metric Value
wmc 15
lcom 3
cbo 1
dl 160
loc 160
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 7 7 1
A getAwbNo() 4 4 1
A setAwbNo() 10 10 3
A getPassKey() 4 4 1
A setPassKey() 10 10 3
A getForwrdr() 4 4 1
A setForwrdr() 10 10 3
A __set_state() 4 4 1
A __toString() 4 4 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
/*
4
 * This file is part of Smsa WebService package.
5
 * (c) Hamoud Alhoqbani <[email protected]>
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Alhoqbani\SmsaWebService\Soap\Type;
11
12
use \WsdlToPhp\PackageBase\AbstractStructBase;
13
14
/**
15
 * This class stands for getPDFBr Type
16
 *
17
 * @date 2018/04/06
18
 * @codeVersion 0.0.1
19
 */
20 View Code Duplication
class GetPDFBr extends AbstractStructBase
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...
21
{
22
    /**
23
     * The awbNo
24
     * Meta informations extracted from the WSDL
25
     * - maxOccurs: 1
26
     * - minOccurs: 0
27
     *
28
     * @var string
29
     */
30
    public $awbNo;
31
    /**
32
     * The passKey
33
     * Meta informations extracted from the WSDL
34
     * - maxOccurs: 1
35
     * - minOccurs: 0
36
     *
37
     * @var string
38
     */
39
    public $passKey;
40
    /**
41
     * The forwrdr
42
     * Meta informations extracted from the WSDL
43
     * - maxOccurs: 1
44
     * - minOccurs: 0
45
     *
46
     * @var string
47
     */
48
    public $forwrdr;
49
50
    /**
51
     * Constructor method for getPDFBr
52
     *
53
     * @uses GetPDFBr::setAwbNo()
54
     * @uses GetPDFBr::setPassKey()
55
     * @uses GetPDFBr::setForwrdr()
56
     *
57
     * @param string $awbNo
58
     * @param string $passKey
59
     * @param string $forwrdr
60
     */
61
    public function __construct($awbNo = null, $passKey = null, $forwrdr = null)
62
    {
63
        $this
64
            ->setAwbNo($awbNo)
65
            ->setPassKey($passKey)
66
            ->setForwrdr($forwrdr);
67
    }
68
69
    /**
70
     * Get awbNo value
71
     *
72
     * @return string|null
73
     */
74
    public function getAwbNo()
75
    {
76
        return $this->awbNo;
77
    }
78
79
    /**
80
     * Set awbNo value
81
     *
82
     * @param string $awbNo
83
     *
84
     * @return \Alhoqbani\SmsaWebService\Soap\Type\GetPDFBr
85
     */
86
    public function setAwbNo($awbNo = null)
87
    {
88
        // validation for constraint: string
89
        if (!is_null($awbNo) && !is_string($awbNo)) {
90
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($awbNo)), __LINE__);
91
        }
92
        $this->awbNo = $awbNo;
93
94
        return $this;
95
    }
96
97
    /**
98
     * Get passKey value
99
     *
100
     * @return string|null
101
     */
102
    public function getPassKey()
103
    {
104
        return $this->passKey;
105
    }
106
107
    /**
108
     * Set passKey value
109
     *
110
     * @param string $passKey
111
     *
112
     * @return \Alhoqbani\SmsaWebService\Soap\Type\GetPDFBr
113
     */
114
    public function setPassKey($passKey = null)
115
    {
116
        // validation for constraint: string
117
        if (!is_null($passKey) && !is_string($passKey)) {
118
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($passKey)), __LINE__);
119
        }
120
        $this->passKey = $passKey;
121
122
        return $this;
123
    }
124
125
    /**
126
     * Get forwrdr value
127
     *
128
     * @return string|null
129
     */
130
    public function getForwrdr()
131
    {
132
        return $this->forwrdr;
133
    }
134
135
    /**
136
     * Set forwrdr value
137
     *
138
     * @param string $forwrdr
139
     *
140
     * @return \Alhoqbani\SmsaWebService\Soap\Type\GetPDFBr
141
     */
142
    public function setForwrdr($forwrdr = null)
143
    {
144
        // validation for constraint: string
145
        if (!is_null($forwrdr) && !is_string($forwrdr)) {
146
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($forwrdr)), __LINE__);
147
        }
148
        $this->forwrdr = $forwrdr;
149
150
        return $this;
151
    }
152
153
    /**
154
     * Method called when an object has been exported with var_export() functions
155
     * It allows to return an object instantiated with the values
156
     *
157
     * @see AbstractStructBase::__set_state()
158
     *
159
     * @uses AbstractStructBase::__set_state()
160
     *
161
     * @param array $array the exported values
162
     *
163
     * @return \Alhoqbani\SmsaWebService\Soap\Type\GetPDFBr
164
     */
165
    public static function __set_state(array $array)
166
    {
167
        return parent::__set_state($array);
168
    }
169
170
    /**
171
     * Method returning the class name
172
     *
173
     * @return string __CLASS__
174
     */
175
    public function __toString()
176
    {
177
        return __CLASS__;
178
    }
179
}
180