diff --git a/src/acdhOeaw/arche/core/BadRequestException.php b/src/acdhOeaw/arche/core/BadRequestException.php index 22b2aa2..c1f9537 100644 --- a/src/acdhOeaw/arche/core/BadRequestException.php +++ b/src/acdhOeaw/arche/core/BadRequestException.php @@ -33,7 +33,7 @@ class BadRequestException extends RepoException { public function __construct(string $message = "", int $code = 400, - \Throwable $previous = null) { + ?\Throwable $previous = null) { parent::__construct($message, $code, $previous); } } diff --git a/src/acdhOeaw/arche/core/ConflictException.php b/src/acdhOeaw/arche/core/ConflictException.php index 1d7b68c..68118fd 100644 --- a/src/acdhOeaw/arche/core/ConflictException.php +++ b/src/acdhOeaw/arche/core/ConflictException.php @@ -33,7 +33,7 @@ class ConflictException extends BadRequestException { public function __construct(string $message = "", int $code = 409, - \Throwable $previous = null) { + ?\Throwable $previous = null) { parent::__construct($message, $code, $previous); } } diff --git a/src/acdhOeaw/arche/core/DuplicatedKeyException.php b/src/acdhOeaw/arche/core/DuplicatedKeyException.php index fe2a165..2ab8b23 100644 --- a/src/acdhOeaw/arche/core/DuplicatedKeyException.php +++ b/src/acdhOeaw/arche/core/DuplicatedKeyException.php @@ -33,7 +33,7 @@ class DuplicatedKeyException extends RepoException { public function __construct(string $message = "Duplicate key value violates unique constraint", int $code = 409, - \Throwable $previous = null) { + ?\Throwable $previous = null) { parent::__construct($message, $code, $previous); } } diff --git a/src/acdhOeaw/arche/core/Metadata.php b/src/acdhOeaw/arche/core/Metadata.php index 65f248c..7bb08be 100644 --- a/src/acdhOeaw/arche/core/Metadata.php +++ b/src/acdhOeaw/arche/core/Metadata.php @@ -145,7 +145,7 @@ public function update(DatasetNode $newMeta, array $preserve = []): void { $this->graph->add($newMeta->map(fn($x) => $x->withSubject($node))->withNode($node)); } - public function loadFromRequest(string $resUri = null): int { + public function loadFromRequest(?string $resUri = null): int { $format = filter_input(INPUT_SERVER, 'CONTENT_TYPE'); $length = (int) filter_input(INPUT_SERVER, 'CONTENT_LENGTH'); $node = DF::namedNode($this->getUri()); diff --git a/tests/TestBase.php b/tests/TestBase.php index 7e770b4..a1775e7 100644 --- a/tests/TestBase.php +++ b/tests/TestBase.php @@ -255,7 +255,7 @@ protected function updateResource(DatasetNode $meta, ?int $txId = null, return $resp; } - protected function deleteResource(string $location, int $txId = null): bool { + protected function deleteResource(string $location, ?int $txId = null): bool { $extTx = $txId !== null; if (!$extTx) { $txId = $this->beginTransaction(); @@ -276,7 +276,7 @@ protected function deleteResource(string $location, int $txId = null): bool { * @param int $txId * @return array */ - protected function getHeaders(int $txId = null): array { + protected function getHeaders(?int $txId = null): array { return [ self::$config->rest->headers->transactionId => $txId, 'Eppn' => 'admin',