-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
- Loading branch information
1 parent
4d1d4da
commit eb204b5
Showing
10 changed files
with
756 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* @copyright 2020, Maxence Lange <maxence@artificial-owl.com> | ||
* | ||
* @author Maxence Lange <maxence@artificial-owl.com> | ||
* | ||
* @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/>. | ||
* | ||
*/ | ||
|
||
namespace OC\WellKnown\Event; | ||
|
||
use OCP\EventDispatcher\Event; | ||
use OCP\WellKnown\Model\IWellKnown; | ||
|
||
/** | ||
* Class WellKnownEvent | ||
* | ||
* @package OC\WellKnown\Events | ||
* @since 21.0.0 | ||
*/ | ||
class WellKnownEvent extends Event { | ||
|
||
|
||
/** @var IWellKnown */ | ||
private $wellKnown; | ||
|
||
|
||
/** | ||
* WellKnownEvent constructor. | ||
* | ||
* @param IWellKnown $wellKnown | ||
* | ||
* @since 21.0.0 | ||
*/ | ||
public function __construct(IWellKnown $wellKnown) { | ||
parent::__construct(); | ||
|
||
$this->wellKnown = $wellKnown; | ||
} | ||
|
||
|
||
/** | ||
* @return IWellKnown | ||
* @since 21.0.0 | ||
*/ | ||
public function getWellKnown(): IWellKnown { | ||
return $this->wellKnown; | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
lib/private/WellKnown/Exceptions/NotManagedWellKnownRequestException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* @copyright 2020, Maxence Lange <maxence@artificial-owl.com> | ||
* | ||
* @author Maxence Lange <maxence@artificial-owl.com> | ||
* | ||
* @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/>. | ||
* | ||
*/ | ||
|
||
|
||
namespace OC\WellKnown\Exceptions; | ||
|
||
use Exception; | ||
use Throwable; | ||
|
||
/** | ||
* Class NotManagedWellKnownRequestException | ||
* | ||
* @package OC\WellKnown\Exceptions | ||
* @since 21.0.0 | ||
*/ | ||
class NotManagedWellKnownRequestException extends Exception { | ||
|
||
|
||
/** @var int */ | ||
private $errorCode; | ||
|
||
|
||
/** | ||
* WellKnownRequestException constructor. | ||
* | ||
* @param int $errorCode | ||
* @param string $message | ||
* @param int $code | ||
* @param Throwable|null $previous | ||
*/ | ||
public function __construct($errorCode = 404, $message = "", $code = 0, Throwable $previous = null) { | ||
parent::__construct($message, $code, $previous); | ||
$this->errorCode = $errorCode; | ||
} | ||
|
||
|
||
/** | ||
* @return int | ||
* @since 21.0.0 | ||
*/ | ||
public function getErrorCode(): int { | ||
return $this->errorCode; | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
lib/private/WellKnown/Exceptions/WellKnownRequestException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* @copyright 2020, Maxence Lange <maxence@artificial-owl.com> | ||
* | ||
* @author Maxence Lange <maxence@artificial-owl.com> | ||
* | ||
* @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/>. | ||
* | ||
*/ | ||
|
||
|
||
namespace OC\WellKnown\Exceptions; | ||
|
||
use Exception; | ||
use Throwable; | ||
|
||
/** | ||
* Class WellKnownRequestException | ||
* | ||
* @package OC\WellKnown\Exceptions | ||
* @since 21.0.0 | ||
*/ | ||
class WellKnownRequestException extends Exception { | ||
|
||
|
||
/** @var int */ | ||
private $errorCode; | ||
|
||
|
||
/** | ||
* WellKnownRequestException constructor. | ||
* | ||
* @param int $errorCode | ||
* @param string $message | ||
* @param int $code | ||
* @param Throwable|null $previous | ||
*/ | ||
public function __construct($errorCode = 404, $message = "", $code = 0, Throwable $previous = null) { | ||
parent::__construct($message, $code, $previous); | ||
$this->errorCode = $errorCode; | ||
} | ||
|
||
|
||
/** | ||
* @return int | ||
* @since 21.0.0 | ||
*/ | ||
public function getErrorCode(): int { | ||
return $this->errorCode; | ||
} | ||
} |
Oops, something went wrong.