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

Mailcode_Exception::setCollection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
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