IEntityCheck.php 819 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\WorkflowEngine;
  8. /**
  9. * Interface IFileCheck
  10. *
  11. * @since 18.0.0
  12. */
  13. interface IEntityCheck {
  14. /**
  15. * Equips the check with a subject fitting the Entity. For instance, an
  16. * entity of File will receive an instance of OCP\Files\Node, or a comment
  17. * entity might get an IComment.
  18. *
  19. * The implementing check must be aware of the incoming type.
  20. *
  21. * If an unsupported subject is passed the implementation MAY throw an
  22. * \UnexpectedValueException.
  23. *
  24. * @param IEntity $entity
  25. * @param mixed $subject
  26. * @throws \UnexpectedValueException
  27. * @since 18.0.0
  28. */
  29. public function setEntitySubject(IEntity $entity, $subject): void;
  30. }