Exception   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 9
c 1
b 0
f 0
dl 0
loc 40
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getMessage() 0 3 1
A __construct() 0 4 1
A setMessage() 0 8 3
1
<?php
2
3
namespace ColissimoPickupPoint\StructType;
4
5
use \WsdlToPhp\PackageBase\AbstractStructBase;
6
7
/**
8
 * This class stands for Exception StructType
9
 * Meta information extracted from the WSDL
10
 * - type: tns:Exception
11
 * @subpackage Structs
12
 * @author WsdlToPhp <[email protected]>
13
 */
14
class Exception extends AbstractStructBase
15
{
16
    /**
17
     * The message
18
     * Meta information extracted from the WSDL
19
     * - minOccurs: 0
20
     * @var string
21
     */
22
    public $message;
23
    /**
24
     * Constructor method for Exception
25
     * @uses Exception::setMessage()
26
     * @param string $message
27
     */
28
    public function __construct($message = null)
29
    {
30
        $this
31
            ->setMessage($message);
32
    }
33
    /**
34
     * Get message value
35
     * @return string|null
36
     */
37
    public function getMessage()
38
    {
39
        return $this->message;
40
    }
41
    /**
42
     * Set message value
43
     * @param string $message
44
     * @return \ColissimoPickupPoint\StructType\Exception
45
     */
46
    public function setMessage($message = null)
47
    {
48
        // validation for constraint: string
49
        if (!is_null($message) && !is_string($message)) {
0 ignored issues
show
introduced by
The condition is_string($message) is always true.
Loading history...
50
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($message, true), gettype($message)), __LINE__);
51
        }
52
        $this->message = $message;
53
        return $this;
54
    }
55
}
56