Skip to content

Commit 2fbf19c

Browse files
refactor(rector): apply safe modernizations in SignFileService
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 44e7b5d commit 2fbf19c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/Service/SignFileService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ protected function getNodeByIdUsingUid(string $uid, int $nodeId): File {
13861386
if (!$fileToSign instanceof File) {
13871387
$this->logger->error('[file-access] Node is not a File - nodeId={nodeId} type={type}', [
13881388
'nodeId' => $nodeId,
1389-
'type' => $fileToSign ? get_class($fileToSign) : 'NULL',
1389+
'type' => $fileToSign ? $fileToSign::class : 'NULL',
13901390
]);
13911391
throw new LibresignException($this->l10n->t('File not found'));
13921392
}
@@ -1443,7 +1443,7 @@ private function createSignedFile(File $originalFile, string $content): File {
14431443

14441444
$fileId = $this->libreSignFile->getId();
14451445
$extension = $originalFile->getExtension();
1446-
$uniqueFilename = substr($filename, 0, -strlen($extension) - 1) . '_' . $fileId . '.' . $extension;
1446+
$uniqueFilename = substr((string)$filename, 0, -strlen($extension) - 1) . '_' . $fileId . '.' . $extension;
14471447

14481448
try {
14491449
/** @var \OCP\Files\Folder */
@@ -1608,7 +1608,7 @@ private function recordSignatureAttempt(Exception $exception): void {
16081608

16091609
$attempt = [
16101610
'timestamp' => (new DateTime())->format(\DateTime::ATOM),
1611-
'engine' => $this->engine ? get_class($this->engine) : 'unknown',
1611+
'engine' => $this->engine ? $this->engine::class : 'unknown',
16121612
'error_message' => $exception->getMessage(),
16131613
'error_code' => $exception->getCode(),
16141614
];

0 commit comments

Comments
 (0)