From 1a4a4dfaf0ed96b1a071bfe8616a1309bcc4fb70 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 25 Mar 2024 17:49:52 -0300 Subject: [PATCH 1/3] Move install files to service/install Signed-off-by: Vitor Mattos --- lib/Command/Base.php | 2 +- lib/Command/Configure/Check.php | 2 +- lib/Controller/AdminController.php | 4 ++-- lib/Handler/CertificateEngine/CfsslHandler.php | 2 +- lib/Migration/Version8000Date20230730032402.php | 2 +- lib/Service/{ => Install}/ConfigureCheckService.php | 2 +- lib/Service/{ => Install}/InstallService.php | 2 +- tests/Unit/Service/InstallServiceTest.php | 2 +- tests/Unit/TestCase.php | 8 ++++---- 9 files changed, 13 insertions(+), 13 deletions(-) rename lib/Service/{ => Install}/ConfigureCheckService.php (99%) rename lib/Service/{ => Install}/InstallService.php (99%) diff --git a/lib/Command/Base.php b/lib/Command/Base.php index 1be5ad9a3f..ce04f4781c 100644 --- a/lib/Command/Base.php +++ b/lib/Command/Base.php @@ -25,7 +25,7 @@ namespace OCA\Libresign\Command; use OC\Core\Command\Base as CommandBase; -use OCA\Libresign\Service\InstallService; +use OCA\Libresign\Service\Install\InstallService; use Psr\Log\LoggerInterface; class Base extends CommandBase { diff --git a/lib/Command/Configure/Check.php b/lib/Command/Configure/Check.php index 05229f6c53..d94be25d66 100644 --- a/lib/Command/Configure/Check.php +++ b/lib/Command/Configure/Check.php @@ -25,7 +25,7 @@ namespace OCA\Libresign\Command\Configure; use OC\Core\Command\Base; -use OCA\Libresign\Service\ConfigureCheckService; +use OCA\Libresign\Service\Install\ConfigureCheckService; use OCP\IConfig; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Helper\TableCell; diff --git a/lib/Controller/AdminController.php b/lib/Controller/AdminController.php index 0e58f7735b..c1f4a723d4 100644 --- a/lib/Controller/AdminController.php +++ b/lib/Controller/AdminController.php @@ -28,8 +28,8 @@ use OCA\Libresign\Exception\LibresignException; use OCA\Libresign\Handler\CertificateEngine\Handler as CertificateEngineHandler; use OCA\Libresign\Helper\ConfigureCheckHelper; -use OCA\Libresign\Service\ConfigureCheckService; -use OCA\Libresign\Service\InstallService; +use OCA\Libresign\Service\Install\ConfigureCheckService; +use OCA\Libresign\Service\Install\InstallService; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\NoCSRFRequired; diff --git a/lib/Handler/CertificateEngine/CfsslHandler.php b/lib/Handler/CertificateEngine/CfsslHandler.php index 2e3c0d4f3d..73d94b7663 100644 --- a/lib/Handler/CertificateEngine/CfsslHandler.php +++ b/lib/Handler/CertificateEngine/CfsslHandler.php @@ -32,7 +32,7 @@ use OCA\Libresign\Exception\LibresignException; use OCA\Libresign\Handler\CfsslServerHandler; use OCA\Libresign\Helper\ConfigureCheckHelper; -use OCA\Libresign\Service\InstallService; +use OCA\Libresign\Service\Install\InstallService; use OCP\AppFramework\Services\IAppConfig; use OCP\Files\AppData\IAppDataFactory; use OCP\IConfig; diff --git a/lib/Migration/Version8000Date20230730032402.php b/lib/Migration/Version8000Date20230730032402.php index 904e6f874f..eeaa558112 100644 --- a/lib/Migration/Version8000Date20230730032402.php +++ b/lib/Migration/Version8000Date20230730032402.php @@ -26,7 +26,7 @@ namespace OCA\Libresign\Migration; use Closure; -use OCA\Libresign\Service\InstallService; +use OCA\Libresign\Service\Install\InstallService; use OCP\AppFramework\Services\IAppConfig; use OCP\Migration\IOutput; use OCP\Migration\SimpleMigrationStep; diff --git a/lib/Service/ConfigureCheckService.php b/lib/Service/Install/ConfigureCheckService.php similarity index 99% rename from lib/Service/ConfigureCheckService.php rename to lib/Service/Install/ConfigureCheckService.php index 5aa8de8cff..ccc79b20c0 100644 --- a/lib/Service/ConfigureCheckService.php +++ b/lib/Service/Install/ConfigureCheckService.php @@ -22,7 +22,7 @@ * along with this program. If not, see . */ -namespace OCA\Libresign\Service; +namespace OCA\Libresign\Service\Install; use OC\SystemConfig; use OCA\Libresign\Handler\CertificateEngine\Handler as CertificateEngine; diff --git a/lib/Service/InstallService.php b/lib/Service/Install/InstallService.php similarity index 99% rename from lib/Service/InstallService.php rename to lib/Service/Install/InstallService.php index e193a8775a..f64794df03 100644 --- a/lib/Service/InstallService.php +++ b/lib/Service/Install/InstallService.php @@ -22,7 +22,7 @@ * along with this program. If not, see . */ -namespace OCA\Libresign\Service; +namespace OCA\Libresign\Service\Install; use InvalidArgumentException; use OC; diff --git a/tests/Unit/Service/InstallServiceTest.php b/tests/Unit/Service/InstallServiceTest.php index c54e42290f..3cd569931a 100644 --- a/tests/Unit/Service/InstallServiceTest.php +++ b/tests/Unit/Service/InstallServiceTest.php @@ -24,7 +24,7 @@ namespace OCA\Libresign\Tests\Unit\Service; use OCA\Libresign\Handler\CertificateEngine\Handler as CertificateEngineHandler; -use OCA\Libresign\Service\InstallService; +use OCA\Libresign\Service\Install\InstallService; use OCP\AppFramework\Services\IAppConfig; use OCP\Files\AppData\IAppDataFactory; use OCP\Files\IRootFolder; diff --git a/tests/Unit/TestCase.php b/tests/Unit/TestCase.php index 4061042f31..476bdb7f7d 100644 --- a/tests/Unit/TestCase.php +++ b/tests/Unit/TestCase.php @@ -180,8 +180,8 @@ public function deleteUserIfExists($username): void { } private function getBinariesFromCache(): void { - /** @var \OCA\Libresign\Service\InstallService */ - $install = \OC::$server->get(\OCA\Libresign\Service\InstallService::class); + /** @var \OCA\Libresign\Service\Install\InstallService */ + $install = \OC::$server->get(\OCA\Libresign\Service\Install\InstallService::class); $appPath = $install->getFullPath(); $cachePath = preg_replace('/\/.*\/appdata_[a-z0-9]*/', \OC::$server->getTempManager()->getTempBaseDir(), $appPath); if (!file_exists($cachePath)) { @@ -194,8 +194,8 @@ private function getBinariesFromCache(): void { } private function backupBinaries(): void { - /** @var \OCA\Libresign\Service\InstallService */ - $install = \OC::$server->get(\OCA\Libresign\Service\InstallService::class); + /** @var \OCA\Libresign\Service\Install\InstallService */ + $install = \OC::$server->get(\OCA\Libresign\Service\Install\InstallService::class); $appPath = $install->getFullPath(); if (!is_readable($appPath)) { return; From 637ca656b3456bb481abbb4758d1f418e9b88e8e Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 25 Mar 2024 17:56:57 -0300 Subject: [PATCH 2/3] Fix header Signed-off-by: Vitor Mattos --- lib/Command/Developer/Reset.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Command/Developer/Reset.php b/lib/Command/Developer/Reset.php index 06658985f3..2e402dc094 100644 --- a/lib/Command/Developer/Reset.php +++ b/lib/Command/Developer/Reset.php @@ -2,7 +2,9 @@ declare(strict_types=1); /** - * @copyright Copyright (c) 2020 Joas Schilling + * @copyright Copyright (c) 2023 Vitor Mattos + * + * @author Vitor Mattos * * @license GNU AGPL version 3 or any later version * From a9dd0b4f2da8b981f6d90bad8b330c3155b8c349 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 25 Mar 2024 19:29:46 -0300 Subject: [PATCH 3/3] Psalm update baseline Signed-off-by: Vitor Mattos --- tests/psalm-baseline.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index c90cca0208..53f8ad31dc 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -90,7 +90,7 @@ private - + Process