Skip to content

Commit

Permalink
Merge pull request #2590 from LibreSign/feature/organize-install-files
Browse files Browse the repository at this point in the history
Organize install files
  • Loading branch information
vitormattos authored Mar 26, 2024
2 parents f1bd453 + a9dd0b4 commit 71df343
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/Command/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/Configure/Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion lib/Command/Developer/Reset.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

declare(strict_types=1);
/**
* @copyright Copyright (c) 2020 Joas Schilling <coding@schilljs.com>
* @copyright Copyright (c) 2023 Vitor Mattos <vitor@php.rio>
*
* @author Vitor Mattos <vitor@php.rio>
*
* @license GNU AGPL version 3 or any later version
*
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/Handler/CertificateEngine/CfsslHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/Migration/Version8000Date20230730032402.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

namespace OCA\Libresign\Service;
namespace OCA\Libresign\Service\Install;

use OC\SystemConfig;
use OCA\Libresign\Handler\CertificateEngine\Handler as CertificateEngine;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

namespace OCA\Libresign\Service;
namespace OCA\Libresign\Service\Install;

use InvalidArgumentException;
use OC;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Service/InstallServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<code>private</code>
</UndefinedClass>
</file>
<file src="lib/Service/InstallService.php">
<file src="lib/Service/Install/InstallService.php">
<UndefinedClass occurrences="1">
<code>Process</code>
</UndefinedClass>
Expand Down

0 comments on commit 71df343

Please sign in to comment.