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:
Ferdinand Thiessen 2026-04-28 19:24:07 +02:00
parent 3a9733a878
commit 30a88a2240
No known key found for this signature in database
GPG key ID: 7E849AE05218500F
13 changed files with 16 additions and 15 deletions

View file

@ -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 {
}

View file

@ -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 {
}

View file

@ -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 {
}

View file

@ -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);
}
/**

View file

@ -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 {
}

View file

@ -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 {
}

View file

@ -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 {
}

View file

@ -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 {
}

View file

@ -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 {
}

View file

@ -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 {
}

View file

@ -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 {
}

View file

@ -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 {
}

View file

@ -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(),