Skip to content

Commit 6029fa2

Browse files
authored
Merge pull request #29 from pdsinterop/feature/php84
fix nullable values
2 parents 5681ad8 + c9408ef commit 6029fa2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Exception.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class Exception extends \Exception
66
{
7-
public static function create(string $error, array $context, \Exception $previous = null): Exception
7+
public static function create(string $error, array $context, ?\Exception $previous = null): Exception
88
{
99
return new self(vsprintf($error, $context), 0, $previous);
1010
}

src/Server.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ final public function setNotifications(SolidNotificationsInterface $notification
9696
//////////////////////////////// PUBLIC API \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
9797

9898
// @TODO: The Graph should be injected by the caller
99-
final public function __construct(Filesystem $filesystem, Response $response, Graph $graph = null)
99+
final public function __construct(Filesystem $filesystem, Response $response, ?Graph $graph = null)
100100
{
101101
$this->basePath = '';
102102
$this->baseUrl = '';
@@ -588,6 +588,10 @@ private function handleCreateDirectoryRequest(Response $response, string $path):
588588

589589
private function sendNotificationUpdate($path, $type)
590590
{
591+
if (!isset($this->notifications)) {
592+
return;
593+
}
594+
591595
$baseUrl = $this->baseUrl;
592596
$this->notifications->send($baseUrl . $path, $type);
593597

@@ -788,7 +792,7 @@ private function listDirectoryAsTurtle($path)
788792
// ACL and meta files should not be listed in directory overview
789793
if (
790794
$item['basename'] !== '.meta'
791-
&& in_array($item['extension'], ['acl', 'meta']) === false
795+
&& in_array($item['extension']??'', ['acl', 'meta']) === false
792796
) {
793797
try {
794798
$linkMetadataResponse = $this->handleLinkMetadata(clone $this->response, $item['path']);

0 commit comments

Comments
 (0)