diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-09-09 14:27:10 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-09-09 22:56:05 +0200 |
commit | fd2de58503a3c915cf178385db3e9962845719c4 (patch) | |
tree | 3c6b189475dd5b9e44806a9cba6ca9b59b09aade | |
parent | 687edb4bc80cc5cda3663997d23a319d7ea15925 (diff) | |
download | nextcloud-server-fd2de58503a3c915cf178385db3e9962845719c4.tar.gz nextcloud-server-fd2de58503a3c915cf178385db3e9962845719c4.zip |
seperate setFileInfo from ICheck
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r-- | apps/workflowengine/lib/Check/AbstractStringCheck.php | 8 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/FileMimeType.php | 3 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/FileName.php | 3 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/FileSize.php | 7 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/FileSystemTags.php | 3 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/RequestRemoteAddress.php | 8 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/RequestTime.php | 8 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/UserGroupMembership.php | 8 | ||||
-rw-r--r-- | lib/composer/composer/autoload_classmap.php | 1 | ||||
-rw-r--r-- | lib/composer/composer/autoload_static.php | 1 | ||||
-rw-r--r-- | lib/public/WorkflowEngine/ICheck.php | 11 | ||||
-rw-r--r-- | lib/public/WorkflowEngine/IFileCheck.php | 44 |
12 files changed, 53 insertions, 52 deletions
diff --git a/apps/workflowengine/lib/Check/AbstractStringCheck.php b/apps/workflowengine/lib/Check/AbstractStringCheck.php index 7a385729e09..edd983ba699 100644 --- a/apps/workflowengine/lib/Check/AbstractStringCheck.php +++ b/apps/workflowengine/lib/Check/AbstractStringCheck.php @@ -43,14 +43,6 @@ abstract class AbstractStringCheck implements ICheck { } /** - * @param IStorage $storage - * @param string $path - */ - public function setFileInfo(IStorage $storage, $path) { - // Nothing changes here with a different path - } - - /** * @return string */ abstract protected function getActualValue(); diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php index 6d51992fdd0..52fc54fc859 100644 --- a/apps/workflowengine/lib/Check/FileMimeType.php +++ b/apps/workflowengine/lib/Check/FileMimeType.php @@ -27,8 +27,9 @@ use OCP\Files\IMimeTypeDetector; use OCP\Files\Storage\IStorage; use OCP\IL10N; use OCP\IRequest; +use OCP\WorkflowEngine\IFileCheck; -class FileMimeType extends AbstractStringCheck { +class FileMimeType extends AbstractStringCheck implements IFileCheck { /** @var array */ protected $mimeType; diff --git a/apps/workflowengine/lib/Check/FileName.php b/apps/workflowengine/lib/Check/FileName.php index d9b63ebfed1..76c48b7955e 100644 --- a/apps/workflowengine/lib/Check/FileName.php +++ b/apps/workflowengine/lib/Check/FileName.php @@ -26,8 +26,9 @@ use OCA\WorkflowEngine\Entity\File; use OCP\Files\Storage\IStorage; use OCP\IL10N; use OCP\IRequest; +use OCP\WorkflowEngine\IFileCheck; -class FileName extends AbstractStringCheck { +class FileName extends AbstractStringCheck implements IFileCheck { /** @var IRequest */ protected $request; diff --git a/apps/workflowengine/lib/Check/FileSize.php b/apps/workflowengine/lib/Check/FileSize.php index 06a45bdcd41..ac1896c6057 100644 --- a/apps/workflowengine/lib/Check/FileSize.php +++ b/apps/workflowengine/lib/Check/FileSize.php @@ -50,13 +50,6 @@ class FileSize implements ICheck { } /** - * @param IStorage $storage - * @param string $path - */ - public function setFileInfo(IStorage $storage, $path) { - } - - /** * @param string $operator * @param string $value * @return bool diff --git a/apps/workflowengine/lib/Check/FileSystemTags.php b/apps/workflowengine/lib/Check/FileSystemTags.php index 12285c9b33e..41b657d53b0 100644 --- a/apps/workflowengine/lib/Check/FileSystemTags.php +++ b/apps/workflowengine/lib/Check/FileSystemTags.php @@ -31,8 +31,9 @@ use OCP\SystemTag\ISystemTagManager; use OCP\SystemTag\ISystemTagObjectMapper; use OCP\SystemTag\TagNotFoundException; use OCP\WorkflowEngine\ICheck; +use OCP\WorkflowEngine\IFileCheck; -class FileSystemTags implements ICheck { +class FileSystemTags implements ICheck, IFileCheck { /** @var array */ protected $fileIds; diff --git a/apps/workflowengine/lib/Check/RequestRemoteAddress.php b/apps/workflowengine/lib/Check/RequestRemoteAddress.php index c386168f597..28e3bd4be09 100644 --- a/apps/workflowengine/lib/Check/RequestRemoteAddress.php +++ b/apps/workflowengine/lib/Check/RequestRemoteAddress.php @@ -45,14 +45,6 @@ class RequestRemoteAddress implements ICheck { } /** - * @param IStorage $storage - * @param string $path - */ - public function setFileInfo(IStorage $storage, $path) { - // A different path doesn't change time, so nothing to do here. - } - - /** * @param string $operator * @param string $value * @return bool diff --git a/apps/workflowengine/lib/Check/RequestTime.php b/apps/workflowengine/lib/Check/RequestTime.php index 79696583cdb..523d251789a 100644 --- a/apps/workflowengine/lib/Check/RequestTime.php +++ b/apps/workflowengine/lib/Check/RequestTime.php @@ -50,14 +50,6 @@ class RequestTime implements ICheck { } /** - * @param IStorage $storage - * @param string $path - */ - public function setFileInfo(IStorage $storage, $path) { - // A different path doesn't change time, so nothing to do here. - } - - /** * @param string $operator * @param string $value * @return bool diff --git a/apps/workflowengine/lib/Check/UserGroupMembership.php b/apps/workflowengine/lib/Check/UserGroupMembership.php index 4b06dbd2da4..e9518733f9b 100644 --- a/apps/workflowengine/lib/Check/UserGroupMembership.php +++ b/apps/workflowengine/lib/Check/UserGroupMembership.php @@ -59,14 +59,6 @@ class UserGroupMembership implements ICheck { } /** - * @param IStorage $storage - * @param string $path - */ - public function setFileInfo(IStorage $storage, $path) { - // A different path doesn't change group memberships, so nothing to do here. - } - - /** * @param string $operator * @param string $value * @return bool diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 6673cbe70a7..4078193b18a 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -444,6 +444,7 @@ return array( 'OCP\\WorkflowEngine\\IEntity' => $baseDir . '/lib/public/WorkflowEngine/IEntity.php', 'OCP\\WorkflowEngine\\IEntityAware' => $baseDir . '/lib/public/WorkflowEngine/IEntityAware.php', 'OCP\\WorkflowEngine\\IEntityEvent' => $baseDir . '/lib/public/WorkflowEngine/IEntityEvent.php', + 'OCP\\WorkflowEngine\\IFileCheck' => $baseDir . '/lib/public/WorkflowEngine/IFileCheck.php', 'OCP\\WorkflowEngine\\IManager' => $baseDir . '/lib/public/WorkflowEngine/IManager.php', 'OCP\\WorkflowEngine\\IOperation' => $baseDir . '/lib/public/WorkflowEngine/IOperation.php', 'OCP\\WorkflowEngine\\ISpecificOperation' => $baseDir . '/lib/public/WorkflowEngine/ISpecificOperation.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index d4b74d5c231..4cf093dcaa8 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -478,6 +478,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OCP\\WorkflowEngine\\IEntity' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IEntity.php', 'OCP\\WorkflowEngine\\IEntityAware' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IEntityAware.php', 'OCP\\WorkflowEngine\\IEntityEvent' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IEntityEvent.php', + 'OCP\\WorkflowEngine\\IFileCheck' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IFileCheck.php', 'OCP\\WorkflowEngine\\IManager' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IManager.php', 'OCP\\WorkflowEngine\\IOperation' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/IOperation.php', 'OCP\\WorkflowEngine\\ISpecificOperation' => __DIR__ . '/../../..' . '/lib/public/WorkflowEngine/ISpecificOperation.php', diff --git a/lib/public/WorkflowEngine/ICheck.php b/lib/public/WorkflowEngine/ICheck.php index 92ec6f83893..f5586e83d51 100644 --- a/lib/public/WorkflowEngine/ICheck.php +++ b/lib/public/WorkflowEngine/ICheck.php @@ -2,6 +2,7 @@ /** * @copyright Copyright (c) 2016 Morris Jobke <hey@morrisjobke.de> * + * @author Arthur Schiwon <blizzz@arthur-schiwon.de> * @author Morris Jobke <hey@morrisjobke.de> * * @license GNU AGPL version 3 or any later version @@ -23,9 +24,6 @@ namespace OCP\WorkflowEngine; - -use OCP\Files\Storage\IStorage; - /** * Interface ICheck * @@ -34,13 +32,6 @@ use OCP\Files\Storage\IStorage; */ interface ICheck { /** - * @param IStorage $storage - * @param string $path - * @since 9.1 - */ - public function setFileInfo(IStorage $storage, $path); - - /** * @param string $operator * @param string $value * @return bool diff --git a/lib/public/WorkflowEngine/IFileCheck.php b/lib/public/WorkflowEngine/IFileCheck.php new file mode 100644 index 00000000000..ce15d6c352c --- /dev/null +++ b/lib/public/WorkflowEngine/IFileCheck.php @@ -0,0 +1,44 @@ +<?php +declare(strict_types=1); +/** + * @copyright Copyright (c) 2019 Arthur Schiwon <blizzz@arthur-schiwon.de> + * + * @author Arthur Schiwon <blizzz@arthur-schiwon.de> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OCP\WorkflowEngine; + + +use OCP\Files\Storage\IStorage; + +/** + * Interface IFileCheck + * + * @package OCP\WorkflowEngine + * @since 18.0.0 + */ +interface IFileCheck { + /** + * @param IStorage $storage + * @param string $path + * @since 18.0.0 + */ + public function setFileInfo(IStorage $storage, $path); + +} |