Skip to content

Commit 0edad57

Browse files
committed
Change code in SolidStorage route to be cleaner
- Dead code (remove unused variable) - Fix dynamic call to static method - Use statements (remove unused, sort alphabetically) - Whitespace fixes (convert all indents to tabs, remove trailing whitespace)
1 parent 4e335b8 commit 0edad57

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

lib/Routes/SolidStorage.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
<?php
22
namespace Pdsinterop\PhpSolid\Routes;
33

4-
use Pdsinterop\PhpSolid\User;
5-
use Pdsinterop\PhpSolid\StorageServer;
6-
use Pdsinterop\PhpSolid\ClientRegistration;
4+
use Laminas\Diactoros\Response;
5+
use Laminas\Diactoros\ServerRequestFactory;
76
use Pdsinterop\PhpSolid\SolidNotifications;
7+
use Pdsinterop\PhpSolid\StorageServer;
8+
use Pdsinterop\PhpSolid\User;
89
use Pdsinterop\PhpSolid\Util;
910
use Pdsinterop\Solid\Auth\WAC;
1011
use Pdsinterop\Solid\Resources\Server as ResourceServer;
11-
use Laminas\Diactoros\ServerRequestFactory;
12-
use Laminas\Diactoros\Response;
1312

1413
class SolidStorage {
1514
public static function respondToStorage() {
1615
$requestFactory = new ServerRequestFactory();
17-
$rawRequest = $requestFactory->fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES);
16+
$rawRequest = $requestFactory::fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES);
1817

1918
try {
2019
StorageServer::initializeStorage();
@@ -52,7 +51,6 @@ public static function respondToStorage() {
5251
$ownerWebId = StorageServer::getOwnerWebId();
5352
$owner = User::getUserByWebId($ownerWebId);
5453

55-
$allowedClients = $owner['allowedClients'] ?? [];
5654
$allowedOrigins = array_merge(
5755
($owner['allowedOrigins'] ?? []),
5856
(TRUSTED_APPS ?? [])
@@ -76,4 +74,3 @@ public static function respondToStorage() {
7674
StorageServer::respond($response);
7775
}
7876
}
79-

0 commit comments

Comments
 (0)