aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/lib/Check/FileName.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-09-11 13:14:06 +0200
committerGitHub <noreply@github.com>2019-09-11 13:14:06 +0200
commit2187f856ce4eadeee88bd8b9ff47719df52ea025 (patch)
tree9df95fb0db015c0f597237c105ee7c5838396a97 /apps/workflowengine/lib/Check/FileName.php
parent0cc780ec0a94e6ea2103ee667b111cc38fe81f12 (diff)
parent228cb240bcfe18410a2ce53a35531cdba98b014d (diff)
downloadnextcloud-server-2187f856ce4eadeee88bd8b9ff47719df52ea025.tar.gz
nextcloud-server-2187f856ce4eadeee88bd8b9ff47719df52ea025.zip
Merge pull request #16682 from nextcloud/enh/12790/workflow-backend
workflow overhaul
Diffstat (limited to 'apps/workflowengine/lib/Check/FileName.php')
-rw-r--r--apps/workflowengine/lib/Check/FileName.php29
1 files changed, 12 insertions, 17 deletions
diff --git a/apps/workflowengine/lib/Check/FileName.php b/apps/workflowengine/lib/Check/FileName.php
index c6afbf7afad..62ee601980b 100644
--- a/apps/workflowengine/lib/Check/FileName.php
+++ b/apps/workflowengine/lib/Check/FileName.php
@@ -22,21 +22,17 @@ declare(strict_types=1);
namespace OCA\WorkflowEngine\Check;
-use OCP\Files\Storage\IStorage;
+use OCA\WorkflowEngine\Entity\File;
use OCP\IL10N;
use OCP\IRequest;
+use OCP\WorkflowEngine\IFileCheck;
-class FileName extends AbstractStringCheck {
+class FileName extends AbstractStringCheck implements IFileCheck {
+ use TFileCheck;
/** @var IRequest */
protected $request;
- /** @var IStorage */
- protected $storage;
-
- /** @var string */
- protected $path;
-
/**
* @param IL10N $l
* @param IRequest $request
@@ -47,15 +43,6 @@ class FileName extends AbstractStringCheck {
}
/**
- * @param IStorage $storage
- * @param string $path
- */
- public function setFileInfo(IStorage $storage, $path) {
- $this->storage = $storage;
- $this->path = $path;
- }
-
- /**
* @return string
*/
protected function getActualValue(): string {
@@ -75,4 +62,12 @@ class FileName extends AbstractStringCheck {
}
return parent::executeStringCheck($operator, $checkValue, $actualValue);
}
+
+ public function supportedEntities(): array {
+ return [ File::class ];
+ }
+
+ public function isAvailableForScope(int $scope): bool {
+ return true;
+ }
}