-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRule.php
34 lines (29 loc) · 841 Bytes
/
Rule.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
<?php
namespace Majordome\Rule;
use Majordome\Resource\Resource;
/**
* The rule implementing a logic to decide if a resource should be considered as invalid (so as a candidate of cleanup)
*/
interface Rule
{
/**
* Decides whether the resource should be a candidate of cleanup based on the underlying rule
*
* @param Resource $resource
*
* @return bool true if the resource is valid and is not for cleanup, false otherwise
*/
public function isValid(Resource $resource): bool;
/**
* Return the name of the rule, generally the name of the Rule class
*
* @return string
*/
public static function getName(): string;
/**
* Return a small description of what the Rule does
*
* @return string
*/
public static function getDescription(): string;
}