-
Notifications
You must be signed in to change notification settings - Fork 19
/
GenericRule.php
55 lines (45 loc) · 1003 Bytes
/
GenericRule.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php declare(strict_types=1);
namespace uuf6429\Rune\Rule;
use uuf6429\Rune\Action\ActionInterface;
class GenericRule implements RuleInterface
{
protected string $id;
protected string $name;
protected string $condition;
protected ActionInterface $action;
public function __construct(string $id, string $name, string $condition, ActionInterface $action)
{
$this->id = $id;
$this->name = $name;
$this->condition = $condition;
$this->action = $action;
}
/**
* {@inheritdoc}
*/
public function getId(): string
{
return $this->id;
}
/**
* {@inheritdoc}
*/
public function getName(): string
{
return $this->name;
}
/**
* {@inheritdoc}
*/
public function getCondition(): string
{
return $this->condition;
}
/**
* {@inheritdoc}
*/
public function getAction(): ActionInterface
{
return $this->action;
}
}