mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
chore: adjust NCU to have proper final keyword and Override attribute where needed
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
3a9733a878
commit
30a88a2240
13 changed files with 16 additions and 15 deletions
|
|
@ -15,5 +15,5 @@ use Exception;
|
|||
* @deprecated 32.0.0 use \OCP\Config\Exceptions\IncorrectTypeException
|
||||
* @see \OCP\Config\Exceptions\IncorrectTypeException
|
||||
*/
|
||||
class IncorrectTypeException extends Exception {
|
||||
final class IncorrectTypeException extends Exception {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@ use Exception;
|
|||
* @deprecated 32.0.0 use \OCP\Config\Exceptions\TypeConflictException
|
||||
* @see \OCP\Config\Exceptions\TypeConflictException
|
||||
*/
|
||||
class TypeConflictException extends Exception {
|
||||
final class TypeConflictException extends Exception {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@ use Exception;
|
|||
* @deprecated 32.0.0 use \OCP\Config\Exceptions\UnknownKeyException
|
||||
* @see \OCP\Config\Exceptions\UnknownKeyException
|
||||
*/
|
||||
class UnknownKeyException extends Exception {
|
||||
final class UnknownKeyException extends Exception {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use NCU\Config\ValueType;
|
|||
* @see \OCP\Config\Lexicon\Entry
|
||||
* @psalm-suppress DeprecatedClass
|
||||
*/
|
||||
class ConfigLexiconEntry {
|
||||
final class ConfigLexiconEntry {
|
||||
/**
|
||||
* @experimental 32.0.0
|
||||
* @deprecated 32.0.0 use \OCP\Config\Lexicon\Entry
|
||||
|
|
@ -145,7 +145,7 @@ class ConfigLexiconEntry {
|
|||
* @see \OCP\Config\Lexicon\Entry
|
||||
*/
|
||||
private function convertFromArray(array $default): string {
|
||||
return json_encode($default);
|
||||
return json_encode($default, JSON_THROW_ON_ERROR);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -13,5 +13,5 @@ namespace NCU\Security\Signature\Exceptions;
|
|||
* @deprecated 33.0.0 use {@see \OCP\Security\Signature\Exceptions\IdentityNotFoundException}
|
||||
* @psalm-suppress DeprecatedClass
|
||||
*/
|
||||
class IdentityNotFoundException extends SignatureException {
|
||||
final class IdentityNotFoundException extends SignatureException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,5 +13,5 @@ namespace NCU\Security\Signature\Exceptions;
|
|||
* @deprecated 33.0.0 use {@see \OCP\Security\Signature\Exceptions\IncomingRequestException}
|
||||
* @psalm-suppress DeprecatedClass
|
||||
*/
|
||||
class IncomingRequestException extends SignatureException {
|
||||
final class IncomingRequestException extends SignatureException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,5 +13,5 @@ namespace NCU\Security\Signature\Exceptions;
|
|||
* @deprecated 33.0.0 use {@see \OCP\Security\Signature\Exceptions\InvalidKeyOriginException}
|
||||
* @psalm-suppress DeprecatedClass
|
||||
*/
|
||||
class InvalidKeyOriginException extends SignatureException {
|
||||
final class InvalidKeyOriginException extends SignatureException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,5 +13,5 @@ namespace NCU\Security\Signature\Exceptions;
|
|||
* @deprecated 33.0.0 use {@see \OCP\Security\Signature\Exceptions\InvalidSignatureException}
|
||||
* @psalm-suppress DeprecatedClass
|
||||
*/
|
||||
class InvalidSignatureException extends SignatureException {
|
||||
final class InvalidSignatureException extends SignatureException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,5 +13,5 @@ namespace NCU\Security\Signature\Exceptions;
|
|||
* @deprecated 33.0.0 use {@see \OCP\Security\Signature\Exceptions\SignatoryConflictException}
|
||||
* @psalm-suppress DeprecatedClass
|
||||
*/
|
||||
class SignatoryConflictException extends SignatoryException {
|
||||
final class SignatoryConflictException extends SignatoryException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,5 +13,5 @@ namespace NCU\Security\Signature\Exceptions;
|
|||
* @deprecated 33.0.0 use {@see \OCP\Security\Signature\Exceptions\SignatoryNotFoundException}
|
||||
* @psalm-suppress DeprecatedClass
|
||||
*/
|
||||
class SignatoryNotFoundException extends SignatoryException {
|
||||
final class SignatoryNotFoundException extends SignatoryException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,5 +13,5 @@ namespace NCU\Security\Signature\Exceptions;
|
|||
* @deprecated 33.0.0 use {@see \OCP\Security\Signature\Exceptions\SignatureElementNotFoundException}
|
||||
* @psalm-suppress DeprecatedClass
|
||||
*/
|
||||
class SignatureElementNotFoundException extends SignatureException {
|
||||
final class SignatureElementNotFoundException extends SignatureException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,5 +13,5 @@ namespace NCU\Security\Signature\Exceptions;
|
|||
* @deprecated 33.0.0 use {@see \OCP\Security\Signature\Exceptions\SignatureNotFoundException}
|
||||
* @psalm-suppress DeprecatedClass
|
||||
*/
|
||||
class SignatureNotFoundException extends SignatureException {
|
||||
final class SignatureNotFoundException extends SignatureException {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ use OCP\AppFramework\Db\Entity;
|
|||
* @method int getLastUpdated()
|
||||
* @psalm-suppress PropertyNotSetInConstructor
|
||||
*/
|
||||
class Signatory extends Entity implements JsonSerializable {
|
||||
final class Signatory extends Entity implements JsonSerializable {
|
||||
protected string $keyId = '';
|
||||
protected string $keyIdSum = '';
|
||||
protected string $providerId = '';
|
||||
|
|
@ -103,7 +103,7 @@ class Signatory extends Entity implements JsonSerializable {
|
|||
|
||||
// removing /index.php from generated url
|
||||
$path = parse_url($keyId, PHP_URL_PATH);
|
||||
if (str_starts_with($path, '/index.php/')) {
|
||||
if ($path !== null && $path !== false && str_starts_with($path, '/index.php/')) {
|
||||
$pos = strpos($keyId, '/index.php');
|
||||
if ($pos !== false) {
|
||||
$keyId = substr_replace($keyId, '', $pos, 10);
|
||||
|
|
@ -182,6 +182,7 @@ class Signatory extends Entity implements JsonSerializable {
|
|||
* @experimental 31.0.0
|
||||
* @deprecated 33.0.0 use {@see \OCP\Security\Signature\Model\Signatory}
|
||||
*/
|
||||
#[\Override]
|
||||
public function jsonSerialize(): array {
|
||||
return [
|
||||
'keyId' => $this->getKeyId(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue