aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/workflowengine/lib')
-rw-r--r--apps/workflowengine/lib/AppInfo/Application.php1
-rw-r--r--apps/workflowengine/lib/BackgroundJobs/Rotate.php5
-rw-r--r--apps/workflowengine/lib/Check/AbstractStringCheck.php5
-rw-r--r--apps/workflowengine/lib/Check/FileMimeType.php23
-rw-r--r--apps/workflowengine/lib/Check/FileSize.php1
-rw-r--r--apps/workflowengine/lib/Check/FileSystemTags.php1
-rw-r--r--apps/workflowengine/lib/Check/RequestRemoteAddress.php1
-rw-r--r--apps/workflowengine/lib/Check/RequestTime.php1
-rw-r--r--apps/workflowengine/lib/Check/RequestURL.php9
-rw-r--r--apps/workflowengine/lib/Check/RequestUserAgent.php1
-rw-r--r--apps/workflowengine/lib/Check/UserGroupMembership.php1
-rw-r--r--apps/workflowengine/lib/Controller/RequestTimeController.php1
-rw-r--r--apps/workflowengine/lib/Listener/LoadAdditionalSettingsScriptsListener.php9
-rw-r--r--apps/workflowengine/lib/Manager.php1
-rw-r--r--apps/workflowengine/lib/Settings/Section.php1
15 files changed, 35 insertions, 26 deletions
diff --git a/apps/workflowengine/lib/AppInfo/Application.php b/apps/workflowengine/lib/AppInfo/Application.php
index 09aa4ed3896..93b0ca49260 100644
--- a/apps/workflowengine/lib/AppInfo/Application.php
+++ b/apps/workflowengine/lib/AppInfo/Application.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/apps/workflowengine/lib/BackgroundJobs/Rotate.php b/apps/workflowengine/lib/BackgroundJobs/Rotate.php
index fd3c76c524e..d7984b1226a 100644
--- a/apps/workflowengine/lib/BackgroundJobs/Rotate.php
+++ b/apps/workflowengine/lib/BackgroundJobs/Rotate.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -8,7 +9,9 @@ namespace OCA\WorkflowEngine\BackgroundJobs;
use OCA\WorkflowEngine\AppInfo\Application;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;
+use OCP\IConfig;
use OCP\Log\RotationTrait;
+use OCP\Server;
class Rotate extends TimedJob {
use RotationTrait;
@@ -19,7 +22,7 @@ class Rotate extends TimedJob {
}
protected function run($argument) {
- $config = \OC::$server->getConfig();
+ $config = Server::get(IConfig::class);
$default = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/flow.log';
$this->filePath = trim((string)$config->getAppValue(Application::APP_ID, 'logfile', $default));
diff --git a/apps/workflowengine/lib/Check/AbstractStringCheck.php b/apps/workflowengine/lib/Check/AbstractStringCheck.php
index 4e56cda377e..d92e9901365 100644
--- a/apps/workflowengine/lib/Check/AbstractStringCheck.php
+++ b/apps/workflowengine/lib/Check/AbstractStringCheck.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -68,8 +69,8 @@ abstract class AbstractStringCheck implements ICheck {
throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1);
}
- if (in_array($operator, ['matches', '!matches']) &&
- @preg_match($value, null) === false) {
+ if (in_array($operator, ['matches', '!matches'])
+ && @preg_match($value, null) === false) {
throw new \UnexpectedValueException($this->l->t('The given regular expression is invalid'), 2);
}
}
diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php
index 3062994c6ba..a8dfa64528e 100644
--- a/apps/workflowengine/lib/Check/FileMimeType.php
+++ b/apps/workflowengine/lib/Check/FileMimeType.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -97,9 +98,9 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck {
return $this->cacheAndReturnMimeType($this->storage->getId(), $this->path, $cacheEntry->getMimeType());
}
- if ($this->storage->file_exists($this->path) &&
- $this->storage->filesize($this->path) &&
- $this->storage->instanceOfStorage(Local::class)
+ if ($this->storage->file_exists($this->path)
+ && $this->storage->filesize($this->path)
+ && $this->storage->instanceOfStorage(Local::class)
) {
$path = $this->storage->getLocalFile($this->path);
$mimeType = $this->mimeTypeDetector->detectContent($path);
@@ -125,12 +126,12 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck {
*/
protected function isWebDAVRequest() {
return substr($this->request->getScriptName(), 0 - strlen('/remote.php')) === '/remote.php' && (
- $this->request->getPathInfo() === '/webdav' ||
- str_starts_with($this->request->getPathInfo() ?? '', '/webdav/') ||
- $this->request->getPathInfo() === '/dav/files' ||
- str_starts_with($this->request->getPathInfo() ?? '', '/dav/files/') ||
- $this->request->getPathInfo() === '/dav/uploads' ||
- str_starts_with($this->request->getPathInfo() ?? '', '/dav/uploads/')
+ $this->request->getPathInfo() === '/webdav'
+ || str_starts_with($this->request->getPathInfo() ?? '', '/webdav/')
+ || $this->request->getPathInfo() === '/dav/files'
+ || str_starts_with($this->request->getPathInfo() ?? '', '/dav/files/')
+ || $this->request->getPathInfo() === '/dav/uploads'
+ || str_starts_with($this->request->getPathInfo() ?? '', '/dav/uploads/')
);
}
@@ -139,8 +140,8 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck {
*/
protected function isPublicWebDAVRequest() {
return substr($this->request->getScriptName(), 0 - strlen('/public.php')) === '/public.php' && (
- $this->request->getPathInfo() === '/webdav' ||
- str_starts_with($this->request->getPathInfo() ?? '', '/webdav/')
+ $this->request->getPathInfo() === '/webdav'
+ || str_starts_with($this->request->getPathInfo() ?? '', '/webdav/')
);
}
diff --git a/apps/workflowengine/lib/Check/FileSize.php b/apps/workflowengine/lib/Check/FileSize.php
index c1ee1d85ae9..5ee03ccc9cf 100644
--- a/apps/workflowengine/lib/Check/FileSize.php
+++ b/apps/workflowengine/lib/Check/FileSize.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/apps/workflowengine/lib/Check/FileSystemTags.php b/apps/workflowengine/lib/Check/FileSystemTags.php
index bd1609e9aff..811571f558a 100644
--- a/apps/workflowengine/lib/Check/FileSystemTags.php
+++ b/apps/workflowengine/lib/Check/FileSystemTags.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/apps/workflowengine/lib/Check/RequestRemoteAddress.php b/apps/workflowengine/lib/Check/RequestRemoteAddress.php
index 6fb5a3026d6..b6f8fef5aed 100644
--- a/apps/workflowengine/lib/Check/RequestRemoteAddress.php
+++ b/apps/workflowengine/lib/Check/RequestRemoteAddress.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/apps/workflowengine/lib/Check/RequestTime.php b/apps/workflowengine/lib/Check/RequestTime.php
index b6b4e9176c2..a49986652b8 100644
--- a/apps/workflowengine/lib/Check/RequestTime.php
+++ b/apps/workflowengine/lib/Check/RequestTime.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/apps/workflowengine/lib/Check/RequestURL.php b/apps/workflowengine/lib/Check/RequestURL.php
index 62d6dbc5c38..fb2ac7e8fd5 100644
--- a/apps/workflowengine/lib/Check/RequestURL.php
+++ b/apps/workflowengine/lib/Check/RequestURL.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -70,10 +71,10 @@ class RequestURL extends AbstractStringCheck {
return false;
}
return substr($this->request->getScriptName(), 0 - strlen('/remote.php')) === '/remote.php' && (
- $this->request->getPathInfo() === '/webdav' ||
- str_starts_with($this->request->getPathInfo() ?? '', '/webdav/') ||
- $this->request->getPathInfo() === '/dav/files' ||
- str_starts_with($this->request->getPathInfo() ?? '', '/dav/files/')
+ $this->request->getPathInfo() === '/webdav'
+ || str_starts_with($this->request->getPathInfo() ?? '', '/webdav/')
+ || $this->request->getPathInfo() === '/dav/files'
+ || str_starts_with($this->request->getPathInfo() ?? '', '/dav/files/')
);
}
}
diff --git a/apps/workflowengine/lib/Check/RequestUserAgent.php b/apps/workflowengine/lib/Check/RequestUserAgent.php
index 47db1bb0c68..572ef567074 100644
--- a/apps/workflowengine/lib/Check/RequestUserAgent.php
+++ b/apps/workflowengine/lib/Check/RequestUserAgent.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/apps/workflowengine/lib/Check/UserGroupMembership.php b/apps/workflowengine/lib/Check/UserGroupMembership.php
index 215557a75a9..690f9974a49 100644
--- a/apps/workflowengine/lib/Check/UserGroupMembership.php
+++ b/apps/workflowengine/lib/Check/UserGroupMembership.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/apps/workflowengine/lib/Controller/RequestTimeController.php b/apps/workflowengine/lib/Controller/RequestTimeController.php
index 1aca5d92d2d..4b34f16ce0a 100644
--- a/apps/workflowengine/lib/Controller/RequestTimeController.php
+++ b/apps/workflowengine/lib/Controller/RequestTimeController.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/apps/workflowengine/lib/Listener/LoadAdditionalSettingsScriptsListener.php b/apps/workflowengine/lib/Listener/LoadAdditionalSettingsScriptsListener.php
index 3b5f3f0ae11..e5a03fdcb2e 100644
--- a/apps/workflowengine/lib/Listener/LoadAdditionalSettingsScriptsListener.php
+++ b/apps/workflowengine/lib/Listener/LoadAdditionalSettingsScriptsListener.php
@@ -6,25 +6,18 @@ declare(strict_types=1);
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
+
namespace OCA\WorkflowEngine\Listener;
use OCA\WorkflowEngine\AppInfo\Application;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
-use OCP\Template;
use OCP\Util;
use OCP\WorkflowEngine\Events\LoadSettingsScriptsEvent;
-use function class_exists;
-use function function_exists;
/** @template-implements IEventListener<LoadSettingsScriptsEvent> */
class LoadAdditionalSettingsScriptsListener implements IEventListener {
public function handle(Event $event): void {
- if (!function_exists('style')) {
- // This is hacky, but we need to load the template class
- class_exists(Template::class, true);
- }
-
Util::addScript('core', 'files_fileinfo');
Util::addScript('core', 'files_client');
Util::addScript('core', 'systemtags');
diff --git a/apps/workflowengine/lib/Manager.php b/apps/workflowengine/lib/Manager.php
index 7d14fc83449..0f41679789d 100644
--- a/apps/workflowengine/lib/Manager.php
+++ b/apps/workflowengine/lib/Manager.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/apps/workflowengine/lib/Settings/Section.php b/apps/workflowengine/lib/Settings/Section.php
index 5a13a9e4cec..aa790c9ddcc 100644
--- a/apps/workflowengine/lib/Settings/Section.php
+++ b/apps/workflowengine/lib/Settings/Section.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later