Skip to content

Commit 243b882

Browse files
authored
Merge pull request #5500 from LibreSign/fix/apply-rector
fix: apply rector
2 parents cf8e1c5 + 459c0b1 commit 243b882

15 files changed

Lines changed: 13 additions & 19 deletions

File tree

lib/Controller/IdentifyAccountController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ private function registerPlugin(string $method): void {
8686

8787
$refObject = new \ReflectionObject($this->collaboratorSearch);
8888
$refProperty = $refObject->getProperty('pluginList');
89-
$refProperty->setAccessible(true);
9089

9190
$plugins = $refProperty->getValue($this->collaboratorSearch);
9291
$plugins[SignerPlugin::TYPE_SIGNER] = [SignerPlugin::class];

lib/Db/IdentifyMethodMapper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ public function neutralizeDeletedUser(string $userId, string $displayName): void
7474
}
7575
}
7676

77+
/**
78+
* @return array<string, string>[]
79+
*/
7780
public function searchByIdentifierValue(string $search, string $userId, string $method, int $limit = 20, int $offset = 0): array {
7881
$qb = $this->db->getQueryBuilder();
7982

lib/Db/SignRequestMapper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ public function findRemindersCandidates(): \Generator {
221221

222222
$result = $qb->executeQuery();
223223
try {
224+
/** @var array<string, mixed> $row */
224225
while ($row = $result->fetch()) {
225226
$signRequest = new SignRequest();
226227
$identifyMethod = new IdentifyMethod();

lib/Files/TSimpleFile.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ public function getInternalPathOfFile(ISimpleFile $node): string {
1919
$reflection = new \ReflectionClass($node);
2020
if ($reflection->hasProperty('parentFolder')) {
2121
$reflectionProperty = $reflection->getProperty('parentFolder');
22-
$reflectionProperty->setAccessible(true);
2322
$folder = $reflectionProperty->getValue($node);
2423
$path = $folder->getInternalPath() . '/' . $node->getName();
2524
} elseif ($reflection->hasProperty('file')) {
2625
$reflectionProperty = $reflection->getProperty('file');
27-
$reflectionProperty->setAccessible(true);
2826
$file = $reflectionProperty->getValue($node);
2927
$path = $file->getPath();
3028
}
@@ -37,7 +35,6 @@ public function getInternalPathOfFile(ISimpleFile $node): string {
3735
private function getInternalPathOfFolder(ISimpleFolder $node): string {
3836
$reflection = new \ReflectionClass($node);
3937
$reflectionProperty = $reflection->getProperty('folder');
40-
$reflectionProperty->setAccessible(true);
4138
$folder = $reflectionProperty->getValue($node);
4239
$path = $folder->getInternalPath();
4340
return $path;

lib/Handler/CertificateEngine/AEngineHandler.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ public function getConfigPath(): string {
275275
private function getInternalPathOfFolder(ISimpleFolder $node): string {
276276
$reflection = new \ReflectionClass($node);
277277
$reflectionProperty = $reflection->getProperty('folder');
278-
$reflectionProperty->setAccessible(true);
279278
$folder = $reflectionProperty->getValue($node);
280279
$path = $folder->getInternalPath();
281280
return $path;

lib/Handler/CertificateEngine/CfsslHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ private function portOpen(): bool {
274274
$host = parse_url($this->getCfsslUri(), PHP_URL_HOST);
275275
$port = parse_url($this->getCfsslUri(), PHP_URL_PORT);
276276

277-
set_error_handler(function () { });
277+
set_error_handler(function (): void { });
278278
$socket = fsockopen($host, $port, $errno, $errstr, 0.1);
279279
restore_error_handler();
280280
if (!$socket || $errno || $errstr) {

lib/Migration/DeleteOldBinaries.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ private function deleteRecursive(Folder $folder, array $allowedFiles): void {
108108
private function getSimpleFolderList(ISimpleFolder $node): array {
109109
$reflection = new \ReflectionClass($node);
110110
$reflectionProperty = $reflection->getProperty('folder');
111-
$reflectionProperty->setAccessible(true);
112111
$folder = $reflectionProperty->getValue($node);
113112
$list = $folder->getDirectoryListing();
114113
return $list;

lib/Service/FolderService.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ protected function getContainerFolder(): Folder {
102102
$containerFolder = $this->appData->getFolder('/');
103103
$reflection = new \ReflectionClass($containerFolder);
104104
$reflectionProperty = $reflection->getProperty('folder');
105-
$reflectionProperty->setAccessible(true);
106105
return $reflectionProperty->getValue($containerFolder);
107106
}
108107

lib/Service/IdentifyMethod/SignatureMethod/EmailToken.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public function toArray(): array {
3535
$email = match ($entity->getIdentifierKey()) {
3636
'email' => $entity->getIdentifierValue(),
3737
'account' => $this->identifyService->getUserManager()->get($entity->getIdentifierValue())
38-
?->getEMailAddress(),
39-
default => null,
38+
?->getEMailAddress() ?? '',
39+
default => '',
4040
};
4141

4242
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {

lib/Service/IdentifyMethod/SignatureMethod/TwofactorGatewayToken.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public function toArray(): array {
3333
$identifier = match ($entity->getIdentifierKey()) {
3434
'identifier' => $entity->getIdentifierValue(),
3535
'account' => $this->identifyService->getUserManager()->get($entity->getIdentifierValue())
36-
?->getEMailAddress(),
37-
default => null,
36+
?->getEMailAddress() ?? '',
37+
default => '',
3838
};
3939

4040
$code = $entity->getCode();

0 commit comments

Comments
 (0)