GetPDFSino   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 120
Duplicated Lines 100 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

Changes 0
Metric Value
wmc 11
lcom 2
cbo 1
dl 120
loc 120
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 6 6 1
A getAwbNo() 4 4 1
A setAwbNo() 10 10 3
A getPassKey() 4 4 1
A setPassKey() 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 getPDFSino Type
16
 *
17
 * @date 2018/04/06
18
 * @codeVersion 0.0.1
19
 */
20 View Code Duplication
class GetPDFSino 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
    /**
42
     * Constructor method for getPDFSino
43
     *
44
     * @uses GetPDFSino::setAwbNo()
45
     * @uses GetPDFSino::setPassKey()
46
     *
47
     * @param string $awbNo
48
     * @param string $passKey
49
     */
50
    public function __construct($awbNo = null, $passKey = null)
51
    {
52
        $this
53
            ->setAwbNo($awbNo)
54
            ->setPassKey($passKey);
55
    }
56
57
    /**
58
     * Get awbNo value
59
     *
60
     * @return string|null
61
     */
62
    public function getAwbNo()
63
    {
64
        return $this->awbNo;
65
    }
66
67
    /**
68
     * Set awbNo value
69
     *
70
     * @param string $awbNo
71
     *
72
     * @return \Alhoqbani\SmsaWebService\Soap\Type\GetPDFSino
73
     */
74
    public function setAwbNo($awbNo = null)
75
    {
76
        // validation for constraint: string
77
        if (!is_null($awbNo) && !is_string($awbNo)) {
78
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($awbNo)), __LINE__);
79
        }
80
        $this->awbNo = $awbNo;
81
82
        return $this;
83
    }
84
85
    /**
86
     * Get passKey value
87
     *
88
     * @return string|null
89
     */
90
    public function getPassKey()
91
    {
92
        return $this->passKey;
93
    }
94
95
    /**
96
     * Set passKey value
97
     *
98
     * @param string $passKey
99
     *
100
     * @return \Alhoqbani\SmsaWebService\Soap\Type\GetPDFSino
101
     */
102
    public function setPassKey($passKey = null)
103
    {
104
        // validation for constraint: string
105
        if (!is_null($passKey) && !is_string($passKey)) {
106
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($passKey)), __LINE__);
107
        }
108
        $this->passKey = $passKey;
109
110
        return $this;
111
    }
112
113
    /**
114
     * Method called when an object has been exported with var_export() functions
115
     * It allows to return an object instantiated with the values
116
     *
117
     * @see AbstractStructBase::__set_state()
118
     *
119
     * @uses AbstractStructBase::__set_state()
120
     *
121
     * @param array $array the exported values
122
     *
123
     * @return \Alhoqbani\SmsaWebService\Soap\Type\GetPDFSino
124
     */
125
    public static function __set_state(array $array)
126
    {
127
        return parent::__set_state($array);
128
    }
129
130
    /**
131
     * Method returning the class name
132
     *
133
     * @return string __CLASS__
134
     */
135
    public function __toString()
136
    {
137
        return __CLASS__;
138
    }
139
}
140