aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/lib/Check
diff options
context:
space:
mode:
authorKate <26026535+provokateurin@users.noreply.github.com>2024-10-22 12:47:45 +0200
committerGitHub <noreply@github.com>2024-10-22 12:47:45 +0200
commit070adc1131fcd5476e4a93ebf28be6f409c5a992 (patch)
tree1e8e2238a22d544c370f1ac804426ed675c5eacf /apps/workflowengine/lib/Check
parent582af10e0be1b22ebde0429b756f62107d8e8083 (diff)
parente8426996f59ab6dbf0c94adee8f410cbd572b11a (diff)
downloadnextcloud-server-070adc1131fcd5476e4a93ebf28be6f409c5a992.tar.gz
nextcloud-server-070adc1131fcd5476e4a93ebf28be6f409c5a992.zip
Merge pull request #48790 from nextcloud/refactor/apps/constructor-property-promotion
Diffstat (limited to 'apps/workflowengine/lib/Check')
-rw-r--r--apps/workflowengine/lib/Check/AbstractStringCheck.php8
-rw-r--r--apps/workflowengine/lib/Check/FileMimeType.php14
-rw-r--r--apps/workflowengine/lib/Check/FileName.php13
-rw-r--r--apps/workflowengine/lib/Check/FileSize.php13
-rw-r--r--apps/workflowengine/lib/Check/FileSystemTags.php28
-rw-r--r--apps/workflowengine/lib/Check/RequestRemoteAddress.php13
-rw-r--r--apps/workflowengine/lib/Check/RequestTime.php13
-rw-r--r--apps/workflowengine/lib/Check/RequestURL.php9
-rw-r--r--apps/workflowengine/lib/Check/RequestUserAgent.php9
-rw-r--r--apps/workflowengine/lib/Check/TFileCheck.php3
-rw-r--r--apps/workflowengine/lib/Check/UserGroupMembership.php18
11 files changed, 45 insertions, 96 deletions
diff --git a/apps/workflowengine/lib/Check/AbstractStringCheck.php b/apps/workflowengine/lib/Check/AbstractStringCheck.php
index 1c544c8c000..4e56cda377e 100644
--- a/apps/workflowengine/lib/Check/AbstractStringCheck.php
+++ b/apps/workflowengine/lib/Check/AbstractStringCheck.php
@@ -14,14 +14,12 @@ abstract class AbstractStringCheck implements ICheck {
/** @var array[] Nested array: [Pattern => [ActualValue => Regex Result]] */
protected $matches;
- /** @var IL10N */
- protected $l;
-
/**
* @param IL10N $l
*/
- public function __construct(IL10N $l) {
- $this->l = $l;
+ public function __construct(
+ protected IL10N $l,
+ ) {
}
/**
diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php
index c1e448376c9..3062994c6ba 100644
--- a/apps/workflowengine/lib/Check/FileMimeType.php
+++ b/apps/workflowengine/lib/Check/FileMimeType.php
@@ -21,21 +21,17 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck {
/** @var array */
protected $mimeType;
- /** @var IRequest */
- protected $request;
-
- /** @var IMimeTypeDetector */
- protected $mimeTypeDetector;
-
/**
* @param IL10N $l
* @param IRequest $request
* @param IMimeTypeDetector $mimeTypeDetector
*/
- public function __construct(IL10N $l, IRequest $request, IMimeTypeDetector $mimeTypeDetector) {
+ public function __construct(
+ IL10N $l,
+ protected IRequest $request,
+ protected IMimeTypeDetector $mimeTypeDetector,
+ ) {
parent::__construct($l);
- $this->request = $request;
- $this->mimeTypeDetector = $mimeTypeDetector;
}
/**
diff --git a/apps/workflowengine/lib/Check/FileName.php b/apps/workflowengine/lib/Check/FileName.php
index b4c41811182..4a9d503018f 100644
--- a/apps/workflowengine/lib/Check/FileName.php
+++ b/apps/workflowengine/lib/Check/FileName.php
@@ -18,19 +18,16 @@ use OCP\WorkflowEngine\IFileCheck;
class FileName extends AbstractStringCheck implements IFileCheck {
use TFileCheck;
- /** @var IRequest */
- protected $request;
- /** @var IMountManager */
- private $mountManager;
-
/**
* @param IL10N $l
* @param IRequest $request
*/
- public function __construct(IL10N $l, IRequest $request, IMountManager $mountManager) {
+ public function __construct(
+ IL10N $l,
+ protected IRequest $request,
+ private IMountManager $mountManager,
+ ) {
parent::__construct($l);
- $this->request = $request;
- $this->mountManager = $mountManager;
}
/**
diff --git a/apps/workflowengine/lib/Check/FileSize.php b/apps/workflowengine/lib/Check/FileSize.php
index 51d7d38a7af..c1ee1d85ae9 100644
--- a/apps/workflowengine/lib/Check/FileSize.php
+++ b/apps/workflowengine/lib/Check/FileSize.php
@@ -16,19 +16,14 @@ class FileSize implements ICheck {
/** @var int */
protected $size;
- /** @var IL10N */
- protected $l;
-
- /** @var IRequest */
- protected $request;
-
/**
* @param IL10N $l
* @param IRequest $request
*/
- public function __construct(IL10N $l, IRequest $request) {
- $this->l = $l;
- $this->request = $request;
+ public function __construct(
+ protected IL10N $l,
+ protected IRequest $request,
+ ) {
}
/**
diff --git a/apps/workflowengine/lib/Check/FileSystemTags.php b/apps/workflowengine/lib/Check/FileSystemTags.php
index e8d27c1c4ad..bd1609e9aff 100644
--- a/apps/workflowengine/lib/Check/FileSystemTags.php
+++ b/apps/workflowengine/lib/Check/FileSystemTags.php
@@ -29,31 +29,13 @@ class FileSystemTags implements ICheck, IFileCheck {
/** @var array */
protected $fileSystemTags;
- /** @var IL10N */
- protected $l;
-
- /** @var ISystemTagManager */
- protected $systemTagManager;
-
- /** @var ISystemTagObjectMapper */
- protected $systemTagObjectMapper;
- /** @var IUserSession */
- protected $userSession;
- /** @var IGroupManager */
- protected $groupManager;
-
public function __construct(
- IL10N $l,
- ISystemTagManager $systemTagManager,
- ISystemTagObjectMapper $systemTagObjectMapper,
- IUserSession $userSession,
- IGroupManager $groupManager,
+ protected IL10N $l,
+ protected ISystemTagManager $systemTagManager,
+ protected ISystemTagObjectMapper $systemTagObjectMapper,
+ protected IUserSession $userSession,
+ protected IGroupManager $groupManager,
) {
- $this->l = $l;
- $this->systemTagManager = $systemTagManager;
- $this->systemTagObjectMapper = $systemTagObjectMapper;
- $this->userSession = $userSession;
- $this->groupManager = $groupManager;
}
/**
diff --git a/apps/workflowengine/lib/Check/RequestRemoteAddress.php b/apps/workflowengine/lib/Check/RequestRemoteAddress.php
index 909b26c74d6..6fb5a3026d6 100644
--- a/apps/workflowengine/lib/Check/RequestRemoteAddress.php
+++ b/apps/workflowengine/lib/Check/RequestRemoteAddress.php
@@ -11,19 +11,14 @@ use OCP\WorkflowEngine\ICheck;
class RequestRemoteAddress implements ICheck {
- /** @var IL10N */
- protected $l;
-
- /** @var IRequest */
- protected $request;
-
/**
* @param IL10N $l
* @param IRequest $request
*/
- public function __construct(IL10N $l, IRequest $request) {
- $this->l = $l;
- $this->request = $request;
+ public function __construct(
+ protected IL10N $l,
+ protected IRequest $request,
+ ) {
}
/**
diff --git a/apps/workflowengine/lib/Check/RequestTime.php b/apps/workflowengine/lib/Check/RequestTime.php
index 3bb1dba9d93..f4d2093dc50 100644
--- a/apps/workflowengine/lib/Check/RequestTime.php
+++ b/apps/workflowengine/lib/Check/RequestTime.php
@@ -16,18 +16,13 @@ class RequestTime implements ICheck {
/** @var bool[] */
protected $cachedResults;
- /** @var IL10N */
- protected $l;
-
- /** @var ITimeFactory */
- protected $timeFactory;
-
/**
* @param ITimeFactory $timeFactory
*/
- public function __construct(IL10N $l, ITimeFactory $timeFactory) {
- $this->l = $l;
- $this->timeFactory = $timeFactory;
+ public function __construct(
+ protected IL10N $l,
+ protected ITimeFactory $timeFactory,
+ ) {
}
/**
diff --git a/apps/workflowengine/lib/Check/RequestURL.php b/apps/workflowengine/lib/Check/RequestURL.php
index 43123bddbe9..62d6dbc5c38 100644
--- a/apps/workflowengine/lib/Check/RequestURL.php
+++ b/apps/workflowengine/lib/Check/RequestURL.php
@@ -14,16 +14,15 @@ class RequestURL extends AbstractStringCheck {
/** @var ?string */
protected $url;
- /** @var IRequest */
- protected $request;
-
/**
* @param IL10N $l
* @param IRequest $request
*/
- public function __construct(IL10N $l, IRequest $request) {
+ public function __construct(
+ IL10N $l,
+ protected IRequest $request,
+ ) {
parent::__construct($l);
- $this->request = $request;
}
/**
diff --git a/apps/workflowengine/lib/Check/RequestUserAgent.php b/apps/workflowengine/lib/Check/RequestUserAgent.php
index 2ae630394fb..47db1bb0c68 100644
--- a/apps/workflowengine/lib/Check/RequestUserAgent.php
+++ b/apps/workflowengine/lib/Check/RequestUserAgent.php
@@ -10,16 +10,15 @@ use OCP\IRequest;
class RequestUserAgent extends AbstractStringCheck {
- /** @var IRequest */
- protected $request;
-
/**
* @param IL10N $l
* @param IRequest $request
*/
- public function __construct(IL10N $l, IRequest $request) {
+ public function __construct(
+ IL10N $l,
+ protected IRequest $request,
+ ) {
parent::__construct($l);
- $this->request = $request;
}
/**
diff --git a/apps/workflowengine/lib/Check/TFileCheck.php b/apps/workflowengine/lib/Check/TFileCheck.php
index 0304a76bd21..a514352e047 100644
--- a/apps/workflowengine/lib/Check/TFileCheck.php
+++ b/apps/workflowengine/lib/Check/TFileCheck.php
@@ -11,6 +11,7 @@ namespace OCA\WorkflowEngine\Check;
use OCA\WorkflowEngine\AppInfo\Application;
use OCA\WorkflowEngine\Entity\File;
use OCP\Files\Node;
+use OCP\Files\NotFoundException;
use OCP\Files\Storage\IStorage;
use OCP\WorkflowEngine\IEntity;
@@ -37,7 +38,7 @@ trait TFileCheck {
}
/**
- * @throws \OCP\Files\NotFoundException
+ * @throws NotFoundException
*/
public function setEntitySubject(IEntity $entity, $subject): void {
if ($entity instanceof File) {
diff --git a/apps/workflowengine/lib/Check/UserGroupMembership.php b/apps/workflowengine/lib/Check/UserGroupMembership.php
index 1c2e535b346..215557a75a9 100644
--- a/apps/workflowengine/lib/Check/UserGroupMembership.php
+++ b/apps/workflowengine/lib/Check/UserGroupMembership.php
@@ -20,24 +20,16 @@ class UserGroupMembership implements ICheck {
/** @var string[] */
protected $cachedGroupMemberships;
- /** @var IUserSession */
- protected $userSession;
-
- /** @var IGroupManager */
- protected $groupManager;
-
- /** @var IL10N */
- protected $l;
-
/**
* @param IUserSession $userSession
* @param IGroupManager $groupManager
* @param IL10N $l
*/
- public function __construct(IUserSession $userSession, IGroupManager $groupManager, IL10N $l) {
- $this->userSession = $userSession;
- $this->groupManager = $groupManager;
- $this->l = $l;
+ public function __construct(
+ protected IUserSession $userSession,
+ protected IGroupManager $groupManager,
+ protected IL10N $l,
+ ) {
}
/**