fixup! Move HintException to OCP

This commit is contained in:
Julius Härtl 2021-04-21 10:49:09 +02:00
parent 016c4f33ac
commit 7ffe14a93b
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
4 changed files with 40 additions and 0 deletions

View File

@ -1152,6 +1152,7 @@ return array(
'OC\\Group\\Group' => $baseDir . '/lib/private/Group/Group.php',
'OC\\Group\\Manager' => $baseDir . '/lib/private/Group/Manager.php',
'OC\\Group\\MetaData' => $baseDir . '/lib/private/Group/MetaData.php',
'OC\\HintException' => $baseDir . '/lib/private/HintException.php',
'OC\\Hooks\\BasicEmitter' => $baseDir . '/lib/private/Hooks/BasicEmitter.php',
'OC\\Hooks\\Emitter' => $baseDir . '/lib/private/Hooks/Emitter.php',
'OC\\Hooks\\EmitterTrait' => $baseDir . '/lib/private/Hooks/EmitterTrait.php',

View File

@ -1181,6 +1181,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OC\\Group\\Group' => __DIR__ . '/../../..' . '/lib/private/Group/Group.php',
'OC\\Group\\Manager' => __DIR__ . '/../../..' . '/lib/private/Group/Manager.php',
'OC\\Group\\MetaData' => __DIR__ . '/../../..' . '/lib/private/Group/MetaData.php',
'OC\\HintException' => __DIR__ . '/../../..' . '/lib/private/HintException.php',
'OC\\Hooks\\BasicEmitter' => __DIR__ . '/../../..' . '/lib/private/Hooks/BasicEmitter.php',
'OC\\Hooks\\Emitter' => __DIR__ . '/../../..' . '/lib/private/Hooks/Emitter.php',
'OC\\Hooks\\EmitterTrait' => __DIR__ . '/../../..' . '/lib/private/Hooks/EmitterTrait.php',

View File

@ -0,0 +1,34 @@
<?php
/*
* @copyright Copyright (c) 2021 Julius Härtl <jus@bitgrid.net>
*
* @author Julius Härtl <jus@bitgrid.net>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
declare(strict_types=1);
namespace OC;
/**
* @depreacted 22.0.0 Use \OCP\HintException
*/
class HintException extends \OCP\HintException {
}

View File

@ -33,6 +33,7 @@ namespace OCP;
* An Exception class with the intention to be presented to the end user
*
* @package OCP
* @since 22.0.0
*/
class HintException extends \Exception {
private $hint;
@ -48,6 +49,7 @@ class HintException extends \Exception {
* contain sensitive data.
* @param int $code
* @param \Exception|null $previous
* @since 22.0.0
*/
public function __construct($message, $hint = '', $code = 0, \Exception $previous = null) {
$this->hint = $hint;
@ -59,6 +61,7 @@ class HintException extends \Exception {
* code, the message and the hint.
*
* @return string
* @since 22.0.0
*/
public function __toString() {
return __CLASS__ . ": [{$this->code}]: {$this->message} ({$this->hint})\n";
@ -70,6 +73,7 @@ class HintException extends \Exception {
* instead.
*
* @return string
* @since 22.0.0
*/
public function getHint() {
if (empty($this->hint)) {