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

GetAllRetails   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 80
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 1
dl 80
loc 80
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 5 5 1
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 getAllRetails Type
16
 *
17
 * @date 2018/04/06
18
 * @codeVersion 0.0.1
19
 */
20 View Code Duplication
class GetAllRetails 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 passkey
24
     * Meta informations extracted from the WSDL
25
     * - maxOccurs: 1
26
     * - minOccurs: 0
27
     *
28
     * @var string
29
     */
30
    public $passkey;
31
32
    /**
33
     * Constructor method for getAllRetails
34
     *
35
     * @uses GetAllRetails::setPasskey()
36
     *
37
     * @param string $passkey
38
     */
39
    public function __construct($passkey = null)
40
    {
41
        $this
42
            ->setPasskey($passkey);
43
    }
44
45
    /**
46
     * Get passkey value
47
     *
48
     * @return string|null
49
     */
50
    public function getPasskey()
51
    {
52
        return $this->passkey;
53
    }
54
55
    /**
56
     * Set passkey value
57
     *
58
     * @param string $passkey
59
     *
60
     * @return \Alhoqbani\SmsaWebService\Soap\Type\GetAllRetails
61
     */
62
    public function setPasskey($passkey = null)
63
    {
64
        // validation for constraint: string
65
        if (!is_null($passkey) && !is_string($passkey)) {
66
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($passkey)), __LINE__);
67
        }
68
        $this->passkey = $passkey;
69
70
        return $this;
71
    }
72
73
    /**
74
     * Method called when an object has been exported with var_export() functions
75
     * It allows to return an object instantiated with the values
76
     *
77
     * @see AbstractStructBase::__set_state()
78
     *
79
     * @uses AbstractStructBase::__set_state()
80
     *
81
     * @param array $array the exported values
82
     *
83
     * @return \Alhoqbani\SmsaWebService\Soap\Type\GetAllRetails
84
     */
85
    public static function __set_state(array $array)
86
    {
87
        return parent::__set_state($array);
88
    }
89
90
    /**
91
     * Method returning the class name
92
     *
93
     * @return string __CLASS__
94
     */
95
    public function __toString()
96
    {
97
        return __CLASS__;
98
    }
99
}
100