Completed
Push — develop ( 61ee3a...f2bd12 )
by Seth
08:02
created

Filter::isEnabled()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace smtech\CanvasICSSync\SyncIntoCanvas\Filter;
4
5
use smtech\CanvasICSSync\SyncIntoCanvas\Event;
6
7
abstract class Filter
8
{
9
    /**
10
     * Whether or not this filter is enabled
11
     * @var boolean
12
     */
13
    protected $enabled = false;
14
15
    /**
16
     * Set whether or not this filter is enabled
17
     *
18
     * @param boolean $enabled
19
     */
20
    public function setEnabled($enabled)
21
    {
22
        $this->enabled = (boolean) $enabled;
23
    }
24
25
    /**
26
     * Is this filter enabled?
27
     *
28
     * @return boolean
29
     */
30
    public function isEnabled()
31
    {
32
        return $this->enabled;
33
    }
34
35
    /**
36
     * Does this event pass this filter?
37
     *
38
     * @param  Event  $event
39
     * @return boolean `true` if the event passes the filter and should be
40
     *     included, `false` otherwise
41
     */
42
    abstract public function filter(Event $event);
0 ignored issues
show
Coding Style Best Practice introduced by
Please use __construct() instead of a PHP4-style constructor that is named after the class.
Loading history...
43
}
44