ZohoCRMException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getZohoCode() 0 4 1
1
<?php
2
3
namespace Wabel\Zoho\CRM\Exception;
4
5
/**
6
 * Zoho CRM Exception.
7
 *
8
 * Standard Exception thrown when using this package
9
 *
10
 * @version 1.0.0
11
 */
12
class ZohoCRMException extends \Exception
13
{
14
    /**
15
     * The error code cannot be stored in the "$code" property because it is converted to integer, and we have some decimals/strings.
16
     *
17
     * @var string
18
     */
19
    private $zohoCode;
20
21
    public function __construct($message, $code = 0, Exception $exception = null)
22
    {
23
        $this->zohoCode = $code;
0 ignored issues
show
Documentation Bug introduced by
The property $zohoCode was declared of type string, but $code is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
24
        parent::__construct($message, $code, $exception);
25
    }
26
27
    public function getZohoCode()
28
    {
29
        return $this->zohoCode;
30
    }
31
}
32