Skip to content

Commit 7600bd2

Browse files
committed
Remove unused imports
1 parent 9bc79cc commit 7600bd2

File tree

6 files changed

+10
-38
lines changed

6 files changed

+10
-38
lines changed

src/Model/BasicContainer.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
namespace App\Model;
44

5-
use App\Trellis\StaticLdp\Provider\StaticLdpProvider;
6-
use Silex\Application;
7-
use Symfony\Bundle\FrameworkBundle\Templating\Loader\FilesystemLoader;
8-
use Symfony\Bundle\FrameworkBundle\Templating\PhpEngine;
9-
use Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser;
105
use Symfony\Component\HttpFoundation\Request;
116
use Symfony\Component\HttpFoundation\Response;
127
use Twig\Environment;
@@ -73,22 +68,6 @@ public function respond(Request $request, Environment $twig_provider, array $opt
7368
if ($responseFormat == "jsonld") {
7469
$content = $graph->serialise($responseFormat, $this->getSerialisationOptions($accept));
7570
} elseif ($responseFormat == "html") {
76-
$options = [
77-
"compact" => true,
78-
"context" => (object) [
79-
'id' => '@id',
80-
'type' => '@type',
81-
'modified' => (object) [
82-
'@id' => self::DCTERMS_NS . 'modified',
83-
'@type' => 'http://www.w3.org/2001/XMLSchema#dateTime'
84-
],
85-
'contains' => (object) [
86-
'@id' => self::LDP_NS . 'contains',
87-
'@type' => '@id'
88-
]
89-
]
90-
];
91-
9271
$data = json_decode($graph->serialise("jsonld"), true);
9372
$dataset = $this->mapJsonLdForHTML($data, $this->resourceConfig['prefixes']);
9473

src/Model/NonRDFSource.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace App\Model;
44

5-
use App\Trellis\StaticLdp\Provider\StaticLdpProvider;
6-
use Silex\Application;
75
use Symfony\Component\HttpFoundation\BinaryFileResponse;
86
use Symfony\Component\HttpFoundation\Request;
97
use Symfony\Component\HttpFoundation\Response;

src/Model/RDFSource.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace App\Model;
44

5-
use App\TrellisConfiguration;
6-
use App\Model\Resource;
75
use Symfony\Component\HttpFoundation\BinaryFileResponse;
86
use Symfony\Component\HttpFoundation\Request;
97
use Symfony\Component\HttpFoundation\Response;
@@ -31,7 +29,6 @@ public function respond(Request $request, Environment $twig_provider, array $opt
3129
$extParts = explode(".", $this->path);
3230
if (count($extParts) > 1) {
3331
$ext = array_pop($extParts);
34-
$described = implode(".", $extParts);
3532
if (file_exists(implode(".", $extParts))) {
3633
$uri = $request->getUri();
3734
$link = "<" . substr($uri, 0, strlen($uri) - strlen($ext) - 1) . ">; rel=\"describes\"";

src/Model/Resource.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace App\Model;
44

5-
use App\DependencyInjection\StaticLdpExtension;
6-
use App\TrellisConfiguration;
75
use Symfony\Component\HttpFoundation\Request;
86
use Twig\Environment;
97

@@ -42,8 +40,6 @@ public function __construct($path, array $formats, array $resourceConfig)
4240
* The request.
4341
* @param \Twig\Environment $twig_provider
4442
* The twig provider.
45-
* @param \App\Trellis\StaticLdp\TrellisConfiguration $configuration
46-
* The configuration options.
4743
* @param array $options
4844
* Options for the response.
4945
* @return \Symfony\Component\HttpFoundation\Response
@@ -118,7 +114,7 @@ protected function getDigestAlgorithm($wantDigestHeader)
118114
* The expanded JSON-LD parsed into a PHP array
119115
* @param $prefixes
120116
* User-defined prefixes to use
121-
* @return Array
117+
* @return array
122118
* A new array suitable for the Twig templates
123119
*/
124120
protected function mapJsonLdForHTML($jsonld, $prefixes)
@@ -201,8 +197,6 @@ protected function getResponseFormat(Request $request)
201197
/**
202198
* Find the mimeType for the request
203199
*
204-
* @param array $validRdfFormats
205-
* Supported formats from the config.
206200
* @param \Symfony\Component\HttpFoundation\Request $request
207201
* The current request.
208202
*

test/MethodsNotAllowedTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace App\Tests;
44

5+
use App\TrellisConstants;
6+
57
/**
68
* Unit Test of methods not allowed response.
79
*
@@ -39,7 +41,7 @@ public function testPostMethod()
3941
*/
4042
public function testPatchMethod()
4143
{
42-
$crawler = $this->client->request('PATCH', "/");
44+
$this->client->request('PATCH', "/");
4345
$this->assertEquals($this->client->getResponse()->getStatusCode(), 405, "PATCH should not be allowed.");
4446
$this->assertTrue($this->client->getResponse()->headers->has('Link'), "Missing Link header");
4547
$headers = $this->client->getResponse()->headers->get('Link');
@@ -61,7 +63,7 @@ public function testPatchMethod()
6163
*/
6264
public function testPutMethod()
6365
{
64-
$crawler = $this->client->request('PUT', "/");
66+
$this->client->request('PUT', "/");
6567
$this->assertEquals($this->client->getResponse()->getStatusCode(), 405, "PATCH should not be allowed.");
6668
$this->assertTrue($this->client->getResponse()->headers->has('Link'), "Missing Link header");
6769
$headers = $this->client->getResponse()->headers->get('Link');

test/Model/RDFSourceTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ public function testGetRDFSource()
4949
$this->assertEquals($size, $response->headers->get('Content-Length'), "Content-Length header incorrect");
5050

5151
$this->client->request('GET', "/nobel_914.ttl", [], [], ['HTTP_ACCEPT' => $expected_mime]);
52-
$this->assertEquals(200, $this->client->getResponse()->getStatusCode(), "GET should be allowed a second time.");
53-
$this->assertTrue($this->client->getResponse()->headers->has("etag"), "Missing Etag header.");
54-
$this->assertEquals($etag, $this->client->getResponse()->headers->get('etag'), "Etags don't match.");
52+
$response = $this->client->getResponse();
53+
54+
$this->assertEquals(200, $response->getStatusCode(), "GET should be allowed a second time.");
55+
$this->assertTrue($response->headers->has("etag"), "Missing Etag header.");
56+
$this->assertEquals($etag, $response->headers->get('etag'), "Etags don't match.");
5557

5658
$headers = [
5759
'HTTP_ACCEPT' => $expected_mime,

0 commit comments

Comments
 (0)