Skip to content

Commit

Permalink
PHP 8.4 deprecation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zozlak committed Sep 26, 2024
1 parent 44d900b commit 1e11d7f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/acdhOeaw/arche/core/BadRequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion src/acdhOeaw/arche/core/ConflictException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion src/acdhOeaw/arche/core/DuplicatedKeyException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion src/acdhOeaw/arche/core/Metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions tests/TestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -276,7 +276,7 @@ protected function deleteResource(string $location, int $txId = null): bool {
* @param int $txId
* @return array<string, mixed>
*/
protected function getHeaders(int $txId = null): array {
protected function getHeaders(?int $txId = null): array {
return [
self::$config->rest->headers->transactionId => $txId,
'Eppn' => 'admin',
Expand Down

0 comments on commit 1e11d7f

Please sign in to comment.