From d40ab4e520fa136ee14187ddec439d1abd57062f 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/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 ++++---- 8 files changed, 12 insertions(+), 12 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/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 1316676e75..da47db1863 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 ImagickException; use OC\SystemConfig; 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 8eb2b6aa0d..90aad6e0f2 100644 --- a/tests/Unit/TestCase.php +++ b/tests/Unit/TestCase.php @@ -159,8 +159,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)) { @@ -173,8 +173,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 be4dab7df6fce0e1d36a977f4508f7d2908a32bc 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 41389edd22f84bf5139832e87aa51c1604537c7e 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 --- lib/Command/Configure/Check.php | 2 +- tests/psalm-baseline.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Command/Configure/Check.php b/lib/Command/Configure/Check.php index d160ba9122..2a08d19806 100644 --- a/lib/Command/Configure/Check.php +++ b/lib/Command/Configure/Check.php @@ -26,7 +26,7 @@ use OC\Core\Command\Base; use OCA\Libresign\AppInfo\Application; -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/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index bbedfb9ba6..d3ecdd31ab 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -118,7 +118,7 @@ $config - + Process