diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-09-09 17:04:12 +0300 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-09-09 23:56:05 +0300 |
commit | 4cd931fcc6bb7f794fd14ddb75c7867823449e79 (patch) | |
tree | 0d2a6d1083dc865407cbe9cd891c977c0e4c9f06 /lib/public/WorkflowEngine | |
parent | fd2de58503a3c915cf178385db3e9962845719c4 (diff) |
require IChecks to receive entity context
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib/public/WorkflowEngine')
-rw-r--r-- | lib/public/WorkflowEngine/ICheck.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/public/WorkflowEngine/ICheck.php b/lib/public/WorkflowEngine/ICheck.php index f5586e83d51..6e9c2fc765e 100644 --- a/lib/public/WorkflowEngine/ICheck.php +++ b/lib/public/WorkflowEngine/ICheck.php @@ -70,4 +70,24 @@ interface ICheck { * @since 18.0.0 */ public function isAvailableForScope(int $scope): bool; + + /** + * Equips the check with a subject fitting the Entity. For instance, an + * entity of File will receive an instance of OCP\Files\Node, or a comment + * entity might get an IComment. + * + * The implementing check must be aware of the incoming type. + * + * If an unsupported subject is passed the implementation MAY throw an + * \UnexpectedValueException. + * + * When an implementation does not depend on a subject being passed to it, + * for example RequestTime, the implemented method SHOULD just pass, without + * any further operation. + * + * @param IEntity $entity + * @param mixed $subject + * @throws \UnexpectedValueException + */ + public function setEntitySubject(IEntity $entity, $subject): void; } |