GetTrackingByRef::setPasskey()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
dl 10
loc 10
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 5
nc 2
nop 1
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 getTrackingByRef Type
16
 *
17
 * @date 2018/04/06
18
 * @codeVersion 0.0.1
19
 */
20 View Code Duplication
class GetTrackingByRef 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 refNo
24
     * Meta informations extracted from the WSDL
25
     * - maxOccurs: 1
26
     * - minOccurs: 0
27
     *
28
     * @var string
29
     */
30
    public $refNo;
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 getTrackingByRef
43
     *
44
     * @uses GetTrackingByRef::setRefNo()
45
     * @uses GetTrackingByRef::setPasskey()
46
     *
47
     * @param string $refNo
48
     * @param string $passkey
49
     */
50
    public function __construct($refNo = null, $passkey = null)
51
    {
52
        $this
53
            ->setRefNo($refNo)
54
            ->setPasskey($passkey);
55
    }
56
57
    /**
58
     * Get refNo value
59
     *
60
     * @return string|null
61
     */
62
    public function getRefNo()
63
    {
64
        return $this->refNo;
65
    }
66
67
    /**
68
     * Set refNo value
69
     *
70
     * @param string $refNo
71
     *
72
     * @return \Alhoqbani\SmsaWebService\Soap\Type\GetTrackingByRef
73
     */
74
    public function setRefNo($refNo = null)
75
    {
76
        // validation for constraint: string
77
        if (!is_null($refNo) && !is_string($refNo)) {
78
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($refNo)), __LINE__);
79
        }
80
        $this->refNo = $refNo;
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\GetTrackingByRef
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\GetTrackingByRef
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