Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Exception extends \Exception
{
public static function create(string $error, array $context, \Exception $previous = null): Exception
public static function create(string $error, array $context, ?\Exception $previous = null): Exception
{
return new self(vsprintf($error, $context), 0, $previous);
}
Expand Down
8 changes: 6 additions & 2 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ final public function setNotifications(SolidNotificationsInterface $notification
//////////////////////////////// PUBLIC API \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

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

private function sendNotificationUpdate($path, $type)
{
if (!isset($this->notifications)) {
return;
}

$baseUrl = $this->baseUrl;
$this->notifications->send($baseUrl . $path, $type);

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