Passed
Push — master ( 2e2cc3...b09f9f )
by Sebastian
04:26
created

Mailcode_Exception   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
c 2
b 0
f 0
dl 0
loc 23
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A hasCollection() 0 3 1
A getCollection() 0 3 1
A setCollection() 0 3 1
1
<?php
2
/**
3
 * File containing the {@see Mailcode_Exception} class.
4
 *
5
 * @package Mailcode
6
 * @subpackage Core
7
 * @see Mailcode_Exception
8
 */
9
10
namespace Mailcode;
11
12
/**
13
 * Mailcode exception.
14
 *
15
 * @package Mailcode
16
 * @subpackage Core
17
 * @author Sebastian Mordziol <[email protected]>
18
 */
19
class Mailcode_Exception extends \AppUtils\BaseException
20
{
21
    /**
22
     * @var Mailcode_Collection|null
23
     */
24
    private $collection = null;
25
26
    public function setCollection(Mailcode_Collection $collection) : void
27
    {
28
        $this->collection = $collection;
29
    }
30
31
    /**
32
     * @return Mailcode_Collection|null
33
     */
34
    public function getCollection(): Mailcode_Collection
35
    {
36
        return $this->collection;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->collection could return the type null which is incompatible with the type-hinted return Mailcode\Mailcode_Collection. Consider adding an additional type-check to rule them out.
Loading history...
37
    }
38
39
    public function hasCollection() : bool
40
    {
41
        return isset($this->collection);
42
    }
43
}
44