Completed
Branch FET-3467-waitlists (388345)
by
unknown
138:08 queued 126:13
created

ConvertNotices   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 58
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getNotices() 0 4 1
A getThrowExceptions() 0 4 1
process() 0 1 ?
1
<?php
2
3
namespace EventEspresso\core\services\commands\notices;
4
5
defined('EVENT_ESPRESSO_VERSION') || exit;
6
7
8
9
/**
10
 * Class ConvertNotices
11
 * Converts notifications in a CommandHandlerNotices into another format such as EE_Error notifications
12
 *
13
 * @package       Event Espresso
14
 * @author        Brent Christensen
15
 * @since         $VID:$
16
 */
17
abstract class ConvertNotices
18
{
19
20
    /**
21
     * @var CommandHandlerNotices $notices
22
     */
23
    private $notices;
24
25
    /**
26
     * if set to true, then errors will be thrown as exceptions
27
     *
28
     * @var boolean $throw_exceptions
29
     */
30
    private $throw_exceptions;
31
32
33
34
    /**
35
     * ConvertNotices constructor.
36
     *
37
     * @param CommandHandlerNotices $notices
38
     * @param bool                  $throw_exceptions
39
     */
40
    public function __construct(CommandHandlerNotices $notices, $throw_exceptions = false)
41
    {
42
        $this->notices = $notices;
43
        $this->throw_exceptions = $throw_exceptions;
44
    }
45
46
47
48
    /**
49
     * @return CommandHandlerNotices
50
     */
51
    public function getNotices()
52
    {
53
        return $this->notices;
54
    }
55
56
57
58
    /**
59
     * @return bool
60
     */
61
    public function getThrowExceptions()
62
    {
63
        return $this->throw_exceptions;
64
    }
65
66
67
68
    /**
69
     * Converts CommandHandlerNotice objects into other format
70
     */
71
    abstract public function process();
72
73
74
}
75