Skip to content

Commit

Permalink
chore: Move ErrorUtil
Browse files Browse the repository at this point in the history
Signed-off-by: Rubén D <[email protected]>
  • Loading branch information
nuxsmin committed Apr 28, 2024
1 parent ce7d02f commit e916420
Show file tree
Hide file tree
Showing 15 changed files with 701 additions and 657 deletions.
4 changes: 2 additions & 2 deletions app/modules/web/Controllers/Account/CopyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
Expand All @@ -27,7 +27,7 @@
use Exception;
use SP\Core\Events\Event;
use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Util\ErrorUtil;
use SP\Modules\Web\Util\ErrorUtil;

/**
* Class CopyController
Expand Down
4 changes: 2 additions & 2 deletions app/modules/web/Controllers/Account/CreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
Expand All @@ -27,7 +27,7 @@
use Exception;
use SP\Core\Events\Event;
use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Util\ErrorUtil;
use SP\Modules\Web\Util\ErrorUtil;

/**
* Class CreateController
Expand Down
4 changes: 2 additions & 2 deletions app/modules/web/Controllers/Account/DeleteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
Expand All @@ -31,8 +31,8 @@
use SP\Domain\Account\Ports\AccountService;
use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Modules\Web\Controllers\Helpers\Account\AccountHelper;
use SP\Modules\Web\Util\ErrorUtil;
use SP\Mvc\Controller\WebControllerHelper;
use SP\Util\ErrorUtil;

/**
* Class DeleteController
Expand Down
4 changes: 2 additions & 2 deletions app/modules/web/Controllers/Account/EditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
Expand All @@ -27,7 +27,7 @@
use Exception;
use SP\Core\Events\Event;
use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Util\ErrorUtil;
use SP\Modules\Web\Util\ErrorUtil;

/**
* Class EditController
Expand Down
4 changes: 2 additions & 2 deletions app/modules/web/Controllers/Account/EditPassController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
Expand All @@ -29,7 +29,7 @@
use Psr\Container\NotFoundExceptionInterface;
use SP\Core\Events\Event;
use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Util\ErrorUtil;
use SP\Modules\Web\Util\ErrorUtil;

/**
* Class EditPassController
Expand Down
6 changes: 2 additions & 4 deletions app/modules/web/Controllers/Account/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
Expand All @@ -27,12 +27,10 @@

use Exception;
use SP\Core\Application;
use SP\Core\Context\ContextBase;
use SP\Core\Events\Event;
use SP\Modules\Web\Controllers\Helpers\Account\AccountSearchHelper;
use SP\Modules\Web\Util\ErrorUtil;
use SP\Mvc\Controller\WebControllerHelper;
use SP\Providers\Acl\AclHandler;
use SP\Util\ErrorUtil;

/**
* Class IndexController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
Expand All @@ -31,8 +31,8 @@
use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Modules\Web\Controllers\ControllerBase;
use SP\Modules\Web\Controllers\Helpers\Account\AccountRequestHelper;
use SP\Modules\Web\Util\ErrorUtil;
use SP\Mvc\Controller\WebControllerHelper;
use SP\Util\ErrorUtil;

/**
* Class RequestAccessController
Expand Down
4 changes: 2 additions & 2 deletions app/modules/web/Controllers/Account/ViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
Expand All @@ -28,7 +28,7 @@
use Exception;
use SP\Core\Events\Event;
use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Util\ErrorUtil;
use SP\Modules\Web\Util\ErrorUtil;

/**
* ViewController
Expand Down
4 changes: 2 additions & 2 deletions app/modules/web/Controllers/Account/ViewHistoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
Expand All @@ -30,8 +30,8 @@
use SP\Domain\Account\Ports\AccountHistoryService;
use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Modules\Web\Controllers\Helpers\Account\AccountHistoryHelper;
use SP\Modules\Web\Util\ErrorUtil;
use SP\Mvc\Controller\WebControllerHelper;
use SP\Util\ErrorUtil;

/**
* ViewHistoryController
Expand Down
2 changes: 1 addition & 1 deletion app/modules/web/Controllers/Account/ViewLinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
use SP\Domain\Core\Crypt\VaultInterface;
use SP\Domain\Image\Ports\ImageService;
use SP\Http\Uri;
use SP\Modules\Web\Util\ErrorUtil;
use SP\Mvc\Controller\WebControllerHelper;
use SP\Util\ErrorUtil;
use SP\Util\Image;
use SP\Util\Serde;

Expand Down
4 changes: 2 additions & 2 deletions app/modules/web/Controllers/AccountFile/ListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
Expand All @@ -28,7 +28,7 @@
use SP\Core\Acl\Acl;
use SP\Core\Events\Event;
use SP\Domain\Core\Acl\AclActionsInterface;
use SP\Util\ErrorUtil;
use SP\Modules\Web\Util\ErrorUtil;

/**
* Class ListController
Expand Down
6 changes: 3 additions & 3 deletions app/modules/web/Controllers/UserPassReset/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
Expand All @@ -25,7 +25,7 @@
namespace SP\Modules\Web\Controllers\UserPassReset;

use SP\Modules\Web\Controllers\ControllerBase;
use SP\Util\ErrorUtil;
use SP\Modules\Web\Util\ErrorUtil;

/**
* Class IndexController
Expand All @@ -44,4 +44,4 @@ public function indexAction(): void

$this->view();
}
}
}
6 changes: 3 additions & 3 deletions app/modules/web/Controllers/UserPassReset/ResetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
Expand All @@ -26,7 +26,7 @@


use SP\Modules\Web\Controllers\ControllerBase;
use SP\Util\ErrorUtil;
use SP\Modules\Web\Util\ErrorUtil;

/**
* Class ResetController
Expand All @@ -49,4 +49,4 @@ public function resetAction(?string $hash = null): void

$this->view();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2024, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
Expand All @@ -22,7 +22,7 @@
* along with sysPass. If not, see <http://www.gnu.org/licenses/>.
*/

namespace SP\Util;
namespace SP\Modules\Web\Util;

use Exception;
use SP\Domain\Core\Acl\AccountPermissionException;
Expand All @@ -33,12 +33,11 @@
use SP\Mvc\View\Template;
use SP\Mvc\View\TemplateInterface;

use function SP\__;
use function SP\processException;

/**
* Class ErrorUtil
*
* @package SP\Util
*/
final class ErrorUtil
{
Expand Down Expand Up @@ -76,7 +75,7 @@ public static function showExceptionInView(
case AccountPermissionException::class:
self::showErrorInView($view, self::ERR_ACCOUNT_NO_PERMISSION, $render, $replace);
break;
default;
default:
self::showErrorInView($view, self::ERR_EXCEPTION, $render, $replace);
}
}
Expand Down
Loading

0 comments on commit e916420

Please sign in to comment.